TIL, 2018-03-07, Non-MRI Ruby?
Musings
- Should I make a script for doing
bundle update <GEM NAME> | ag <GEM NAME>
? - Fixing CircleCI bugs today. Reference Reference
Non-MRI Ruby for Production Apps?
- JRuby, Rubinius, and TruffleRuby are all parallel implementations of Ruby, which is something that some people appreciate.
- JRuby for a real time analytics pipeline. It’s because of proper threading and a good GC.
- The first use case was a process working with RabbitMQ and MongoDB, which was very tricky in MRI.
- JRuby is used for places where code performance is a bottleneck. There’s usually a lot of low-hanging fruit to optimize in an app before thinking you need the baggage of a non-MRI Ruby.
- MRuby to build a GUI for a musical synthesizer. MRuby is much easier to embed than other versions.
- JRuby in production.
Strong Parameters for Rails API?
- If you’re not using mass-assignment, it’s still a personal choice. Assume that your users an pass in bad parameters.
- Strong params is whitelisting in the controller. It works the same as a non-API app.
- Strong params: you are force to list the attributes which you are allowing to be changed for a particular circumstance.
- Complex validation requirements:
jschema
, this is quite flexible and more approachable than strong parameters.