- Short Ruby Newsletter
- Posts
- π Issue #10 - 12-18 September 2022
π Issue #10 - 12-18 September 2022
The one about RSpec
Hello,
Iβm @lucianghinda, the curator of this newsletter. If you want a short excerpt of this newsletter containing only some of the images with code, I created one here. But I invite you to read the entire newsletter as it has excellent content π.
If you like it and want to help me reach a wider audience, I would kindly ask you to leave some feedback/short written testimonial that I can display on the About page.
This edition was created with support from @adrianthedev from Avo for Ruby on Rails (a friendly full-featured Rails admin panel) and from @jcsrb, who sent me recommendations to include in the newsletter.
If you have any feedback or ideas about this newsletter, please reach out on Twitter or via email at [email protected]
π Thiago Massa shared about how to do a proper Ruby memoization in Ruby
π Shino Kouda shared an example of how to use enum in Rails with integer type and this generated a good discussion about possible issues generated by this approach and how to overpass them:
π Josh Cheek shared that when using Postgres, one can define a Postgres Enum type. Here is the gist he created that works by adding the enum type with raw SQL. If you want to do this with Rails 7 it added support for this enum type:
If you want to add a new enum, you will need to write raw SQL with ALTER TYPE. See Rails 7 guides for enumerated types
About using integers for enums, here is a good discussion explaining the pros and cons:
Joel Drapper then proposed using a gem he wrote:
π Kirill Shevchenko shared an example of encoding and decoding JSON with gRPC:
π Stefan Vermaas shared how to display flash messages with Turbo in Rails:
π Nate Berkopec shared how to profile an entire Rails boot sequence:
There is a good discussion there about various ways to achieve that. While replying to the thread, Jean Boussier did a PR to stackprof gem to make this happen quickly with the following command:
π Shino Kouda shared code sample about parsing a JSON and instantiating objects using a feature of JSON.parse:
Just note that using OpenStruct will affect your performance. Here is what the official Ruby documentation says about OpenStruct:
π Kirill Shevchenko shared a code sample to show how to open IRB console within the current scope:
π Benito Serna shared a sample code about polymorphic rendering with ActiveModel and ActionView:
π Justin Searls shared his opinion about why he recommends people to avoid RSpec.
This generated a lot of responses. You should read the entire thread and also click the quoted tweets. Here is just a summary, but please read those two links to make up your own conclusion:
π Kirill Shevchenko shared a code sample showing curry for procs
π Thiago Massa shared a code sample with .() shorthand syntax for .call:
Joel Drapper also added the double dot notation works, and it does the same:
π Nate Hopkins shared a script to work with libraries that are incompatible with Turbo Drive as they assume that the document head is loaded and parsed on every page visit:
π Dave Paola shared that they launched a new project - a development agency with the mission to be the place where Junior Ruby on Rails developers start their careers:
π Meghan Gutshall asked a question about how to explain a Ruby class:
Here are some replies, but you can find more in the thread:
If you read so far and you like the content, maybe you take into consideration sharing this and subscribe:
Related (but not Ruby specific)
Celso de SΓ‘ asked about what it means to be a mid-level Ruby developer. Here are some of the answers to this question:
I think you should also take a look at βgeekery skillsetβ proposed by GeePaw Hill:
Joe Masilotti π shared a nice trick to skip running Github Actions:
Read the documentation for this here.
Tobias Petry.Sql shared a database tip about making the index invisible:
Brandon Weaver shared about seniority and self-marketing:
You can read the full thread here or the article Brandon wrote expanding this on this blog: Beyond Senior β The Peacock, the Hermit, and the Counsel
Articles and Videos
Courses or Books or Communities
Brandon Weaver shared launched a new community focused on learning Ruby. The discord invitation is this one, and the main website is rubylearning.dev. This week we already started working as a group on the book Rebuilding Rails by Noah Gibbs.
Kasper Timm Hansen shared an update about his course called Product Focused Ruby.
Something to read
Soutaro Matsumoto shared their presentation slides from RubyKaigi about how to use Ruby types. See the slides here.
Newsletters
Greg Molnar shared a new issue of This Week in Rails written by Petrik de Heus
Andrew Mason shared a new issue of The Ruby Radar. Read 68: Hack the Planet!
David Colby shared a new issue of Hotwiring Rails. Read Hotwiring Rails - September 2022
Awesome Ruby Newsletter released their 330 newsletter. Read 330 Awesome Ruby Newsletter
RubyWeekly published its 620 newsletter. Read Ruby Weekly #620
Articles
Eric Berry shared that they wrote about how to use fswatch to build a Rails watcher/runner
Joe Masilotti π shared a list of 10 of his favorite online communities for Ruby and Rails communities.
Something to watch π₯ or listen π§
Videos
π₯ Drifting Ruby shared a new episode of the video newsletter for This week in rails. Watch β This Week in Rails Sept 17th, 2022
π₯ Joel Drapper shared a session where he started converting a large ERB to Phlex and then discovered and fixed a bug. Watch β Just trying out
π₯ The Rubber Duck Dev Show shared a new episode with Brittany Martin and Josh Gaastra about Engineering Managers and Product Managers. Watch β EM vs PM! with Brittany and Josh
π₯ Avo shared a video doing a walkthrough of the new features they released. Watch β Avo Admin 2.15 for Ruby on Rails
Audio & Podcasts
π§ Jason Sweet launched a new episode of the Code with Jason podcast where he invited Adrian Marin to talk about Avo and how it is to make tools for developers. Listen β 161 - Adrian Marin, Founder of Avo Admin
π§ JoΓ«l Quenneville shared a new episode of The Bike Shed with Sara Jackson where they talk about The History of Computing. Listen β 354: The History of Computing
π§ Ruby For All shared a new episode about Bridgetown. Listen β Episode 8: What is Bridgetown. If you like this you should consider joining the Jared White Discord community The Spicy Web
π§ Remote Ruby shared a new episode where they invited Joel Drapper to talk about Phlex: Listen β Phlexing with Joel Drapper
Gems, Libraries, and Updates
π§° Avo shared they released a new version with a lot of features. See the changelog
π§° Postmodern shared they added ruby 3.2.0 preview 2 to ruby install. See the changelog here. Thus now, the following command should work:
π§° JRuby Dev Team shared they released version 9.3.8.0 which includes βa CVE fix for the Psych YAML library, support for lightweight fibers using Java 19 virtual threads, and a bunch of compatibility and bug fixesβ. See changelog
π§° Marco Roth shared that Turbo 7.2 rc1 was released. See the changelog
π§° Postmodern shared a gem named sord that will transform YARDoc into o Sorbet definitions.
π§° Mike Perham shared they released Sidekiq Pro 5.5.4 βfixes a batch race condition which could cause the batch pending count to read -1β. See changelog
π§° Rubygems News shared an update for a library called Spy which is a new way of mocking:
π§° Nate Berkopec shared a new library fixture_factory that helps to work with fixtures like factories. Here is a code sample:
π§° Andrew Mason shared a new library they discovered Capybara Test Helpers. Here is what it looks like:
Please consider sharing this on social media or with your colleagues:
If you have any feedback or ideas about this newsletter, please reach out on Twitter or via email at [email protected]
Reply