---
title: "#373: Memory Conscious Programming in Ruby"
publication: "Ruby Weekly"
issue: 373
published_at: "2017-11-02"
canonical_url: "https://rubyweekly.com/issues/373"
---

#373: Memory Conscious Programming in Ruby

This week's Ruby and Rails news[Read this e-mail on the Web](http://rubyweekly.com/issues/373)

Ruby WeeklyIssue 373 — November 2, 2017

Avdi Grimm[Enough With the Service Objects Already](https://avdi.codes/service-objects/)A critique of the common advice to encapsulate business domain actions in “Service Objects”.


Samuel Giddins[Bundler 1.16 Released (But 2.0 Is Close)](http://bundler.io/blog/2017/10/31/bundler-1-16.html)Bundler now has an improved, faster resolver and `bundle install` is now almost as fast as `bundle check` when no installation is needed. There’s also news about Bundler 2 here.


Practical Artificial Intelligence[Implementing OCR using a Random Forest Classifier in Ruby](https://www.practicalai.io/implementing-ocr-using-random-forest-classifier-ruby/)An example of using PyCall to leverage Python-based machine learning libraries.


SemaphoreSponsored[Slow CI Build? Make It Run in 2 Minutes or Less](https://semaphoreci.com/landers/boosters-rails?utm_source=rubyweekly&utm_medium=email&utm_campaign=boosters-rubyweekly-20171102)Semaphore Boosters automatically parallelize large Ruby test suites with split-second precision. Deliver working code faster — no configuration required.

[![Semaphore\](https://copm.s3.amazonaws.com/99853149.png)](https://semaphoreci.com/landers/boosters-rails?utm_source=rubyweekly&utm_medium=email&utm_campaign=boosters-rubyweekly-20171102)


Thomas Leitner[Memory Conscious Programming in Ruby](https://gettalong.org/blog/2017/memory-conscious-programming-in-ruby.html)Knowing how much memory built-in types, structs, and objects consume in Ruby can help you design your code with memory in mind.


Kevin Sylvestre[Transactions in Rails and Atomic Bugs](https://ksylvest.com/posts/2017-10-27/transactions-in-ruby-on-rails-and-atomic-bugs)Transactions in Rails can be tricky to master as there are situations where they can go awry and fail to provide atomicity, as seen here.


Samuel Giddins[RubyGems 2.7.0 Released](http://blog.rubygems.org/2017/11/01/2.7.0-released.html)Brings the vendored Bundler up to the latest version (above), `signin` and `signout` commands added, and a wide variety of minor enhancements and bug fixes.


Jobs

- [Senior Ruby Engineer (Singapore)](https://tradegecko.workable.com/j/D3BBBE6616?utm_source=rubyweekly&utm_medium=email)We’re building the world’s leading order and inventory management platform, redefining B2B commerce to make boring business software a thing of the past. TradeGecko
- [Ruby on Rails Developer at X-Team (Remote)](https://x-team.com/ruby-on-rails-developer/?utm_source=cooperpress&utm_medium=email-ad&utm_campaign=ruby-weekly-q2-17)We help our developers keep learning and growing every day. Unleash your potential. Work from anywhere. [Join X-Team](https://x-team.com/ruby-on-rails-developer/?utm_source=cooperpress&utm_medium=email-ad&utm_campaign=ruby-weekly-q2-17). X-Team
- [Full Stack Rails Engineer (Remote in US, Canada, Brazil)](https://internal.interviewed.com/jobs/full-stack-engineer-hdaw?source=rubyweekly)Help us make the hiring process better for 100m+ job seekers across the globe. Work on product, scalability or internal tools. Interviewed (acquired by Indeed)

In brief

- [5 Performance Improvements in Ruby 2.5](http://www.rubyguides.com/2017/11/ruby-2-5-performance/?utm_source=rubyweekly&utm_medium=email) news Jesus Castello
- [Database Performance Monitoring Buyer’s Guide](https://www.vividcortex.com/resources/database-performance-monitoring-buyers-guide?utm_campaign=Ruby%20Weekly&utm_source=ppc&utm_medium=Database%20Performance) VividCortexSponsored
- [Cleanly Scaling Sidekiq](http://blog.honeybadger.io/cleanly-scaling-sidekiq/?utm_source=rubyweekly&utm_medium=email) tutorial 
How to safely drain Sidekiq workers when scaling down servers in response to job queue counts. Honeybadger Blog
- [The Case Against Exotic Usage of :before_validate Callbacks](https://karolgalanciak.com/blog/2017/10/29/the-case-against-exotic-usage-of-before-validate-callbacks/?utm_source=rubyweekly&utm_medium=email) tutorial 
A good example of when ActiveRecord magic makes things less clear. Karol Galanciak
- [Make Your JSON API Tests Clean with a Linter](http://blog.arkency.com/make-your-json-api-tests-clean-with-linter/?utm_source=rubyweekly&utm_medium=email) tutorial 
Creating a Rack middleware to validate and test the request and response for a JSON API. Arkency Blog
- [A Useful RSpec Trick for Testing Methods with Arguments](http://zverok.github.io/blog/2017-11-01-rspec-method-call.html?utm_source=rubyweekly&utm_medium=email) tutorial Victor Shepelev
- [WEBrick, Rack, and Sinatra's Responsibilities Visualized](https://twitter.com/kellyarwine/status/925460635282034688?utm_source=rubyweekly&utm_medium=email) tutorial Kelly Arwine on Twitter
- [Testing Stripe with Rails and RSpec](https://hackernoon.com/testing-stripe-with-rails-and-rspec-de79e1206839?utm_source=rubyweekly&utm_medium=email) tutorial Rob Race
- [Use Simplecov in Your Rails Test Suite](https://andycroll.com/ruby/use-simplecov/?utm_source=rubyweekly&utm_medium=email) tutorial 
.. to assess the effectiveness of your testing. Andy Croll
- [Automated Dependency Updates for Ruby](https://depfu.com/l/automated-dependency-updates?utm_source=rubyweekly&utm_campaign=sponsored&utm_content=automated) 
A bot that sends nice pull requests on gem updates. Free for open source & personal GitHub accounts. DepfuSponsored
- [Splitting Strings in Ruby vs. Python](https://chriszetter.com/blog/2017/10/29/splitting-strings/?utm_source=rubyweekly&utm_medium=email) story Chris Zetter
- [A Bug That Only Appears Once A Year](http://blog.arkency.com/a-bug-that-only-appears-once-a-year/?utm_source=rubyweekly&utm_medium=email) story 
It turns out there’s one day with more than 24 hours.. Anton Paisov
- [Uploading Files to DigitalOcean Spaces from a Rails App](https://gorails.com/episodes/digital-ocean-spaces-with-rails?utm_source=rubyweekly&utm_medium=email) video GoRails
- [24/7 Operations Support Built for ROR](https://reinteractive.com/enquiries/new?code=ops_care&sid=136) 
Keep your team busy building your app, not solving ops headaches. Unlimited deploys, immediate roll-back and more. OpsCare by reinteractiveSponsored
- [RequestVia: A Functional HTTP Client That Wraps Net::HTTP](https://github.com/serradura/request_via?utm_source=rubyweekly&utm_medium=email) code Rodrigo Serradura
- [Rack::Session::SmartCookie: Smarter Session Cookies for Rack 2 Apps](https://github.com/mwpastore/rack-session-smart_cookie#readme?utm_source=rubyweekly&utm_medium=email) code Mike Pastore
- [Kaminari: A Powerful, Customizable Paginator for Ruby Webapps](https://github.com/kaminari/kaminari?utm_source=rubyweekly&utm_medium=email) code Kaminari
- [Postwill: Post to Popular Social Media Networks from Ruby](https://github.com/postwill/postwill/?utm_source=rubyweekly&utm_medium=email) code 
Uses other libraries to cover Facebook, Instagram, Pinterest, Tumblr and Twitter. Kirill Shevchenko

Curated by [Peter Cooper](https://twitter.com/peterc) and [Glenn Goodrich](https://twitter.com/ruprict), and published by [Cooperpress](https://cooperpress.com/).
Send feedback by simply replying to this mail.
Want to sponsor an issue? See our [media kit.](https://cooperpress.com/mediakit)
Want to post a job? Email us or [use our self-serve system.](https://booking.cooperpress.com/jobs)

[Stop getting Ruby Weekly](*|UNSUB|*) | [Change email address](*|UPDATE_PROFILE|*) | [Read this issue on the Web](http://rubyweekly.com/issues/373)

© Cooperpress Ltd, Fairfield Enterprise Centre, Louth, LN11 0LS, UK
[Email policy](https://cooperpress.com/spam.html) [Privacy policy](https://cooperpress.com/privacy.html)
