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.
Using Genetic Algorithms in Ruby
With genetic algorithms, you can solve optimization problems using concepts you find in nature (reproduction, survival of the fittest, adaptation to the environment). Jesus Castello shows how they work and how you can implement your own using Ruby. Read here.
I Love Ruby updated
Added Test Driven Development section to I Love Ruby, You can download the book here https://mindaslab.github.io/I-Love-Ruby/
Announcing Settei - manage app config using YAML, yet still being 12-factor compliant
Settei aims to be the successor of Settingslogic and Figaro. YAML is used for storing configuration, but during deploy it will be serialized as one environment variable, in order to be 12-factor compliant.
Refactoring your views with ActiveSupport methods
I talk about some legacy code I had to fix that was radically simplified by using an ActiveSupport utility method (in this case, in_groups_of). [more inside]
Catch Javascript errors in your system tests
How to make your tests fail in case of Javascript errors with capybara and chrome headless [more inside]
Avoid interpolation in heredoc
By default, heredoc accepts interpolation and special characters.. see more
Grpc Tutorial with Ruby
A small tutorial to understand how Grpc works a framework for RPC (Remote Procedure Call) developed by Google, in the tutorial we explore how easy is to create a ruby Grpc server as well a ruby client. Interested? READ MORE
Ruby on Rails - your own slow query log without the sql configuration
Reading slow query log is a great way to detect weak places in any app where you have to refactor code in order to improve performance. What if you can create your own slow query detecting engine and report slow queries to the external reporting system? READ MORE
Ruby 2.5 prints backtrace and error message in reverse order
Ruby 2.5 prints backtrace in reverse order (stack frames first and error last) if STDERR is unchanged and a TTY. This blog post explains it in detail.
kitty - CryptoKitties Offline Genes Reader 'n' Mix Genes (Matron+Sire) Reporter
Hello,
I’ve put together kitty - a new command line tool for CryptoKitties and Copycats - free and open source in ruby that works offline (use datafiles in .csv). 1) Kitty Genes Reader / Report - Pass in the id (e.g. 1, 43, etc.) of the kitty to print a genes report. Example:$ kitty 1. 2) Kitty Mix Genes (Matron + Sire) Report - Pass in two ids for the matron and sire kitties to print a mix genes report. Example: $ kitty 2 43. Enyoy. Cheers. Prost.
Microservices for Startups: An Interview with Stephen Blum of PubNub
An in-depth interview with Stephen Blum of PubNub on how they use Microservices. PubNub provides connectivity for over 350 million mobile devices, which is greater than the population of the United States with over 2 trillion transactions going over our network every month.
RabbitMQ is more than a Sidekiq replacement
I’ve had gripes with Sidekiq because of which I switched to RabbitMQ. Here are my thoughts and experiences after a year of using it in production. [more inside]
Geet - GitHub commandline interface
The geet tool allows to perform the most common operations (PR handling, issues handling, gists creation, milestones listing etc.) entirely via commandline. [more inside]
HABTM to has_many :through
In certain cases, has_many :through permits to declare the join table as model. And so, in order to operate (filter, sort, allow, reject, etc..) at a join table level.. see more
Something about and beyond the code: Ruby on Rails dev house behind the scenes.
A close look at how Ruby on Rails software house runs. Guidebook for those who are interested in working for or with a development agency or those who want to run a software house. [more inside]
Why Service Objects are an Anti-Pattern
Adding to the ongoing conversation regarding service objects: not only do I think better solutions exist than service objects in the majority of cases, I maintain that service objects are an anti-pattern which indicates a troubling lack of regard for sound object-oriented design principles. Find out why with detailed code examples.
Upgrade Rails from 4.2 to 5.0
The latest follow up to our Rails upgrades blog post series. https://www.ombulabs.com/blog/rails/upgrades/upgrade-rails-from-4-2-to-5-0.html
Introducing Rack::Reducer — map URL params to data filters, in any Rack app
Rack::Reducer is a new gem for safely mapping URL params to functions that filter data. [more inside]
Implementing a basic debug mode for Ruby CLI
In my latest article about debug mode in CLI Ruby programs I am mentioning how to print backtraces on demand, incorporate a logger that does nothing when does not need to and how to directly flush all stdout to the underlying OS without buffering it up.
[Screencast] Encrypted Credentials in Rails 5.2
In this episode, we take a look at the Encrypted Credentials of Ruby on Rails 5.2 and how we can patch it so that we can use other YAML files like a development.yml and test.yml. https://www.driftingruby.com/episodes/encrypted-credentials-in-rails-5-2
Embracing composability: be_json RSpec matcher
Describing another attempt to create good RSpec matcher, as well as some theoretical examination of RSpec composability patterns.
Regexp Implementation in Ruby
A closer look at how ruby implements regular expressions. This blogpost covers the following topics: [more inside]
unique_validation_inspector 0.3.0
New version of UniqueValidationInspector is released - a task that helps you find unique validations in models that do not have proper DB indexes. [more inside]
Practical Differences between Working in Ruby and iOS
Developing iOS mobile apps and server-based Ruby applications is different on many levels. In this blog post, I will present a high-level overview of different aspects of day-to-day working in these technologies. [more inside]