Does anyone know of a small exemplar Rails app (<<10 models/controllers) written in Rails 8 using all the defaults? #rails
Posts by Simon James
Here's another one for you, a regex that will match almost any ruby string: github.com/mwnciau/rbla...
Yeah, you're right. I think it would've been much clearer to extract out to a constant, but the /o modifier allows in-place optimisation so that's what I did because it was easier!
The use case for /o is when you're interpolating (constant) regex objects inside other objects. It lets you split out sub-expressions, increasing readability, without a significant performance hit.
github.com/mwnciau/rbla...
The RubyMine plugin might still be a bit rough and ready. Let me know if you have any issues with it.
Really interested in your vision for Herb, particular level 6. You seem to have gone through a similar journey to me, taking inspiration from Heex, whereas I took inspiration from Laravel when I made RBlade: github.com/mwnciau/rblade
There's for sure lots of room for improving templates in Rails.
LSPs seem an order of magnitude easier to implement than adding a templating language natively! I was warned away from trying it. I had a crack: github.com/mwnciau/herb... / plugins.jetbrains.com/plugin/27954...
Happy to hand over/take these down if you'd prefer to keep control over IDE plugins.
@marcoroth.dev I think I saw you were making a RubyMine plugin for Herb? How's that going (I've done a bit of JetBrains plugin dev and it can be pretty awful!)
Here's a simplified example of what I mean in PHP. Defining the shape of hashes can add a lot of safety when working with JSON, for example.
phpstan.org/r/d1c6ccf3-e...
I recently read "Division by Zero" by Ted Chiang, a short story about an inconsistent mathematical system. You might might like it.
@emilysamp.dev Great talk this morning! I'm excited about the new inline RBS syntax of sorbet. I heard it may not be feature complete compared to sorbet's sig? Is adding hash keys to types on the roadmap at all?
@rosa.codes Great talk this morning! I was very impressed at how clearly you explained everything in such a short time. This mathematician approves ๐ Have you ever tinkered with Haskell (or even elixir/phoenix)?
@andycroll.bsky.social Nice font! Are those ligatures?
I'd not come across either, but I can see the similarities. The idea came from Laravel's data_get and data_set methods, which I've used in the past.
I've found myself needing to create simple interfaces for complicated data structures in Ruby recently.
I've just released a small, self-contained gem for interacting with nested data structures using dot-delimited keys:
github.com/mwnciau/dotkey #ruby
True, false or error?
"% == %%%"
#ruby
Just released RBlade 3.0, a performant component-based templating library for Rails. Now with dynamic components and options to integrate into ERB and other templating languages. github.com/mwnciau/rblade #rails #rubyonrails #ruby
Looking to add type signatures to my #RubyOnRails app - to improve editor suggestions and possible add steep. Any suggestions/experiences? Considering going for a Yard + Sord approach.
I find the string freeze/unfreeze modifiers a little surprising. +"0" and -"0" give very different results in some other languages!