---
title: "Does Rails create its own 'dialect' of Ruby?"
publication: "Ruby Weekly"
issue: 590
published_at: "2022-02-10"
canonical_url: "https://rubyweekly.com/issues/590"
---

Plus a game written in Ruby, the Set class, and a binstubs tip. |        

#​590 — February 10, 2022 

[Read on the Web](https://rubyweekly.com/issues/590)   

Ruby Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/bqijv9uitjylzsgefqv9.jpg)](https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/)  

[Rails and Its Ruby 'Dialect'](https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/) — Originally sporting a title of _“Rails is not written in Ruby”_, this post makes the point that Rails' choices hugely impact what we consider to be 'Ruby' while using it. While many Rubyists think that monkeypatching is troublesome, we (nearly) all still use Rails and ActiveSupport to some extent, accepting the “magic” that they bring for convenience. Peter pushes for composition, giving examples of libraries today that do it right. 

Peter Solnica   

[Papercraft: Composable Templating for Ruby](https://noteflakes.com/articles/2022-02-04-papercraft) — Papercraft (which supports HTML, XML, and JSON) sets itself apart from other templating gems by making everything a proc, allowing easy and clear composition of templates. Reminds me of __why’s_ Markaby from back in the day, but goes further with the idea. 

Sharon Rosner   [![\](https://copm.s3.amazonaws.com/588d8541.png)](https://crunchybridge.com/start?utm_source=cp-pg&utm_medium=em) 

[🐘 The Developer Experience You Always Wanted for Postgres](https://crunchybridge.com/start?utm_source=cp-pg&utm_medium=em) — Database as a service for Postgres as it should be. Cloud agnostic, superuser access, performance tuned instances, and packed with all the extensions you need. From the Crunchy Data team that’s 100% focused on Postgres at any scale. Try it today. 

Crunchy Bridge sponsor   

**IN BRIEF:** 

- [RubyGems 3.3.7](https://blog.rubygems.org/2022/02/09/3.3.7-released.html) has been released. Gift Egwuenu has also shared her [January 2022 update](https://blog.rubygems.org/2022/02/08/january-rubygems-updates.html) on the overall RubyGems project.
- 👾 [Shadows](https://amirrajan.itch.io/shadows) is a simple DragonRuby-powered platform game by Amir Rajan you can play in your browser. Here's [the source](https://gist.github.com/amirrajan/9a4d6e45328dbe4df1a4696562a90d94).   

▶[Exploring Ruby’s Set Class](https://www.youtube.com/watch?v=bSdclWviOUk) — A quick 11-minute video that will definitely teach you something new about the `Set` class and when you should reach for it over other collections. 

Tay DeHerrera Jimenez   

[Rails 7.0.2 Released](https://rubyonrails.org/2022/2/8/Rails-7-0-2-has-been-released) — Only a tiny point release, but with some noteworthy changes nonetheless, including database schemas [now being versioned](https://github.com/rails/rails/pull/44286) with the current Rails version and no longer being able to pass `service_name` to `DirectUploadsController` 

Rafael Franca     

Jobs  

[Backend Engineer | Remote within CET (-3/+3 hours) | Full-Time](https://jobs.lever.co/qonto/284b8162-5293-4ad7-a9e6-4ad26ce0c516?lever-origin=applied&lever-source%5B%5D=Cooperpress) — Europe's leading business finance solution. You will help us simplify everything from everyday banking and financing, to bookkeeping and spend management. 
Qonto   

[Senior Rails Engineer @ Nebulab (Remote)](https://nebulab.com/careers?gh_src=a6448332teu) — Join our distributed team and build high-volume eCommerce applications in a workplace made by developers for developers. 
Nebulab   

[Find Ruby Jobs Through Hired](https://hired.com/join/?utm_source=newsletter&utm_medium=sponsor&utm_campaign=%28b2c%29%28l-all%29%28r-all%29%28cooper-rubyweekly%29&utm_content=find-your-next-job) — Create a profile on Hired to connect with hiring managers at growing startups and Fortune 500 companies. It's free for job-seekers. 
Hired    

📕 Articles & Tutorials  

[Using AWS S3 for File Storage in Rails Apps](https://www.honeybadger.io/blog/rails-app-aws-s3/) — Amazon’s S3 provides an essentially infinite way to scale your file storage (if you ignore the monthly bill..) and using it to store assets for a Rails app isn’t too complicated. 

Jeffrey Morhous   

[Reusing Rails Test Fixtures for `db:seed`](https://nts.strzibny.name/rails-fixtures-db-seed/) — _“If you always skip fixtures for factories when working with Rails, you are missing out!”_ 

Josef Strzibny   

['The Software and Infrastructure We Use to Run Our SaaS'](https://andycroll.com/ruby/infrastructure-software-we-use-to-run-our-saas/) — I always like a look behind the scenes at what stacks companies are using day-to-day. Rubyist Andy Croll shares his company’s approach here with, unsurprisingly, Rails at the heart. 

Andy Croll   

[Project Management for Software Teams Has Never Been Easier](https://shortcut.com/?utm_source=cooperRubyWeekly&utm_medium=spon_nl&utm_campaign=prospecting&utm_content=pm) 

Shortcut (formerly Clubhouse.io) sponsor   

▶[Hotwire Modals](https://www.driftingruby.com/episodes/hotwire-modals) — An unobtrusive and efficient way to launch Bootstrap modals using Turbo and Stimulus. 

David Kimura   

▶[Discussing GitHub Codespaces and Docker with Benjamin Wood](https://share.transistor.fm/s/c26849b5) — If you’ve not used Codespaces yet, you can get a Rubyist’s take here. 

Remote Ruby podcast   

[Quick Tip: How to Display the Current Environment in Rails' Console Prompt](https://pawelurbanek.com/rails-console-environment) 
Paweł Urbanek   

[TIL: ActiveRecord Transactions Roll Back on Thread Abort](https://island94.org/2022/02/til-activerecord-transactions-roll-back-on-ruby-thread-abort) 
Ben Sheldon  

🛠 Code & Tools  

[Strong Migrations 0.8: Catch Unsafe Migrations in Development](https://github.com/ankane/strong_migrations) — Detects potentially dangerous operations and prevents them running by default. 

Andrew Kane   

[Arbre: A Way to Build HTML Views in Ruby Code](https://github.com/activeadmin/arbre) — Billing itself as an ‘object-oriented DOM tree in Ruby’, Arbre is extracted from the [Active Admin](hhttps://activeadmin.info/) Rails admin framework. 

Active Admin   

[Get Stripe-Quality Webhooks for Your App in Minutes, Not Days](https://www.hookrelay.dev/?utm_source=ruby_weekly) — Skip the grunt work and let Hook Relay manage your webhooks for you. Visualize Stripe-quality webhooks for your app — make it a reality in minutes. 

Hook Relay sponsor   

[Win32::Screenshot: Capture Screenshots on Windows from Ruby](https://github.com/jarmo/win32screenshot) — It uses FFI to directly call the relevant functions in the Windows GDI system ([here's the code](https://github.com/jarmo/win32screenshot/blob/master/lib/win32/screenshot/bitmap_maker.rb) at the heart of that operation, if you're curious about calling Win32 APIs from Ruby). 

Jarmo Pertman   

[Awesome Nested Set: The Nested Set Pattern for ActiveRecord Models](https://github.com/collectiveidea/awesome_nested_set) — Billed as a replacement for acts_as_nested_set and BetterNestedSet, this now supports Rails 7. 

Collective Idea   

[AnnotateModels: Annotate Code with ActiveRecord Model Schema Info](https://github.com/ctran/annotate_models) — Having schema info at the top of your model files, say, could be handy for quicker referencing while developing. 

Cuong Tran   

[Dart Sass for Rails: Integrate Dart Sass with the Rails Asset Pipeline](https://github.com/rails/dartsass-rails) 
Ruby on Rails   

[CreateSend 6.0: A Ruby Library for the Campaign Monitor API](https://github.com/campaignmonitor/createsend-ruby) 
Campaign Monitor   

[Announcing Hanami v2.0.0.alpha6](https://hanamirb.org/blog/2022/02/10/announcing-hanami-200alpha6/) 
Luca Guidi       

💡**Tip of the Week** 

   

## Binstubs 

Have you ever griped about constantly having to type `bundle exec` before running executables within a Ruby repo? For instance, `bundle exec rubocop` or `bundle exec rails s`? We need the `bundle exec` to ensure we're getting the right version of whatever gem or executable we're running. But typing `bundle exec` continually can be cumbersome. And there could be unexpected version inconsistencies if we forget it. 

Binstubs to the rescue! Many Ruby apps we use will already have a `bin` directory containing binstubs. Rails applications, for instance, are initialized with a few binstubs, including `bin/rails`. 

Binstubs wrap around executables to ensure we're running the right version of a gem. This means that, for instance, instead of running `bundle exec rails server`, we can run `bin/rails server`, and get the same result. 

Okay, so Rails will generate some binstubs for us, but what about gems which don't have autogenerated binstubs, or if we're not in a Rails repository? We can always run `bundle binstubs <gem_name>` and bundler will generate the binstub for us. For instance `bundle binstubs rubocop` will generate `bin/rubocop`, and then instead of running `bundle exec rubocop`, we can simply run `bin/rubocop`. 

You might be reading this and thinking "`bin/rubocop`" is still cumbersome, why can't we just run `rubocop`? Turns out, we can set ourselves up so we only need to run `rubocop`. More on this next week!    

This week’s tip was written by [Jemma Issroff](https://twitter.com/jemmaissroff).          

Curated by [Peter Cooper](https://twitter.com/peterc), [Glenn Goodrich](https://twitter.com/ruprict) and [Cooperpress](https://cooperpress.com/). 

[Change your email address](https://rubyweekly.com/edit_subscription/*|UID|*) or[Stop getting this newsletter](https://rubyweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
