The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
https://github.com/AndyObtiva/puts_debuggerer
Debuggers are great! They help us troubleshoot complicated programming problems by inspecting values produced by code, line by line. They are invaluable when trying to understand what is going on in a large application composed of thousands or millions of lines of code. [more inside]
Shared contexts in RSpec
On a recent project, I experimented with shared contexts to see if they could reduce boilerplate in the tests and was generally satisfied with the results, but also found a sneaky gotcha. [more inside]
Rails and React: Fixing "Module not found" errors for JSX files
We’re just getting started with Webpacker and React in our Rails apps. Recently, we hit a problem getting started with React on Rails giving Module not found errors for JSX files. This is a brief post on the issue and what we did to fix it: https://chrisblunt.com/rails-and-react-fixing-module-not-found-errors-for-jsx-files/
Why doesn't Webpacker use my test config when running Rails tests?
When running Rails system or integration tests, you might be surprised to learn that Webpacker will load your development webpack config. What’s the deal? https://rossta.net/blog/why-doesnt-webpacker-use-my-test-config-when-i-run-rails-tests.html
Ruby Method Overloading
A hack to add Method Overloading feature to Ruby. https://lucaguidi.com/2020/07/22/ruby-method-overloading/
To Call or not Callback
This is the question for ActiveRecord callbacks, https://marouenbousnina.com/tutorials/2020-07-20-to-call-or-not-to-callback/
How To Extend Float Class In Ruby
Sometimes we need to customize Ruby classes. I am going to introduce how to extend the Ruby Float class in simple steps. https://www.botreetechnologies.com/blog/how-to-extend-float-class-in-ruby
New Truemail 📨 web API client library for Ruby
New version of Truemail web API client has been released :rocket:: https://github.com/truemail-rb/truemail-ruby-client
tty-prompt v0.22.0 release with many new features
The latest tty-prompt release packs many new features that further enhance prompting users for input. Conversion of input into Array or Hash objects, :quiet option to silence output and allow for dynamic menus, :show_help option to control help display (on_start/always/never), shortcuts for selecting of all/reverse choices in multi-select prompt and much more. Enjoy!
Installing Omnivore API in Ruby on Rails Application
Integrate Omnivore API in Ruby on Rails development to access every action and detail in PoS transactions. Here’s how to install Omnivore API in your Ruby on Rails project. https://www.botreetechnologies.com/blog/omnivore-api-ruby-rails
Integration Testing Best Practices (aka how to sleep at night)
In this video, I reflect back on 10-years of integration testing my Ruby on Rails app using rack-test and Selenium and distill what’s important in reducing brittleness, improving test speed, and getting the most bang for your testing buck: https://www.semicolonandsons.com/episode/integration-testing-best-practices
Introduce renderer module
Just published the fifth chapter of the API-only ruby on rails course: Introduce renderer module [more inside]
Anonfiles.rb
https://github.com/peterlamber/anonfiles.rb up & download images to anonfiles - the free anonymous (duh) filehoster
Blocks in ActiveRecord's where, a small post
https://dev.to/brunvez/a-take-on-empowering-activerecord-4iog ActiveRecord has limited power when it comes to complex queries, this is a proposal to improve the way we query for data
Defining gem dependencies in single file Ruby scripts
Bundler has an inline gemfile definition feature that lets you define gem dependencies in a single-file Ruby script. Read on to see how: [more inside]
Building a Toy Lexer in Ruby
Lexers are magical. They take your messy, hand-typed, human text, and convert it into a clean data structure that the computer can process. Every time you run a ruby program, use structured search or type in a date by hand, you’ll find a lexer hard at work. In this article, Alex Braha Stoll pulls back the curtain to show us how lexers work and how to implement one for a simple programming language. https://www.honeybadger.io/blog/building-lexer-ruby/
Modifying Ruby's StdLib with Gems
How to safely patch Ruby’s StdLib in Gems, how to avoid issues of combined Module#prepend & method aliasing, from other patches.
Traffic problems: Software vs. Daily life
Interesting similarities in impacts and solutions https://medium.com/p/709d75229b86?source=friends_link&sk=882126397b35b32895295b3e88c170f7
Custom directory for Webpacker in Rails apps
It is possible to use custom directory for #Webpacker code instead of the default app/javascript 🤟🏻 [more inside]