news, opinion, tutorials, about ruby, aggregated
Sources About
Drifting Ruby Screencasts 

Counter Cache Associations

When displaying a count of records, this will generate extra SQL Queries. Learn how to reduce the number of SQL queries called with counter caching the number of associated records.
RubyGems Blog 

2.6.12 Released

RubyGems 2.6.12 includes bug fixes.

To update to the latest RubyGems you can run:

gem update --system

If you need to upgrade or downgrade please follow the how to upgrade/downgrade RubyGems instructions. To install RubyGems by hand see the Download RubyGems page.

Bug fixes:

  • Fix test_self_find_files_with_gemfile to sort expected files. Pull request #1880 by Kazuaki Matsuo.
  • Fix issue for MinGW / MSYS2 builds and testing. Pull request #1879 by MSP-Greg.
  • Fix gem open to open highest version number rather than lowest. Pull request #1877 by Tim Pope.
  • Add a test for requiring a default spec as installed by the ruby installer. Pull request #1899 by Samuel Giddins.
  • Fix broken…
Ruby Pigeon 

Result Objects - Errors Without Exceptions

In Ruby, errors and failures are typically implemented with exceptions. In some situations, however, exceptions may not be the best choice. This article covers some of the problems with exceptions, and introduces a functional, alternative approach to error handling.

Sometimes Exceptions Suck

Pop quiz: assuming there are no bugs, what exceptions could be raised by the following line of code?

user = register_new_user(params)

It’s hard to know, without looking at the implementation:

def register_new_user(params)
  new_user =
  authorize! :create, new_user!


Even after reading the implementation, it’s still difficult…

Kevin Sylvestre 

Automating Favicon Generation in Rails using Sketch

How to use rake, rails, convert and sketch to generate a favicon.
Cognito Blog 

Thinking of Using Social Data?

Social data

Using a social network for verification became popular to reduce signup friction and tie your user’s real world identity to their online identity. Social networks will return limited, user-reported data. However, for many applications such as insurance, lending, sharing economy, and banking, more trusted sources are required and those sources of data cannot be self reported. Regulated sources include credit bureaus, government agencies, and bank records.

Here are some characteristics of the data types and uses.

Social data

  • Data is reported by a user over time and stored in various databases
  • Data may contain errors or false information
  • Creating multiple online personas is simple…
Cognito Blog 

Thinking of using social data?

Social data

Using a social network for verification became popular to reduce signup friction and tie your user’s real world identity to their online identity. Social networks will return limited, user-reported data. However, for many applications such as insurance, lending, sharing economy, and banking, more trusted sources are required and those sources of data cannot be self reported. Regulated sources include credit bureaus, government agencies, and bank records.

Here are some characteristics of the data types and uses.

Social data

  • Data is reported by a user over time and stored in various databases
  • Data may contain errors or false information
  • Creating multiple online personas is simple…
Greater Than Code 

Episode 030: Essential Developer Skills with Tom Stuart


Sam Livingston-Gray | Rein Henrichs | Janelle Klein

Guest Starring:

Tom Stuart: @tomstuart | Codon

Show Notes:

00:16 – Welcome to “Cycles in Philosophy of Software, Common Principles with Different Names & Reference” …we mean, “Greater Than Code!”

01:47 – Superhero Origin Story


04:45 – Nomenclature: “Junior” and “Senior” Developers; Differences Between “Early Career” Developers and “Experienced” Developers

13:56 – Solving the Skill Assessment Problem; Learning Methodically

20:55 – Software Development Now vs Then

29:51 – Do Programming Languages Create Certain Biases?

44:16 – Good Mentorship and Telling People What’s Next to Level Up

Want to spill your thoughts and…


Announcing the RubyLetter Podcast

RubyLetter started as an idea for a newsletter and blog to help you gain a deeper understanding of Ruby. Since then, we’ve created useful tutorials, explained how Rubyists can use design patterns in our newsletter, and have now started a weekly RubyLetter podcast. Well, ok, technically we started it in March, but we needed to work out the kinks.

The RubyLetter podcast is a short weekly podcast dedicated to giving you the tools and news you need to stay in-the-know about what’s happening in Rubyland. We’ll talk about Ruby news and events, and highlight tutorials and resources that we found useful. If you’d like to learn more about something we discussed, everything is linked in our show…

You’re busy, we…

Test Double | Our Thinking 

Accessibility Techniques

Accessibility techniques are a way to create a more usable experience for all users. An accessible experience can be viewed as a continuum, and this post is an introduction to techniques that span that continuum. We will start with accessibility techniques that are most likely to fix issues that block users with disabilities from successfully navigating your application. As we get comfortable with the most impactful techniques, we will move into techniques that create a more inclusive experience and provide equal access to even more people.

When I started learning about accessibility techniques, I was quickly overwhelmed and found it difficult to find a good jumping-off-point that humanized…

The Miners - Medium 

Crystal by Numbers

Benchmarking Kemal, Ruby on Rails, and Sinatra


TL;DR Kemal delivers 8.3x more requests than Rails and 1.5x than Sinatra, using only 15MiB (against 110MiB in Rails and 47MiB in Sinatra) and 56% of CPU (against 109% in Rails and 114% in Sinatra).

Why doing this?

When you hear anyone speaking about performance, you see a lot of comparative with C lang. But remember: the machine runs the binary code after compiling C, and not the C code itself.

What if we could compile Ruby (or actually a very similar dialect of Ruby) directly into fast machine code? That’s where Crystal lang comes in.

In order to create a benchmark of Crystal, I chose to compare using the workflow I am already used to: web…

Notes to self 

Pre/post deploy hooks with Dokku 0.5.0

Deploying with Dokku and in need to run some basic setup tasks such as copying config/database.yml.example to config/database.yml in Rails? It’s possible with Dokku 0.5.0 and app.json file.

See documentation.

Example of the above:

$ cat app.json
  "scripts": {
    "dokku": {
      "predeploy": "cp /app/config/database.yml.example /app/config/database.yml"

Podcast: Episode 7

This week is RailsConf, which means there were tons of releases and updates this week, including Sidekiq, HAML, Heliz, OJ, and Pronto. We found some cool chatbot and Alexa tutorials, looked at a handy blog post about Ruby's enumerables, and learned how to search by radius in Redis. There were also some great Rails book deals.
Riding Rails 

Rails 5.1: Loving JavaScript, System Tests, Encrypted Secrets, and more

In celebration of the 12th RailsConf in Phoenix, Arizona this week, we’re proud to announce that Rails 5.1 is ready in its final form! We’ve spent over 4,100 commits since Rails 5.0 making everything EASIER, SIMPLER, and, uhhh, FUNNER? (That’s a RailsConf joke).

The highlight reel hasn’t really changed since the first beta, but here’s a repeat:

Loving JavaScript

We’ve had a stormy, perhaps even contentious, relationship with JavaScript over the years. But that time is past. JavaScript has improved immensely over the past few years, particularly with the advent of ES6, and with package and compilation tools like Yarn and webpack. Rails is embracing both of these solutions with open arms…

Ruby Weekly 

#346: Rails 5.1 Released: The One Where DHH Embraces JavaScript

This week's Ruby and Rails news
Read this e-mail on the Web Ruby Weekly Issue 346 — April 27, 2017

Sorry for the delay, but we were waiting for the final release of Rails 5.1 :-)

David Heinemeier Hansson
The final release of Rails 5.1 came at RailsConf last night. JavaScript has been embraced, there’s a new system tests feature, encrypted secrets, and more. To learn more, consider this screencast or maybe the full release notes.

Peter Ohler
The alternative C-based JSON encoding and decoding library is now fully compatible with Ruby 2.4’s ‘json’ gem and Rails 5.

Mike Perham
The Ruby Rogues 

MRS 001 My Ruby Story Brad Urani

On this first episode of My Ruby Story, Charles Max Wood interviews Brad Urani. About a year and a half ago, Brad talked about Rails, JavaScript, and Functional Programming in episode 237 of the show. Get to know more about him and his journey in programming. Tune in!

EquiValent - Web Developer Blogs 

Expressive tests with RSpec - part 1: Describe your tests properly

Lot of time developers just write the logical evaluation for the test but don't quite express their intention. RSpec is really expressive testing library. This article is first article in my article series on "Expressive testing with RSpec" and will help you to better use describe and context blocks and be able to DRY the tests.
Drivy Engineering 

Editing your git history with rebase for cleaner pull requests

At Drivy, we make extensive use of pull requests to ensure that our code is up to our standards and to catch possible issues.

Reviewing big pull requests can get tedious, that’s why we try to make them as readable as possible. This means splitting them in small commits that all make sense individually, so you can read the pull request commit by commit and understand the general direction of the code change.

It’s also useful if you want to only show a part of your PR to some people. For instance, you might want the front-end developer to only look at the front-related commits.

Split Your PR Commit by Commit

In a perfect world, you’d come up with a plan on how you want your PR to be split…

Ramblings of a techie 

Aren't you using retina images already?

With the advent of higher resolution devices increasing every day and the need for the end users to getting used to seeing high-res images, anything that is default or standard definition looks inferior if not ugly. As a developer, it is a must to consider this design impact and how to accommodate and give a seamless experience to the end user across various types of devices. I am going to quickly touch base on how to understand what High Dpi devices are how to exploit all those pixels available in a device real estate.

DPI stands for Dot Per Inch. I am a 90s kid (don't know if that is proud statement or a something to be trolled about), one of the highest resolution I use to see was 1024…

LambdaDays 2017, FP concepts and their application

In my last post I tried to summarize the main concepts expressed by Prof. John Hughes and Prof. Mary Sheeran in their wonderful keynote at the LambdaDays 2017.

If you didn’t read it, well, here it is. Go on, I’ll be waiting for you here 😁


Jokes apart, at the end of my summary I left a little bit of suspense regarding the topics of my next (this) post but I also gave a few hints about them.

So, without further ado, here there are the two “mysterious concepts”:

  • Lazyness
  • Consumer-producer

The reason why these two ideas strongly resonated within me when I heard Prof. Hughes and Prof. Sheeran talk about them, is due to my brief experience with an Elixir library called Flow.


Mike Perham 

Hello Sidekiq 5.0

After a few months of work, I'm happy to announce that Sidekiq 5.0 is now available. Sidekiq 5.0 refactors the core job processor to work better with Rails 5 and includes a few breaking changes that have been pending for a while.

What's New?

Rails 5 native!

Sidekiq::Processor has been redesigned to work well with Rails 5.0's Executor. The Executor is a new API which needs to wrap any use of Rails code; it automatically handles code reloading, database connection management and any other callbacks. Before now, Sidekiq had middleware to clean up database connections but this is no longer necessary with the Executor.

Note that Sidekiq 5.0 will still work with Rails 4.0+.


The Ruby Rogues 

RR 308 Confident Software with Mikel Lindsaar

On today's episode, Charles and Dave discuss Confident Software with Mikel Lindsaar. Mikel wrote the Mail Gem, which is what he is known for in the Ruby community and rewrote TMail back in 2010. In the same year, he founded Reinteractive, a development company which is focused Ruby on Rails around the world. Tune in to learn more about what he's up to and find out what the episode has in store for you!


Bundler’s new update options

Bundler added new CLI options in the last two releases that allow you to influence how bundle update decides which versions to update to.

The new options give you a lot more control than before when updating gems but are also a bit complicated to understand. Let’s have a look:

The Goal: Be more conservative

The main reason behind all the new options is to allow a more “conservative” approach of updating gems. “Conservative” is quite a broad term, but for Bundler it means two things:

  • Let’s not jump too many versions at once
  • Let’s not update more gems than I asked for

This can be useful in certain scenarios, for example when updating a gem because of a security vulnerability. Or…

Schneems - Programming + Open source 

A Variable By any Other Name

Sometimes when you do everything right, things still go wrong. I previously talked about how bad I am at spelling and grammar in “The Four Year Typo”, which reminded me of my first major production failure at Heroku.

Cognito Blog 

Why Startups Get Millennials and You Don’t

You have a new killer website or app where your users can get right down to business after completing a standard sign up form. Sounds great, right? Then why are mobile abandonment rates so high? The number users who view your site on their mobile phones is enormous and growing. If you're tired of leaving money on the table when frustrated users ditch your lengthy mobile signup flow, it's time to take action. Cognito can help.

It's no secret that the attention span of millennials can be a short, and that's ok. Who wouldn't get bored with a ten field sign up form that needs to be verified by 12 different forms of government ID and all three of your neighbors? That might be a slight…

Cognito Blog 

Why Startups Get Millennials and You Don’t

You have a new killer website or app where your users can get right down to business after completing a standard sign up form. Sounds great, right? Then why are mobile abandonment rates so high? The number users who view your site on their mobile phones is enormous and growing. If you're tired of leaving money on the table when frustrated users ditch your lengthy mobile signup flow, it's time to take action. Cognito can help.

It's no secret that the attention span of millennials can be a short, and that's ok. Who wouldn't get bored with a ten field sign up form that needs to be verified by 12 different forms of government ID and all three of your neighbors? That might be a slight…

Black Bytes 

Stop Using Case Statements in Ruby

Are you using the full power of OOP (Object-Oriented Programming) or are you missing out? If you are taking decisions based on the type of an object then you are missing out on one important OOP feature: polymorphism. Type decisions are usually done inside case statements (which are not OO friendly) & in this article […]

The post Stop Using Case Statements in Ruby appeared first on Black Bytes. Don't miss your free gift here :)

Mike Perham 

Sidekiq at Railsconf 2017

Every year I attend Rubyconf and Railsconf and this year is no different. I launched Sidekiq 4.0 at Rubyconf 2015 and now I'm excited to get down to Phoenix and launch Sidekiq 5.0! I want to meet any Rubyists, new or old, who want to chat.


A Personal Note

I attended my first conference in 2007, Rubyconf, in Charlotte NC. I still remember my mental state: awkwardness, isolation and loneliness because I knew about two people there. By nature I'm an introvert and not really good at mingling in crowds (one reason booze is so popular at conferences: it can decrease your inhibitions and make you more chatty). As my reputation increased in the community, going to conferences became easier…

BigBinary Blog 

Rails 5.1 has introduced Date#all_day helper

Sometimes, we want to query records over the whole day for a given date.

>> User.where(created_at:

=> SELECT "users".* FROM "users" WHERE ("users"."created_at" BETWEEN $1 AND $2) [["created_at", 2017-04-09 00:00:00 UTC], ["created_at", 2017-04-09 23:59:59 UTC]]

Rails 5.1 has introduced a helper method for creating this range object for a given date in the form of Date#all_day.

>> User.where(created_at:

=> SELECT "users".* FROM "users" WHERE ("users"."created_at" BETWEEN $1 AND $2) [["created_at", 2017-04-09 00:00:00 UTC], ["created_at", 2017-04-09 23:59:59 UTC]]

We can confirm that the Date#all_day method returns…

Ruby – SitePoint 

Search and Autocomplete in Rails Apps

Adding search to Rails apps

Searching is one of the most common features found on virtually any website. There are numerous solutions out there for easily incorporating search into your application, but in this article I'll discuss Postgres' native search in Rails applications powered by the pg_search gem. On top of that, I’ll show you how to add an autocomplete feature with the help of the select2 plugin.

I'll explore three examples of employing search and autocomplete features in Rails applications. Specifically, this article covers:

  • building a basic search feature
  • discussing additional options supported by pg_search
  • building autocomplete functionality to display matched user names
  • using a third-party service to…

The source code can be found at GitHub.


Drifting Ruby Screencasts 

Cropping Images with JCrop

Extend your image upload functionality with JCrop. Learn to redirect the user to a crop page once they have uploaded their image and save versions of the cropped images.
Appfolio Engineering 

Comparing Rails Performance by Ruby Version

The Ruby benchmark I've been working on has matured recently. It builds an AMI that runs the benchmark automatically and makes it downloadable from the AWS instance. It has a much better-considered number of threads and processes for Puma, its application server.

So let's see how it works as a benchmark. Let's see if there's been any particular change in Rails speed between Ruby versions. (Just want to see the pretty graphs? Scroll down.)

Because of Discourse, I'll only check Ruby versions between about 2.0.X and 2.3.X -- Discourse doesn't support 2.4 as of early April 2017. I'm not using current Discourse because the current version wants gems that don't support Ruby 2.0.X. That's a problem…

ruby – Bibliographic Wilderness 

On the graphic design of

I like to pay attention to design, and enjoy good design in the world, graphic and otherwise. A well-designed printed page, web page, or physical tool is a joy to interact with.

I’m not really a trained designer in any way, but in my web development career I’ve often effectively been the UI/UX/graphic designer of apps I work on, and I do my best, and always try to do the best I can (our users deserve good design), and to develop my skills by paying attention to graphic design in the world, reading up (I’d recommend Donald Norman’s The Design of Everyday Things, Robert Bringhurt’s The Elements of Typographic Style, and one free online one, Butterick’s Practical Typography), and trying to…

Virtuous Code 

The daunting economics of cheap services

Reader Rob asks:

One thing stuck out to me reading this, and I was wondering if you’d be willing to elaborate on it further:
“The trouble is, the economics of selling a service for less than $10/month are damn near prohibitive.”
Would you mind explaining how you came to this conclusion? Thanks!

I’ll be honest, I pulled this number out of a hat. I’m pretty sure I’ve seen others put the cap a lot higher than that.

It comes from a combination of factors. For one thing, costs don’t scale linearly, for the same reason that sales taxes hit the poor harder than the rich.

Just as a for instance, many payment processors charge something like $0.35 plus a percentage for every transaction they…

Hi, we're Arkency 

Conditionality is filtering. Don't filter control flow, filter data.

I am not that smart. I didn’t say it. Michael Feathers did. But it got me thinking and I know it inspired my colleagues as well.

A few weeks ago our client decided to change the URL structure of some of the most important pages. There were a few reasons to do it. They don’t matter so much right now. The business just decided to prioritize one kind of benefits over another kind. They turned out to be more important in the long term.

Instead of slugs provided by organizers such as /wrocloverb2016/ we now generate them ourselves based on the name of the event, its id,…


Hold on to your seats for the brain simulator

Some time ago in this blog we discussed Neuroscience and we hinted at the question of brain simulation. But what does it actually mean to simulate the brain?

The little we know about the working of the brain (any animal brain, not just the human) is that it is made up of a specialized type of cells called the neurons. Roughly speaking, each neuron has a long tail called an axon which it uses to transmit signals to other cells, and a head which receives signals from several other neurons’ tails attached to it. However, it is not the case that a neuron’s tail sends out signals to only one other neuron. In reality connections between neurons (also called synapses) form a huge web whereby each…

Riding Rails 

Rails 5.1.0.rc2: Loving JavaScript, System Tests, Encrypted Secrets, and more

We’re happy to announce Rails 5.1.0.rc2 has been released. We are now really close to the final release. We still have a few open issues in the milestone but we are still expecting to be able to do the final release during the Railsconf 2017.

While we are working to close the last issues, you can check the Rails 5.1 releases notes, or the awesome summary of new features present in the 5.1.0.beta1 blog post.

To view the changes for each gem, please read the changelogs on GitHub:

As per our maintenance policy, the release of Rails 5.1 will mean that bug fixes will only apply to 5.1.x, regular security issues to 5.1.x and 5.0.x, and severe…


Newsletter: The Network

Sooner or later all abstractions leak. You may find yourself wondering why your app is slow or why a form isn't posting. In times like these a little knowledge about the underlying network protocols can save you hours of frustration.
Drivy Engineering 

Instrumenting Sidekiq

As Drivy continues to grow, we were interested in having more insights on the performance of our jobs, their success rate and the congestion of our queues. This would help us:

  • Better organize our queues.
  • Focus our performance work on the slow and high throughtput jobs.
  • Eventually split some jobs in 2 or more jobs.
  • Add more background workers or scale our infrastructure so we stay ahead when our application is growing quickly.

It also helps detect high failure rates and look at overall usage trends.

To setup the instrumentation we used a Sidekiq Middleware.
Sidekiq supports middlewares, quite similar to Rack, which lets you hook into the job lifecycle easily. Server-side…

Mike Perham 

Monitoring Redis

Redis is widely by the Ruby community but, like any complex piece of infrastructure, isn't well understood by many of its users. I wanted to write a blog post that would answer the question: How can I check on the health of my Redis server? Here's a few things you can do to better understand your Redis server.

Ask for Info

The info command is the easiest way to get an overall view of Redis:

$ redis-cli info
# Server

Ruby Weekly 

#345: The Zen Rails Security Checklist for Rails Apps

This week's Ruby and Rails news
Read this e-mail on the Web Ruby Weekly Issue 345 — April 20, 2017
John Nunemaker
Using response objects to properly handle exceptions and program flow with an example of how it’s done at Github.

Bruno Facca
A quick reference primarily to minimize vulnerabilities in Rails 4 and 5 apps caused by developer forgetfulness.

Clément Joubert
We’re putting a big ‘tread carefully’ sticker on this one, but if you’re running heavy apps and running into memory issues, this may be worth exploring.

Stories by DHH on Medium 

How to punish corporate misconduct without exhausting yourself

Seems like there’s good reason to be outraged at outrageous corporate behavior every other week these days. From United’s brutal extraction of a passenger to Uber’s continued morass of unethical, illegal behavior. To be honest, it’s exhausting!

In large parts, this exhaustion stems from what the barrage of misdeeds is forcing us to consider all the time: Well, what are you going to do about it?

If you just do nothing, continue to buy the services and products of those who do wrong, you’re at least partially complicit, right? And if you take every opportunity to ban a company from your wallet because of every transgression, life quickly becomes complicated.

But maybe it doesn’t have to be so…


Podcast: Episode 6

We go over what's happening in the Ruby community this week, including upcoming events, RubyTogether updates, RubyMotion's change of leadership, the time I had to crack my own Reddit password, Seeing is Believing, Rails in Windows 10, maintainable controllers, and Binding IRB.
Greater Than Code 

Episode 029: p=eMPathy with Ariel Waldman, Ashe Dryden, and Brad Grzesiak


Coraline Ada Ehmke | Rein Henrichs | Astrid Countee

Guest Starring:

Ariel Waldman: @arielwaldman | What’s It Like in Space?: Stories from Astronauts Who’ve Been There | | Science Hack Day |

Ashe Dryden: @ashedryden | AlterConf | Fund Club |

Brad Grzesiak: @listrophy | Bendyworks

Show Notes:

00:16 – Welcome to “The Tale of Space Cat Burritos” …we mean, “Greater Than Code!”

02:26 – Space Technology and the Cultural Portrayal of Science

NASA Explorers Program

08:24 – The Influence of Science Fiction on the Current Developments in Science

NASA Innovative Advanced Concepts Program (NIAC)

The Comet Hitchhiker

Supernatural Horror in…

Virtuous Code 

Software Entrepreneurs: Stop looking for itches to scratch

On probably half a dozen different occasions some aspiring entrepreneur has asked me:

Would you be interested in a hosted solution for selling screencasts?

In most cases, the promised solution never goes beyond talk. In a few cases I’ve been sent invitations to beta test. In all cases, a successful business has failed to materialize, and 6 to 12 months later the domain is up for grabs.

These results are completely predictable, for a few reasons.

First off, as I’ve written about before and will probably write more about in the future, this space is ridiculously well-served. When it comes to selling media or communities subscriptions online, there is a full continuum of solutions available.…

Schneems - Programming + Open source 

The Four Year Typo

I’m a horrible speller. I often joke that I got into programming because it doesn’t matter how you spell your variables, as long as you spell them consistently. Even so, I spend a good portion of my days writing: writing docs, writing emails, writing commit messages, writing issue comments, and of course writing blogs. Before I publish an article, I run my work by an editor, which makes this typo even more exceptional.

The Ruby Rogues 

RR 306 TinyTDS, Databases, and SQL Server with Ken Collins

On today's episode, Charles, David, Jason, and Brian discuss TinyTDS, Databases, and SQL Server with Ken Collins. Ken has been in the industry for more than eight years. He is particularly known for the SQL Server Adapter for Active Records and TinyTDS. He currently works for CustomInk, and runs the Ruby user group in Hampton. Tune in!

BigBinary Blog 

Binding irb - Runtime Invocation for IRB

This blog is part of our Ruby 2.4 series.

It’s very common to see a ruby programmer write a few puts or p statements, either for debugging or for knowing the value of variables.

pry did make our lives easier with the usage of binding.pry. However, it was still a bit of an inconvenience to have it installed at runtime, while working with the irb.

Ruby 2.4 has now introduced binding.irb. By simply adding binding.irb to our code we can open an IRB session.

class ConvolutedProcess
  def do_something
    @variable = 10

    # opens a REPL here

irb(#<ConvolutedProcess:0x007fc55c827f48>):001:0> @variable
=> 10
Drivy Engineering 

API Driven Apps

At Drivy, the product is often changing. To be as reactive as possible, we want to be fast and iterate a lot of features. For mobile teams, it’s a challenge to keep up the pace for our iOS and Android apps. You have to deal with the release cycle of the App Store for iOS, and with the users who don’t update their app to the last version on both platforms.

We use a lot of different technical solutions to make our apps flexible, here we will describe one of them: how to make your content dynamic and let your users use your latest features even if it’s not yet implemented in your native app.

Dynamic Content

Recently we had to implement a new view helping our car owners to see all their…

Ruby Together News 

March 2017 Monthly Update

Hello! Welcome to the monthly update. During March, our work was supported by Stripe, CodeMiner42, Basecamp, Icelab, Bleacher Report, and many others.

ruby together news

On the whole, this month was pretty quiet. We filed our taxes, worked on some plans for the future, and continued to pay for developer hours to maintain Ruby’s tooling infrastructure.

In March, Ruby Together was supported by 88 different companies, including Stripe and CodeMiner42. Four companies joined as new members, including Brandeis University, Scout RFP, and Modern Message.

On top of those companies, three developers signed up as friends of Ruby Together, including Byron Appelt. In total, we were supported by 183…

Kir Shatrov blog 

Signal handling in Ruby and its internals

Mixing posix threads and signal handling usually is a bit of a nightmare.

Ceri Storey, 2013

I have been debugging signal handlers in Ruby and at some point I started to ask questions that no one could answer. The only way to find answers for them was to read the MRI internals. Just in case, I’ve decided to document my observations in a blog post.

I’m assuming that you already have a context about signal handling in Linux and the Ruby API for it.

In what context is the signal handler executed?

Ruby executes the signal handler in the same thread as the parent. It can be proven by

puts "parent: #{Thread.current.object_id}"
trap("TERM") { puts Thread.current.object_id }


Test Double | Our Thinking 

Makefile Usability Tips

It has been but a few short years since web developers chose a side and took up arms in the holy war of build automation tools; this is only one of many wars that have been fought countless times since the dawn of computing. In the grim darkness of the far future, there is only war.


Meh. War is tiresome and I have had enough of war. This post is about some small usability improvements you can add to your Makefiles if you are using Make. Let's dig in!

The Makefile

Make has been around for a long time. It has some neat features but it's not always the friendliest to neophytes. Imagine you have a new developer joining your team, and your project has a Makefile that looks something like…

GoRails Screencasts 

How to use Vue.js and Turbolinks together

Using Vue.js and Turbolinks together can be a little complex to wrap your head around at first. We not only dive into how this works but we take a look at the vue-turbolinks node module I made so that you can easily use the two together.
reinteractive Feed 

Why Ruby on Rails is still the best choice?

A few days ago a prospective client asked "Why do you use Ruby on Rails?" and I told them a simple answer. Profitability and Productivity. There is nothing else out there that can develop the majority of business web based software as cost effectively as Ruby on Rails. This might be an unpopular position in an IT world that releases a new and shiny tool every other day, but I don't care. What I care about is the return for our customers, we could call this profitability. And the wellbein...
Drifting Ruby Screencasts 

Javascript Select Form Fields with Chosen

Chosen is a jQuery plugin that makes long, unwieldy select boxes much more user-friendly. Learn how to use Chosen in a few different ways in this episode; Rails form builder and Simple Form.
Greater Than Code 

Episode 028: Brains, Feedback Systems, Demons, and Goats with Janelle Klein


Jessica Kerr | Sam Livingston-Gray | Rein Henrichs

Guest Starring:

Janelle Klein: @janellekz | Idea Flow: How to Measure the Pain in Software Development | Open Mastery

Show Notes:

00:16 – Welcome to “Goats On Podcasts” …we mean, “Greater Than Code!”

01:19 – Origin Story

04:36 – The Development of Development

06:58 – Automated Tests and Mistake Detection

09:21 – Designing Releases and Best Practices

20:13 –  “The Code is Better”

15:08 – Measuring Effort, #CollaborativePain, and The Error Handling Process


Podcast: Episode 5

We go over what’s happened in the Ruby community this week, including what features to expect  from Postgres 10, DockRails, Ruby and Google App Engine, what changed in Ruby 2.4, diagnosing memory cliffs, and beer internships.

Newsletter: The Front End

It's been over 10 years since Rails popularized the MVC pattern. A lot has happened since then. Front-ends have grown and grown and grown. Clients who used to be happy with a few effects from now want single-page applications (SPAs). In this brave new world, what are we to make of the pitiful little "V" in "MVC"?
Ruby Weekly 

#344: The State of Ruby on Google Cloud Platform

This week's Ruby and Rails news
Read this e-mail on the Web Ruby Weekly Issue 344 — April 13, 2017
Used in production at GitHub, these libraries include a key/value data store mechanism for MySQL, an SQL builder, and a class to wrap results.

Google Cloud Platform Blog
Google tested the top 1000 gems to ensure the most popular dependencies would work. App Engine also obeys .ruby-version and supports all currently supported MRIs.

Haseeb Qureshi
The tale of how a developer at Airbnb used Ruby to manipulate a…
Notes to self 

Following Rails redirects with Capybara

This a very short note on setting up Capybara to correctly follow redirects with Rails classic redirect_to @object pattern.

The problem why Capybara might not properly follow redirects in this case is that when redirect_to is called with ActiveRecord object argument an
absolute URL is created and passed instead of relative one. So depending on the way of how Capybara server is started this might not work. To avoid this issue, one has to properly setup app_host and Capybara server settings (server_host and server_port):

# Your original Capybara setup
Capybara.javascript_driver = :poltergeist

# New server settings
Capybara.app_host = 'http://localhost:3002'
Capybara.server_host =…
The Miners - Medium 

NodeJS and Good Practices

Separation of concerns doesn’t need to be boring

Softwares are subject to change all the time, and one aspect that contributes to defining the quality of a code is precisely how easy it is to be altered. But what makes it be like so?

…if you’re afraid to change something it is clearly poorly designed.
— Martin Fowler
Don't make your code a swiss army knife

Separation of concerns and responsibilities

“Gather together the things that change for the same reasons. Separate those things that change for different reasons.”

Be those things functions, classes, or modules, they can apply to the single responsibility principle and the separation of concerns. Designing software based on these principles…


In software development, a resp…

Schneems - Programming + Open source 

Jumping Off The Ruby Memory Cliff

The memory use of a healthy app is like the heartbeat of a patient - regular and predictable. You should see a slow steady climb that eventually plateaus, hopefully before you hit the RAM limit on your server:

BigBinary Blog 

Using Kubernetes Persistent volume to store persistent data

In one of our projects we are running Rails application on Kubernetes cluster. It is proven tool for managing and deploying docker containers in production.

In kubernetes containers are managed using deployments and they are termed as pods. deployment holds the specification of pods. It is responsible to run the pod with specified resources. When pod is restarted or deployment is deleted then data is lost on pod. We need to retain data out of pods lifecycle when the pod or deployment is destroyed.

We use docker-compose during development mode. In docker-compose linking between host directory and container directory works out of the box. We wanted similar mechanism with kuberentes to…

Notes to self 

Trusted SSL certificates with Let’s Encrypt and NGINX is the new awesomeness that happened to SSL on the web. Forget over-priced trusted certificates or self-signed certs for your side & pro bono projects. Try trusted SSL in seconds for free instead :). If you choose to use Let’s Encrypt I want to show you what needs to be done on a pretty average Fedora VPS with NGINX server and how to avoid certbot errors like urn:acme:error:unauthorized and urn:acme:error:unknownHost.

Since I don’t plan to duplicate what’s already said on and so go read that first. In short Let’s Encrypt will generate certificate for your (sub)domains for free on the fly on your server using the program called certbot. But…

The Miners - Medium 

Parallel tests with AVA

Parallel Tests with AVA

There are a lot of test frameworks for JavaScript/Node.js and I’ve been working with Mocha, Jasmine and Lab for a while. But I decided to give a try to AVA in a new project to be able to write faster specs in ES2017.

Different from other test frameworks, AVA runs tests in parallel by default. Not only by using Node asynchronous capabilities but by running every test in a separate process. This gives each test an isolated environment.

Main differences from other frameworks (I’ve used)

The table below shows the most significant features.

  • AVA doesn’t support BDD style by default, but Ava-Spec does (I’m using it)
  • Hapi/Lab can run tests in parallel, but I’ve never used it…
The Ruby Rogues 

RR 305 Rails 5.1.0

On today's episode, Charles and David discuss about Rails 5.1.0. The new release is moving the community towards front-end JavaScript. Starting a Vanilla application has even become more convenient with Yarn and Webpack support. Tune in to this exciting talk to learn more!

BigBinary Blog 

Ruby 2.4 has added additional parameters for Logger#new

This blog is part of our Ruby 2.4 series.

The Logger class in Ruby provides a simple but sophisticated logging utility.

After creating the logger object we need to set its level.

Ruby 2.3

require 'logger'
logger =
logger.level = Logger::INFO

If we are working with ActiveRecord::Base.logger, then same code would look something like this.

require 'logger'
ActiveRecord::Base.logger =
ActiveRecord::Base.logger.level = Logger::INFO

As we can see in the both the cases we need to set the level separately after instantiating the object.

Ruby 2.4

In Ruby 2.4, level can now be specified in the constructor.

#ruby 2.4
require 'logger'
logger =
Black Bytes 

Ruby Under The Hood: Memory Layout of an Object

If you enjoy seeing how things work under the hood I think you are going to love this post… …because we are going to explore together how a Ruby object is laid out in memory & how you can manipulate that to do some cool stuff. So fasten your seatbelts because this is going to […]

The post Ruby Under The Hood: Memory Layout of an Object appeared first on Black Bytes. Don't miss your free gift here :)

Mike Perham 

Migrating from redis-namespace

In a blog post in 2015, Storing Data with Redis, I wrote about your options for partitioning data stored within Redis and came down pretty hard on using key namespacing via redis-namespace. The redis-namespace gem allows you to share a Redis database among several applications by prefixing every key with a namespace but it's a terrible hack that no one should use. Redis already has a native solution if you want to share a Redis instance: databases. The default database is 0. Here's how to point Sidekiq to use database 1 instead:

Sidekiq.configure_client do |config|
  # these are equivalent
  config.redis = { url: "redis://localhost:6379/1" }
  config.redis = { db: 1 }

By default,…

ruby – Bibliographic Wilderness 

One way to remove local merged tracking branches

My git workflow involves creating a lot of git feature branches, as remote tracking branches on origin. They eventually get merged and deleted (via github PR), but i still have dozens of them lying around.

Via googling, getting StackOverflow answers, and sort of mushing some stuff I don’t totally understand together, here’s one way to deal with it, create an alias git-prune-tracking.  In your ~/.bash_profile:

alias git-prune-tracking='git branch --merged | grep -v "*" | grep -v "master" | xargs git branch -d; git remote prune origin'

And periodically run git-prune-tracking from a git project dir.

I do not completely understand what this is doing I must admit, and there might be a better…

GoRails Screencasts 

Using Webpack in Rails with the Webpacker Gem

Let's take a look at using the Webpacker gem in Rails to implement an additional pipeline for building modern frontend Javascript alongside our Rails application.
Drifting Ruby Screencasts 

Drag and Drop with Interact.js

Using Interact.js to create draggable and droppable items in our view, we can use AJAX callbacks on events to interact with our Ruby on Rails application. Also, learn how to use Ruby Assets to manage our Javascript Libraries.
Giant Robots Smashing Into Other Giant Robots 

Following the Path

require "user"

Where is the user.rb file located? Perhaps in the current directory? That’s a trick question. There isn’t enough information to determine that from that single line.

The answer is more complex, flexible, and involves some UNIX history.


$LOAD_PATH is a global variable in Ruby that points to an array of path strings. The following is the (truncated) result of viewing $LOAD_PATH in pry:

[1] pry(main)> $LOAD_PATH
Hi, we're Arkency 

All Rails service objects as one Ruby class

I review many Rails applications every month, every year. One visible change is that service objects became mainstream in the Rails community. This makes me happy, as I believe they do introduce some more order in typical Rails apps. Service objects were the main topic of my “Fearless Refactoring: Rails controllers” book, along with adapters, repositories and form objects.

Today I’d like to present one technique for grouping service objects.

I was reminded of this technique, when I’ve recently came back to the development of the simple Fuckups application. This application started as a simple CRUD, typical Rails Way. Over time, though, I’ve added the service layer. In this application…

Hi, we're Arkency 

Reliable notifications between two apps or microservices

Let’s say you have 2 systems or microservices (or processes). And one of them needs to be notified when something happened in another one. You might believe it is not so hard unless you start thinking about networking, reliability, and consistency.

I would like to briefly present some patterns for how it can be done and what do they usually bring to the table.

Direct communication (v1)

  1. System A does something in a SQL transaction, which is committed.
  2. System A contacts system B directly via API after the transaction is committed.

It all works nicely until system B is down and non-responsive. In such case, it won’t be notified about what happened in B so we have a discrepancy. Assuming…

Greater Than Code 

Episode 027: Hackathons and Flirting with Failure with Rachel Katz


Sam Livingston-Gray | Astrid Countee | Rein Henrichs

Guest Starring:

Rachel Katz: @hazeltrack | AngelHack

Show Notes:

00:16 – Welcome to “Plotting the Rebellion” …we mean, “Greater Than Code!”

01:39 – Origin Story and Superpowers

03:05 – Getting Hooked on Hackathons

04:42 – Corporate Hackathons; Making Hackathons Accessible and Inclusive

Greater Than Code Episode 015: Zuri Hunter as Queen of Hackathons


09:38 – Organizing Hackathons

12:21 – Non-programmers and Hackathons; Bringing in Diverse Perspectives

“Some people, when confronted with a problem, think ‘I know, I’ll use regular expressions.’ Now they have two problems.” ~Jamie Zawinski

Code: Debugging the Gender Gap


Newsletter: Patterns

Rubyists have always had a strange relationship with design patterns. They smell a little too much Java, like people in starched shirts and ties writing serious software for humorless people. Yet Ruybyists use and rely on patterns just like all developers. We've even been known to have the occasional religious war over them. The history of Ruby over the past 10 years is intimately tied to design patterns. In this issue of the RubyLetter we're going to look at where patterns come from, how they evolve over time, and how knowing them will make you a better developer.
Test Double | Our Thinking 

Accessibility Is Usability

Our goal when creating an accessible experience is to ensure that users with vision, auditory, motor, or cognitive disabilities are able to navigate all web content. Accessibility guidelines exist to eliminate barriers that would otherwise hinder equal access to a significant percentage of the population. The great thing about following accessibility guidelines is that techniques have an impact on all users. Getting started with accessibility is easy, and any action you take benefits users now!

Accessibility Benefits Everyone

While accessibility techniques are extremely advantageous to people with disabilities, the improvements you make have a much wider impact. Here are some examples of…

Ruby Weekly 

#343: Hanami 1.0 released, and a tribute to Jason Seifer

This week's Ruby and Rails news
Read this e-mail on the Web Ruby Weekly Issue 343 — April 6, 2017

It's with great sadness I dedicate this issue to Jason Seifer, a popular member of the Ruby community who died last weekend. You may have known him as a Ruby trainer, as DJ Ango, from his famed 2007 'Rails vs' videos, or from the many podcasts he did. He'll be missed.
- Peter Cooper

Luca Guidi
A major milestone for an increasingly popular framework. Opinionated like Rails, it takes a more minimal approach in enforcing modularity, avoiding monkey-patching, and the use of POROs.

Jack Singleton

Announcing Hanami v1.0.0

One-Point-OOOh! 😱

Hanami is a full-stack, lightweight, yet powerful web framework for Ruby.

Back in the summer of 2012, as a frustrated web developer, I started an experiment to rethink Ruby on Rails and to build a modern web framework for Ruby. The goal was to keep all what I consider the good parts of Rails and to add extra components to ease long term maintenance and testability.

The experiment was promising, and I eventually started to open source Hanami at the beginning of 2014.

Since then, it's been amazing journey. I have learned a lot about Ruby, Open Source, and people. The community aspect of this experience is key to me. Software is made by…


Podcast: Episode 4

We go over what’s happened in the Ruby community this week, including Hanami 1.0.0, Fae, TruffleRuby and Sulong, Idiosyncratic Ruby, how your classes get huge, Capybara tips, and hackathon hustlers. We acknowledge the passing of Rubyist and teacher Jason Seifer.
Appfolio Engineering 

Rails Benchmarking: Puma and MultiProcess

This week, I've been playing with Puma processes. Headius, Nate Berkopec, you can probably stop reading now. You won't learn much ;-)

One consequence of the GIL is that a single Ruby process has limited ability to fully use the capabilities of a multi-core machine, including a larger AWS instance.

As a result, the optimum number of Rails processes for your AWS instance is probably not just one.

I'm still using my Discourse-based Rails benchmark, and we'll look at how the number of processes affects the total throughput. There are some slightly odd things about this benchmark that haven't changed since previous articles. For instance, the fact that Postgres and the load-testing process runs on…

Semaphore CI Community Tutorials on Ruby 

5 Tips for More Effective Capybara Tests

This article is brought with ❤ to you by Semaphore.


In this article, we'll cover five tips for writing effective Capybara tests, and how to use them with RSpec and Minitest.

What is Capybara?

Capybara is an acceptance test framework for web applications. It's a common choice for end-to-end, acceptance, or integration testing in Rails applications.

It allows developers to simulate a user on a web page and make assertions based on the content and environment of the page. It also provides an API to interact with the web page.

By default, it will run in headless mode using Rack::Test, but it can also use a number of other drivers, such as PhantomJS, to test pages with…

Integration and Acceptance…

Red Panthers 

Difference between Date, Time and DateTime

Date and time are one of the most important aspects which every coder has to deal with in Ruby. Well, let’s get to know how we keep it up alive and functional.
There are 3 different classes in Ruby that handles date and time. They are Date, Time and DateTime. Date and DateTime classes are both from date library. And Time class from its own time library.

In this article we’ll see how Date and Time works. Let’s have a look at each one of them.


When you need a string format of year, month and day, you have to go through Date class.

  • Has date attributes only (year, month, day)
  • Based on integer whole-day intervals from an arbitrary “day zero”
  • Can handle date arithmetic in units of whole days


$ require…

Importing invalid legacy data with Rails

Recently I needed to import some legacy data from a list of CSV files (each file representing one database table on the legacy application)  into a fresh new application, but the legacy data was not compliant with the new application rules.

Let’s consider the following example, simplified and modified for the scope of this article:

class Tutor < ApplicationRecord
  has_many :phones

  validates :email, presence: true

  before_save :update_default_rate


  def update_default_rate
    if default_rate.present? and default_rate_changed?
      self.advanced_rate = default_rate * 1.30

And the following TutorImporter class, which imports the legacy data, one line at…

Honeybadger Developer Blog 

The Rubyist's Guide to Memoization

This article covers one of my favorite techniques for improving performance: memoization. It's a source of easy little performance wins that eventually add up and only occasionally reduce your application to a heap of smoldering rubble. Only very occasionally.
Greater Than Code 

Episode 026: Codeland, Capitalism, and Creating Inclusive Spaces with Saron Yitbarek


Sam Livingston-Gray | Astrid Countee | Rein Henrichs

Guest Starring:

Saron Yitbarek: @saronyitbarek | | CodeNewbie | Codeland Conference

Show Notes:

00:16 – Welcome to “Unrepentant Cyborgs” …we mean, “Greater Than Code!”

01:28Codeland Conference: April 21st & 22nd in New York City

02:02 – Making Conferences Accessible, Affordable, and Unintimidating for People

13:00 – Ticket Prices and Structure

15:01 – Creating an Immersive Experience and Community With and For People You Care About

25:11 – Leading by Example and Maintaining a Positive Persona

29:49 – The Importance of Money and Financial Freedom

Tech Done Right Episode 002: Career Development with Brandon…

Virtuous Code 

The Pretentious Haskell Phase

Someone drew my attention a “leaving Ruby for Haskell” rant from a few years ago. I thought I’d reprint my reply here.

For the record, I love Ruby and Haskell, and I am well aware that there are successful commercial projects written in Haskell. Part of me still wants to work on one.

I guess I’m jaded because I went through my own Pretentious Haskell Phase many years ago. Before I started working mostly in Ruby, as a matter fact. Back when the only free guide available was the ironically-named “Gentle Introduction“.

Every enthusiast programmer goes through it at some point. It’s similar to the Smug Lisp Weenie phase, but with more righteous anger about how people should be Prevented from…

Schneems - Programming + Open source 

Double Ruby Rainbow Bug

What happens when “don’t do that” turns into “it worked before”? This is exactly the scenario I was faced with recently. We had a string of tickets in under two days with the same weird error message. This frequency normally indicates that something changed, but the error was in a weird place, didn’t seem to be related to any new code. Here’s the error people were reporting on Heroku:

Stories by DHH on Medium 

A blind date in business class

A love-pod for two very special strangers 💞

One of the nice things about being rich is that you get to fly business. It doesn’t really matter for short trips, but not doing coach on a 14-hour flight to China is just one of those things you can definitely point to as a quality-of-life improvement from having lots of money.

Just in the moment, though. I’ve done a few long-hauls in economy after having it made, and while I thought it pretty rough, you switch to self-congratulation mode just hours after you land. It actually wasn’t so bad! I’m keeping it real. Man I’m proud of myself 😂

Anyway, here I am, sitting in business class on a flight from Europe to the US, enjoying my fucking steak on a…

The Ruby Rogues 

RR 304 The Rails 5 Way with Obie Fernandez

Obie Fernandez is the author of The Rails Way series. He has been in the programming industry for almost 25 years. He helped cultivate software development with Jason Swett at Africa. Tune in to today's fascinating talk about The Rails 5 Way with Obie Fernandez! 

BigBinary Blog 

Ruby 2.4 has default basename for Tempfile#create

This blog is part of our Ruby 2.4 series.

Tempfile class

Tempfile is used for managing temporary files in Ruby. A Tempfile object creates a temporary file with a unique filename. It behaves just like a File object, and therefore we can perform all the usual file operations on it.

Why Tempfile when we can use File

These days it is common to store file on services like S3. Let’s say that we have a users.csv file on S3. Working with this file remotely is problematic. In such cases it is desirable to download the file on local machine for manipulation. After the work is done then file should be deleted. Tempfile is ideal for such cases.

Basename for tempfile

If we want to create a…

Ruby Inside - Medium 

Action Cable ‘Hello World’ with Rails 5.1

Most people have seen examples of Action Cable chat applications. I find them too big for a quick introduction to the idea of Action Cable. For my new “Learn Rails 5.1” book I created a smaller, easier to replicate and to understand example where we send a piece of “Hello World!” HTML from the console to the already loaded webpage.

Do you prefer a screencast? You’ll find one at the bottom of this page.

What we want to achieve

Broadcasting a piece of HTML code to a channel from the Rails console.

Use Action Cable to shoot a “Hello World!” from the console to the web browser.

The Rails Application Setup

We start with a new Rails application:…
Drifting Ruby Screencasts 

Page Specific Javascript in Ruby on Rails

Sometimes you may find yourself with an application that has javascript that needs to execute only on a specific page. This episode lays the foundation to easily manage page specific javascript.
Cognito Blog 

How to Fix Your Verification Conversion Rate

Improving Verification Conversion

When you go to signup for an account, do you get excited to enter your personal information into the looming wall of blank white boxes? No, and neither do you customers. You need to start thinking about the onboarding process from the customer’s perspective.

Businesses are finally realizing that a lengthy signup process results in abandonment and dissatisfaction for the customers who do get through it. This experience is not the first impression your customers deserve. Studies show that conversions increase 120% by reducing the number of form fields from eleven to four.

So what can you do?

Stop collecting unnecessary data! Accelerate your signup flow and reduce the required keystrokes…

Cognito Blog 

Improving Signup Conversions by Reducing Friction

When you go to signup for an account, do you get excited to enter your personal information into the looming wall of blank white boxes? No, and neither do you customers. You need to start thinking about the onboarding process from the customer’s perspective.

Businesses are finally realizing that a lengthy signup process results in abandonment and dissatisfaction for the customers who do get through it. This experience is not the first impression your customers deserve. Studies show that conversions increase 120% by reducing the number of form fields from eleven to four.

So what can you do?

Stop collecting unnecessary data! Accelerate your signup flow and reduce the required keystrokes as…

Riding Rails 

This Week in Rails: -j smoked, 42, designated drivers and more!

Yo folks! Your noble editor Kasper here with the latest and greatest from Rails.

Check the fine print 📰


Remove rails new –javascript

The –javascript option for new Rails apps could install any gem ending in -rails. From now you’ll have to add jquery-rails to your Gemfile manually.

Properly sourced fourty_two

The new documentation now has the answer to life the universe and everything.


Per subclass system testing driver overrides

Your system testing test case subclasses all have a designated driver. Now you can designate another driver in case the test case calls for it.

reverse_merge aliased to with_defaults

One for the aesthetics department: with_defaults has…

Ruby News 

Support of Ruby 2.1 has ended

We announce that all support of the Ruby 2.1 series has ended.

After the release of Ruby 2.1.10 at the end of March of the last year, the support of the Ruby 2.1 series was in the security maintenance phase. Now, after one year has passed, this phase has ended. Therefore, at March 31, 2017, all support of the Ruby 2.1 series has ended. Bug and security fixes from more recent Ruby versions will no longer be backported to 2.1, and no further patch release of 2.1 will be released. We highly recommend that you upgrade to Ruby 2.4 or 2.3 as soon as possible.

About currently supported Ruby versions

Ruby 2.4 series

Currently in normal maintenance phase. We will backport bug fixes and release…

Hi, we're Arkency 

Why classes eventually reach 50 columns and hundreds of methods

There are dozens of small or bigger problems that we can have in our code. Like diseases, they affect our applications and make them harder to maintain, expand and enjoy. They give us a headache and they give bugs to our customers. As a result, we (programmers) read a lot to find out more about the symptoms (code smells) and treatment (refactoring techniques, other languages, other architectures).

One of the most common issues that I see is that classes tend to grow bigger and bigger. In terms of Rails Active Record models, they get new columns/attributes and methods around them. I usually see it in User class, but not only. It really depends on what your system is all about. If you work…


Announcing Hanami v1.0.0.rc1

Minor Changes

v1.0.0.rc1 is a patch release for few bug fixes and small changes:

  • Let Hanami::Mailer.deliver to bubble up ArgumentError exceptions
  • Allow logger setting in config/environment.rb to accept arbitrary arguments to make Hanami::Logger to be compatible with Ruby's Logger. (eg. logger 'daily', level: :info)
  • Ensure code reloading don't misconfigure mailer settings (regression from v1.0.0.beta3)
  • Ensure database disconnection to happen in the same thread of Hanami.boot
  • Ensure mailer block in config/environment.rb to be evaluated multiple times, according to the current Hanami environment
  • Ensure a Hanami project to require only once the code under lib/

Newsletter: Databases

Relational databases are incredibly powerful computing engines. What do we do with them? CRUD. We use them as dumb data stores. We tame their complexity by ignoring it. There's nothing innately wrong with this approach. But I thought it'd be interesting to talk about how we got here and what life might look like if we started to take better advantage of the power of the database.
Ruby Weekly 

This week's Ruby news, issue 342

This week's Ruby and Rails news
Read this e-mail on the Web Ruby Weekly Issue 342 — March 30, 2017
Richard Schneeman
Performance issues often start with N+1 problems but fixes can cause memory bloat. Here’s a way to solve for both.

Phil Nash
The example app adds user information to a Google Spreadsheet of users interested in an app launch. Prefer a video? Here you go.
70 bug fixes wrap up Ruby 2.2’s normal maintenance phase, with only security fixes to come in future. Using 2.2? Consider your 2.4…

Previewing email in Rails with ActionMailer::Preview and Letter Opener

Developing email templates to be sent by our Rails application may sometimes be a long and tedious operation because under development you must continuously send to yourself the email in order to test the changes.

If you don’t want to waste your time, Rails provides a very helpful tool for those who need to build the layout for the emails of our application: ActionMailer::Preview. In fact, with this tool (available from Rails 4.1), you are able to generate the Rails mailer view without the need to actually send the email.

Let’s start by setting up the email template and controller action with ActionMailer. We will generate a Mailer which sends a welcome email to users who sign up on our…

Red Panthers 

Enumerator: When to Use and Why are they so special?

In this post, we’ll take a look at the basics of Enumerator, When to use it and Why they are so special. So let’s begin!

As the name implies Enumerator is used for iterating over a collection of items. It allows both internal and external iteration.

So how do we Create an Enumerator?

There are 3 different ways to create it. They are from,

  • A Block,
  • An Enumerable,
  • A Blockless Enumerable Method Call.

Let’s have a look on each of the method now.

From a Block

We can create an enum by passing a block to its constructor. A yielder object will be passed to this block. The yielder’s #<< method can be used to define the elements. Enumerator#next can then be used to provide iteration.


enum =…
Ruby News 

Ruby 2.3.4 Released

Ruby 2.3.4 has been released.

This release contains about 80 bug fixes after the previous release. See the commit logs for details.

And this release contains a bug fix of Symbol#hash to be non-deterministic. This is a regression on the 2.3 series before 2.3.4. See Bug #13376 for more details.

Known Problem

(This section was added at April 11, 2017.)

An API incompatibility has been found for Ruby 2.3.4. It is the accidental removal of the API function rb_thread_fd_close. We will fix this problem with the next release, but if you are facing the problem now and need to overcome it immediately, use this patch:



Podcast: Episode 3

We go over what's happened in the Ruby community this week, including the Ruby 2.2.7 release, Bundler 1.14, creating a simple landing page using Ruby, Google Spreadsheets, and Sinatra, how to tackle configuration strategies, modeling a paginated API as a lazy stream, speeding up Ruby's Array.include? method, and a primer on regular expressions. We also talk about what to expect in this week's RubyLetter on the origins of databases.
Greater Than Code 

Episode 025: MotherCoders with Tina Lee


Coraline Ada Ehmke | Rein Henrichs | Mandy Moore

Guest Starring:

Tina Lee: @mstinalee | MotherCoders

Show Notes:

00:16 – Welcome to “Not Your Mother’s Podcast!” …we mean, “Greater Than Code!”

00:55 – Origin Story and Getting Involved in Coding

03:17 – Programming Perspectives From People of Different Backgrounds; Teaching Adults vs Children

08:19 – Work/Life Balance

11:32 – Changing Culture Around Gender Roles and Caregiving

“Culture is like water in that it flows from the top down.”

Nev Schulman Wants to Erase Gender Stereotypes for Parents

18:18 – The MotherCoders Organization

What to expect when you’re done expecting (Medium Article)  

24:27 – Teaching Frontend Development…

The Miners - Medium 

How to Test Shared Behavior in Elixir

Implementing functionality similar to RSpec’s shared examples

Create a new mix project if you want to follow along:

$ mix new calculator
$ cd calculator

Suppose you have a Calculator module and a sum_list function:

That’s straightforward enough. You can also write the reduce line more verbosely if you want:

list |> Enum.reduce(0, fn x, y -> x + y end)

And follows a test case to exercise the above functionality (not accounting for edge cases):

As you might expect, it passes successfully:

$ mix test
Finished in 0.02 seconds
1 test, 0 failures

Now here’s the picture: you are…

BigBinary Blog 

New arguments supported for float and integer modifiers in Ruby 2.4

This blog is part of our Ruby 2.4 series.

In Ruby, there are many methods available which help us to modify a float or integer value.

Ruby 2.3.x

In the previous versions of Ruby, we could use methods such as floor, ceil and truncate in following ways.

5.54.floor          #=> 5
5.54.ceil           #=> 6
5.54.truncate       #=> 5

Providing an argument to these methods would result in ArgumentError exception.

Ruby 2.4

Ruby community decided to come up with an option to add precision argument .

The precision argument, which can be negative, helps us to get result to the required precision to either side of the decimal point.

The default value for the precision argument is 0.

Bundler Blog 

Bundler 1.14: So many fixes

What’s new in Bundler 1.14?

We somehow missed writing up an announcement when Bundler 1.14 was initially released, but several people kindly pointed out the problem. Just 48 days late, here’s what’s new in Bundler 1.14! In this feature release, we added several small features, and fixed a giant pile of bugs.

Conservative updates

Building on the previous fine controls for the update command, the illustrious @chrismo worked his way through many gnarly possible usage combinations to implement the update --conservative flag. Using the conservative flag allows bundle update GEM to update the version of GEM, but prevents Bundler from updating the versions of any of the gems that GEM depends…

reinteractive Feed 

Transparency in Software Development

Software has been around for more than fifty years and there have been a lot of learnings generated in how to best manage the process of building software. Before the internet it was quite common for a large software project to be initiated, worked on and completed without more than a handful of people knowing what was going on. This lack of transparency led to many dissatisfied stakeholders and sometimes even the software being taken to the trash upon delivery. How do modern software practic...