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.
Rails DB gem was updated
Hello, please check the latest update on rails_db gem https://github.com/igorkasyanchuk/rails_db [more inside]
An Easier Way to Think About `self`
Ruby’s self method can seem arbitrary, but there is an underlying structure to its behavior. When you understand it, not only will your own programs make more sense, but so will many advanced Ruby techniques which may have previously been shrouded in mystery. http://www.rubyletter.com/blog/2017/01/24/understanding-ruby-self.html
New version of billing.insitu.tools deployed
Hi everybody. I’m proud to announce that I’ve deployed a new version of my RoR based Invoicing solution for freelancers. Its available at https://billing.insitu.tools. [more inside]
Benchmarking a Go AI in Ruby: CRuby vs. Rubinius vs. JRuby vs. Truffle – a year later
After a first run ~13 months ago I thought it was time to do a new run and see how fast our contestants have gotten since the last time! especially now that Ruby 3x3 is a thing, it asks the question how much faster are the different implementations as compared to the Ruby 2.0 baseline. Included Rubies are TruffleRuby, CRuby/MRI, JRuby and Rubinius. Check out more in the blog post!
Simplifying Kafka for Ruby apps
Even with a client library, Kafka is unwieldy to manage and benefits greatly from a common framework with familiar concepts [more inside]
gem for flash messages
Fun and cute flash messages for your Ruby on Rails application. Easy to use. https://github.com/kevyder/puffly
Ruby Coercion Protocols Part 2
What’s the difference between #to_i and #to_int? How to sum two value objects? Let’s learn Ruby Coercion Protocols in depth. https://blog.dnsimple.com/2017/01/ruby-coercion-protocols-part-2/
Making sense of ActiveRecord joins, includes, preload, and eager_load
Like a pair of jumper cables, ActiveRecord’s joins, includes, preload, and eager_load methods are incredibly useful, but also very dangerous when used incorrectly. Knowing when and where to use each approach - and even when to combine them - can save you considerable trouble as your app grows.
Rendering Ember components from Rails
A nice guide on all the available ways to integrate Ember with Rails.
[Screencast] Random Ruby Tips and Tricks
A collection of different Ruby tips and tricks. Hope you find some of them useful! https://www.driftingruby.com/episodes/random-ruby-tips-and-tricks
ReadSource 0.2.4 released!
ReadSource is for reading method source code and now features support for inline methods, an attr? checker, and the ability to open method source code directly into a VIM server instance without disturbing the current Ruby process. read_source
Elixir for Rubyists
On the surface, Elixir and Ruby share a similar syntax. This familiarity may at first hide the striking differences between the two languages. Read my gentle introduction for Ruby developers intrigued to learn more about Elixir. Discover the language, created by José Valim, that took the Erlang virtual machine (BEAM) and put a sensible face on it.
Small steps to DRYer RSpec
The blog post shows several tricks/code snippets for making your specs more DRY (and preferrably one-line). It mostly takes approaches of rspec/its gem a bit further.
tty-file v0.2.0 release!
The new tty-file adds new powerful ways to work with directory contents by using methods such as create_directory and copy_directory. You can also easily create checksums for files and strings by calling checksum_file. Enjoy!
Using Docker For Development
I’ve written an article on using docker for development in Rails. This is part one of my Docker series.
Rails + Postgres Array + ANY LIKE
Ruby on Rails has a good support for Postgres Array type. I really like using this feature when creating a separate database table sounds like over-engineering. In this short post I want to share my solution for the following problem: “find a record for which any of its tags contains a given string”.
google_assistant gem can get user details
The google_assistant gem makes it easy to create Google Assistant actions in Ruby. It has hit v0.2, which brings the ability to request details about the user: their name, their zip code, and their precise location.
FXRuby Enhancement 0.1.0
I’ve added component reuseability and and easy way to deal with data-targets, and more. Oh, and there’s more documentation. https://github.com/flajann2/fxruby-enhancement/blob/master/README.org ‘Live’ example code can be found at: https://github.com/flajann2/rubyneat-panel/tree/master/lib/rubyneat-panel
How To Test Ruby CLI: The Setup
One of the most difficult tasks I met during Hanami development is to write integration tests for the Command Line Interface (CLI). This challenge required a deep knowledge of the Ruby toolchain. http://lucaguidi.com/2017/01/20/how-to-test-ruby-cli-the-setup/
Auto-reconnect for ActiveRecord connections
Custom auto-reconnect in Rails applications when using ActiveRecord connections.
Rescue exceptions DSL for plain Ruby objects with Rails
Likewise in Rails controllers we have a useful functionality to catch exceptions with rescue_from in order to change the default behavior, it’s too easy to obtain it for any other type of a Ruby object in Rails applications. Check out this post about the solution.
Decoradar – Simple and zero auto-magical decorator+serializer in Ruby
Decoradar is a simple and magic-free decorator+serializer that brings ActiveModel::Serializer/Draper DSL-style declaration to Plain Ruby Object. View more at https://github.com/huynhquancam/decoradar
Writing Sprockets plugin
In this blog post i show you how easy it is to write an Sprockets plugin for your Rails Asset Pipeline: http://masa331.github.io/2017/01/10/writing_sprockets_plugin.html