Quantcast
Channel: Ruby Weekly
Viewing all 465 articles
Browse latest View live

Is Rails on Windows finally a pleasant experience?

$
0
0

#461 — August 1, 2019

Read on the Web

Ruby Weekly

Rails on Windows Is Not Just Possible.. It's Fabulous— Ruby and Rails development on Windows has been pretty frustrating for well over a decade. Microsoft’s strides to accommodate the Unix way of life via WSL2 and VS Code have changed that in a big way, says Scott Hanselman. Given how many developers have been experimenting switching from macOS to Windows 10, this is encouraging.

Scott Hanselman

ruby-prof Reaches Version 1.0— After 14 years of development (yes, really!), version 1.0 of the high speed Ruby profiling tool is out with features like faster profiling and new reports.

Maeda, Savage and Kaes

Your Ruby CI/CD Pipeline Needs an Upgrade— The Superhuman engineering team reduced build time from 17 mins to 70 seconds. With Semaphore, you can go faster too. Model any CI/CD workflow for Ruby, Docker and iOS with autoscaling pipelines. Try it free with GitHub.

Semaphore 2.0 sponsor

Artichoke Ruby Playground: A New Ruby Interpreter— Artichoke Ruby is an mruby-inspired Ruby interpreter built in Rust (GitHub repo). They’ve released a cool in-browser playground for playing with it. Let’s keep making Ruby a bigger part of the Web!

Artichoke

Rails 6.0.0 RC2 Released— After you read about all the new stuff in Rails 6 (which we seem to include in almost every issue lately), download RC2 and take it for a spin. The final release is due in a couple of weeks, barring any major bug discoveries.

David Heinemeier Hansson

Digging Deeper into Ruby Templating: The Parser— The second in a three-part series (we linked to the first article in issue 457) on building a templating language and parser in Ruby.

Benedikt Deicke

💻 Jobs

Write Awesome Ruby @ Fullscript— Join our team and help create rich and compelling experiences for our users. This is how we build software. If you share our values, we’d be excited to talk with you.

Fullscript

Ruby on Rails Developer at X-Team (Remote)— Join the most energizing community for developers. Work from anywhere with the world's leading brands.

X-Team

Find a Job Through Vettery— Vettery matches top tech talent with growing companies. Create a profile to get started.

Vettery

📘 Articles & Tutorials

Consider Value Objects— Value objects can make code and concepts clearer, make testing easier, and improve reuse.

Andy Croll

Infinity: How It Works and Why It Matters in Ruby1.0/0 returns Infinity in Ruby, but does it actually have any use?

Jesus Castello

Rails 6 Adds Support for Database Optimizer Hints— No more raw SQL to help nudge the database’s query optimizer in the right direction. See some Postgres and MySQL examples here.

Vishal Telangre

Video: Autoscale Your Heroku Worker Dynos in Minutes

Rails Autoscale sponsor

Moving From Tagging with ActsAsTaggableOn to PostgreSQL Arrays— The Postgres database system natively supports arrays as a data type, so why not use them for tags?

Igor Alexandrov

Rails 5: Getting Started with Active Storage— A basic introduction, complete with code you can download.

Bradyn Glines

3 Defensive Programming Techniques for Rails

Bobby Tables

▶  Using Ruby's Array() and Array.wrap— If you’re using conditionals to check if a value is an array.. consider this approach instead.

GoRails

How Do You Tell Which Areas of a Project's Test Suite Need Attention?

Jason Swett

🛠 Code and Tools

Geocoder: A Complete Ruby Geocoding Solution— Look up street addresses, IP addresses, or lat/long coordinates, perform geographic queries, and more. Connects with over 40 third-party APIs. GitHub repo.

Alex Reisner

Ensure That Your Code Is Error-Free Before Merging— Set standards on coverage, duplication, complexity, and style issues and see real-time feedback in your Git workflow.

Codacy sponsor

React-Rails: A Way to Integrate React.js with Rails Views— If you’re both a Rails and React user, this popular tool will help with the integration between the two. v2.6.0 adds a TypeScript component generator.

React Community

Shoulda Matches: RSpec and Minitest-Compatible One-Liner Tests for Rails Functionality— For testing things like validations, column presence, associations, parameter filtering, callbacks, flash and session usage..

thoughtbot, inc.

RubyMine 2019.2 Released: A Much Faster Debugger and More— The latest update of a popular (but commercial) Ruby IDE.

JetBrains

Affect: Algebraic Effects for Ruby— Affect provides “a way to isolate and handle side-effects in functional programs.” It can be used to implement patterns like dependency injection and a form of aspect-oriented programming.

Digital Fabric


First impressions of Fullstaq Ruby, a new custom build of MRI

$
0
0

#462 — August 8, 2019

Read on the Web

Ruby Weekly

Runbook: A Ruby DSL for Gradual System Automation— PayPal-owned Braintree uses this to automate their deployment preflight checklists, on-call playbooks, system maintenance operations, and more. And now, you can too. A neat idea.

Patrick Blesi

First Impressions of Fullstaq Ruby— Find out how to reduce your application memory consumption with a new MRI Ruby distribution from Hongli Lai, one of the original creators of Passenger (and Ruby Enterprise Edition, which was a similar idea in the 1.8 era).

Andrey Novikov

Instantly Know When Ruby Errors Occur & How to Fix Them— With Ruby error tracking from Rollbar you get exception & crash reports in real-time. Track & debug bugs in record time. Start monitoring & fixing errors in minutes - Try Rollbar for free.

Rollbar sponsor

AWS Introduces ‘aws-rails-provisioner’ for Deploying Rails Apps on AWS Fargateaws-rails-provisioner, now in developer preview, helps you define and deploy containerized Rails apps on AWS Fargate (an AWS service that runs container-based apps without you having to manually manage any servers yourself).

Amazon Web Services

Disassembling Rails: How Does ActionText Deal with File Uploads?ActionText is a new rich text editing component (based upon Trix) introduced in Rails 6, and this post explains the way it handles uploaded files.

Stan Lo

First Beta of Jekyll 4 Released— A pre-release of Jekyll 4, the next major release of the popular static site building system.

Matt Rogers

💻 Jobs

Ruby on Rails Engineer— Goldstar is looking for experienced Ruby on Rails Engineers onsite in Portland, Oregon and Pasadena, California.

Goldstar

Software Engineers - Ruby on Rails (Sacramento, CA)— Help us expand our industry leading legal records procurement software at scale with Ruby, Rails, React, GraphQL, and PostgreSQL.

Gemini Legal

Ruby Developers Are in Demand on Vettery— Ready for a bold career move? Make a free profile, name your salary, and connect with hiring managers from top employers today.

Vettery

📘 Articles & Tutorials

How to Deal with Complex Factory Bot Associations in RSpec Tests— Complex setups for test data, particularly where objects rely upon other objects, can be a big cause of headaches when testing. Jason quickly shows a way to structure things when using RSpec.

Jason Swett

7 Ways to Selectively Run RSpec Tests— For when you don’t want to run the entire test suite..

Emmanuel Hayford

How I Learned to Stop Worrying and Love Failed Builds

CircleCI sponsor

Setting Up a Rails 6 App with Multiple Databases on Heroku— Rails 6 makes it easier than ever to use multiple databases with the same app. Here’s how it works and a Heroku-related thing to consider.

Prathamesh Sonpatki

Using Array's uniq Method To Remove Duplicates— Using uniq on its own is easy enough, but using it with a block provides even more power. One for beginners.

Jesus Castello

Recyclable Cache Keys in Rails— Rails 5.2 added cache_versioning and collection_cache_versioning to support recyclable cache keys.

Taha Husain

Showing Your Ruby Version in iTerm's Status Bar— The latest version (3.3.0) of the macOS terminal emulator iTerm2 lets you customize the status bar and you can put the current version of the languages you use there. It’s not enough to drag me away from Terminal but it’s a neat feature to see.

Nick Jones

🛠 Code and Tools

Ciao: An HTTP Monitoring Tool, Built on Rails— An open source webapp that checks HTTP endpoints and can send notifications when things occur (e.g. a site goes down or throws an error).

Brot and Games

Hightop: A Shortcut for Group Count Queries— Adds a top method to Enumberable so works with both plain old arrays or ActiveRecord.

Andrew Kane

Founders/CTOs: We Upgrade Rails So That Your Team Doesn’t Have To

Upgrade Rails sponsor

Combustion: Simple, Elegant Testing for Rails Engines— Rails ‘engines’ are basically ‘sub-apps’ that can provide functionality within the context of a bigger Rails app. Combustion helps you structure their tests in a more logical way.

Pat Allan

Committee: Rack Middleware to Support JSON Schema— For when you want to build services based upon JSON Schema, OpenAPI 2, or OpenAPI 3.

interagent

Stitches: Create Microservices in Rails with 'Minimal Ceremony'

Stitch Fix Technology

TTY::Pie: Draw Pie Charts in Your Terminal Window

Piotr Murach

A tour of Ruby's 'magic' comments

$
0
0

#463 — August 15, 2019

Read on the Web

Ruby Weekly

How to Correct 32,000 Incorrect CSV Files in Fewer Than 32,000 Steps— We’ve all faced a data processing task from hell and CSV loves to throw up complexities around escaping and stray commas. Here’s how one Rubyist dealt with it, and came up with the comma_splice gem to help.

Jeff Keen

Magic Comments in Ruby— You’ve likely seen (and even used) ‘magic’ comments, but you probably don’t know all of them or understand things like precedence.

Mehdi Farsi

Automated Code Reviews for Ruby— Take the hassle out of code reviews - Codacy flags errors automatically, directly from your Git workflow. Customize standards on coverage, duplication, complexity & style violations. Use in the cloud or on private servers. Get started free.

Codacy sponsor

▶  How Rails on Windows is Now an Excellent Experience— Two weeks ago we linked to a post by esteemed Microsoftie Scott Hanselman where he proclaimed that developing with Ruby and Rails on Windows 10 is now fabulous. Now he’s on the Ruby on Rails Podcast discussing it in more depth with Brittany Martin.

Ruby on Rails Podcast podcast

JRuby 9.2.8.0 Released— The JVM-based Ruby implementation boasts a substantial runtime memory reduction.

JRuby Core Team

💻 Jobs

Ruby on Rails Engineer— Goldstar is looking for experienced Ruby on Rails Engineers onsite in Portland, Oregon and Pasadena, California.

Goldstar

Ruby Developers Are in Demand on Vettery— Ready for a bold career move? Make a free profile, name your salary, and connect with hiring managers from top employers today.

Vettery

📘 Articles & Tutorials

Using clamp To Restrict Values to a Certain Range— Add this to my “I didn’t notice Ruby added this” pile. The clamp method was introduced in Ruby 2.4 and lets you do things like this: 500.clamp(1, 100) # => 100

Andy Croll

How Many Ways to Unaccent a Text String?— The answer is: Many. But, which one is fastest? The answer is: It depends.

sport.db

Updating Rails: Where's Memcache Gone?— When there are issues after an upgrade, sometimes it’s your fault, sometimes it’s a gem’s fault, and sometimes it’s both.

Michael Klimenko

How to Visualize the Age of Dependencies in Your Ruby Projects— A neat little script that spits out the age of your project’s various dependencies which will then make it easy to visualize them.

Matouš Borák

Exorcise Poltergeist with Apparition— Do you have flaky Capybara tests? Of course, you do. Let the power of the Apparition gem compel them. (Editor: That’s the wrong classic horror movie!😂)

Dr. Chris Drane

Architecting a Roles and Permissions System Using Rails, GraphQL, and React— There’s plenty in here about authorization system design, alongside the tech bits.

Atrium

Free eBook: How to Get a 3x Performance Improvement on Your Postgres Database

pganalyze sponsor

Advanced Multi-Database Techniques in Rails 6— Most of this is about handling writing vs reading to different databases or replicas, but there is a lot of configuration variations here.

Prathamesh Sonpatki

▶  A Chat with David Heinemeier Hansson— Nothing particularly new here but a very well put together hour covering DHH’s background, the creation of Rails, and his thoughts on Ruby.

Remote Ruby Podcast podcast

Breaking Apart Inheritable mattr_accessors in HTTParty— The subtitle of this post could be “How to Handle Inheritable Attributes”, which is one of those things for which there is no perfect answer.

Nikita Misharin

▶  How I Got a Job as a Product Manager— Tired of not getting any callbacks for her résumé, she rapped about Ruby at RubyConf in front of 300 people.. and it worked.

Shelby Sir

🛠 Code and Tools

Introducing Konfig: A Kubernetes Friendly Rails Configuration Gem— One gem to rule them all…for configuration values and secrets.

Cloud66

Moat: A Small Authorization Library, Built for Scopes— Inspired by Pundit, but focuses more on filtering collections than individual resources when defining policy.

Poll Everywhere

Fully Managed Operations Solutions for Large & Small Teams— Do you need 24/7 support, without the overhead of dedicated staff?

reinteractive | OpsCare sponsor

TTY::Links: Hyperlinks in Your Terminal— Test to see if a terminal supports hyperlinks and outputs them correctly if so.

Piotr Murach

FIFA: The World's Football/Soccer Countries and Codes, in Ruby— Part of the broader sport.db sports database.

Gerald Bauer

aws-dev-utils: Ruby Gem Providing Common AWS Utilities— A set of refinements for the AWS SDK that covers pagination and caching boilerplate.

Kontera Technologies

Comma Splice: Fixes CSVs with Unquoted Commas in Values

Jeff Keen

Rails 6.0, Pong in 160 lines of Ruby, and a new Sinatra release

$
0
0

#464 — August 22, 2019

Read on the Web

Ruby Weekly

Rails 6.0: Yes, It's a Big One!— Rails 6 is out! At this point, you’ve probably heard of all the big, new features so just take it out for a spin and thank the core team. Alternatively, if you need a quick reminder:

Official Rails Blog

strongDM Makes Managing DB Access a Breeze— See why Splunk's CISO says "strongDM gives you what you can’t get any other way - the ability to see what happens, replay and analyze incidents, discriminate customer access from user access."

strongDM sponsor

rest-client and Other Gems Yanked Due to Malicious Code— The problem is now resolved, but the rest-client maintainer’s Rubygems.org account was hacked and versions 1.6.10-1.6.13 contained a malicious backdoor. Ensure you are not using it, and set up multi-factor authentication on your own Rubygems.org account to help avoid similar issues. A variety of other, less popular gems have also been affected, all with relatively (thankfully) fewer downloads.

REST-Client Maintainers

Jekyll 4.0.0 Released— Breaking changes (dropping support for things like RedCarpet), Ruby 2.4.0 or higher required, and some new caching optimizations are all in this release of the popular Ruby-based static site generator.

Matt Rogers

Sinatra 2.0.6 Released— It’s not a big release (changelog) but any release for the popular web development library/DSL is worth checking out. Jordan Owens has also joined the core team and is focusing on v3.0 work.

Kunpei Sakai

Highlights from Git 2.23: New Alternatives for git checkout— Yes, there’s a new version of git. The biggest tweak comes via two new commands, git switch and git restore which aim to break down the git checkout experience into something more controllable.

The GitHub Blog

💻 Jobs

Backend Ruby Developer in Portland, OR— 🏕 Campground review and bookings site seeks a talented Ruby developer to work on our core API and data integrations.

The Dyrt

Ruby developers are in demand on Vettery— Make a free profile, name your salary, and connect with hiring managers from top employers.

Vettery

📘 Articles & Tutorials

A Ruby Gem Debugging Strategy— The subtitle for this post could be “using Pry to debug gems” as it’s a nice recap of the utility of Pry, the powerful Ruby REPL.

Jared Norman

▶  A Quick Look At ActiveRecord Connection Pool Debugging“A few weeks ago I ran into a Rails bug that caused our database pool setting to be ignored (fixed in Rails 6). In this video I step through the debugging process I used to find the cause.”

Adam McCrea

Getting Started with the InfluxDB Ruby Client

InfluxData sponsor

Fail Fast and Fail Often: Handling API Errors at Scale

Akshay Nathan

Active Storage File Upload Behind The Scenes— Active Storage is a framework, now built into Rails 6, that makes it easy to upload, process and reference files within your apps.

Liroy Leshed

Methods vs Constants for Static Values— The takeaway is that how you define static values depends on who (or where) your callers live. Do you agree?

Kir Shatrov

🛠 Code and Tools

Pong Written in 160 Lines of Ruby— An example of using the DragonRuby Game Toolkit, as well as the online code playground for it. Other examples include this Ruby port of GORILLA.BAS and a Flappy Bird clone.

Amir Rajan

RailsAdmin 2.0: An Engine That Provides a Backend Admin Interface— A Rails engine that gives you an easy interface for basic CRUD manipulation of data of your choice. Check out the live demo.

Erik Berlin

Monitor and Analyze Ruby App Performance in Real-Time. Try Datadog APM Free

Datadog APM sponsor

minitest-rails 6.0: Minitest Integration for Rails— Now updated with support for Rails 6.0.

Mike Moore

Rocketman: Event-Based/Pub-Sub Code in Ruby— Rocketman aims to be a lighter ‘stepping stone’ on the event-driven architecture continuum.

Edison Yap

nonschema_migrations: Separate Schema From Data Migrations in Your Rails Apps"Splitting your data migrations from your schema migrations has a particular benefit of achieving the most consistent zero-downtime deploys you can."

Jason Fleetwood-Boldt

⚡️ Quick Releases

Understanding Webpacker in Rails 6

$
0
0

#465 — August 29, 2019

Read on the Web

Ruby Weekly

Faker 2 Released: A Library for Generating Fake Data— A very long standing and popular library has taken some neat steps forward lately and v2’s API has introduced some breaking changes. If you want to create ‘fake’ or dummy data, however, this remains the gold standard.

Faker

Ruby 2.6.4, 2.5.6, and 2.4.7 Released— Not feature releases, these releases are all about fixing a jQuery vulnerability in RDoc. (You’d do well to disable RDoc and RI generation when installing gems anyway.) Link is to 2.6.4, here’s 2.5.6 and 2.4.7.

ruby-lang.org

eBook: Best Practices for Optimizing Postgres Query Performance— Learn how to get a 3x performance improvement on your Postgres database and 500x reduced data loaded from disk in this free pganalyze eBook.

pganalyze sponsor

Understanding Webpacker in Rails 6— If you’re still using Sprockets then this guide will help you wrap your brain around the future that is Webpacker. If not, it’s still a good reference.

Prathamesh Sonpatki

▶  Discussing Sorbet, the Ruby Type Checker, with Paul Tarjan— David Kimura, Andrew Mason, and Stripe’s Paul Tarjan, discuss Sorbet, the recently open sourced type checker for Ruby.

Ruby Rogues podcast

💻 Jobs

Backend Ruby Developer in Portland, OR— 🏕 Campground review and bookings site seeks a talented Ruby developer to work on our core API and data integrations.

The Dyrt

Ruby developers are in demand on Vettery— Make a free profile, name your salary, and connect with hiring managers from top employers.

Vettery

📘 Articles & Tutorials

A Double Splat (**) Operator Cheatsheet— Less a cheatsheet and more a collection of neat examples. The merge functionality for hashes is pretty neato, as well as being a bit faster than Hash#merge

Ilia Kriachkov

How to Store Large JSON Documents in Postgres with the Rails Attributes API— An interesting example of working with your own datatype in Rails.

Dmitry Voronov

Heroku on Easy Mode— Effortlessly autoscale your web and worker dynos. Cut your Heroku bill in half and make timeouts disappear.

Rails Autoscale sponsor

What is Module Autoloading in Ruby?Autoloading is the concept of letting Ruby automatically load other code files in your project when they’re first needed rather than all up front.

Jesus Castello

Exercises for curl Users— Less a tutorial and more a guide to practicing how to use curl, the popular command line HTTP client. Not exactly Ruby, but I use curl a ton in my Ruby development.

Julia Evans

Faster Heroku Deploys with Rails and Webpacker— With a new default asset bundler (webpack) we are back to old problems, like rebuilding it’s not needed and not caching build assets. Don’t worry, it’s easy enough to fix.

Wiktor Mociun

Emoji Driven Development in Ruby— This is more for amusement than for your production code(!) But, yes, you can use emojis in your Ruby code.

Tom Lord

Permitting Nested Arrays using Strong Params in Rails— Nested arrays, like nice folks, finish last.

PJ Frias

Ruby 2.7 Adds Time#ceil and Time#floor Methods

Romil Mehta

🛠 Code and Tools

Rein: Postgres Database Constraints Made Easy for ActiveRecord— Validations are great at the application level, but what if you want some database-level data integrity? Now supports Rails 6.

Joshua Bassett

InvoicePrinter 2.0 Released: A Way to Quickly Create PDF Invoices— The project has been split into multiple gems so you can use the library and the server independently.

Josef Strzibny

Founders/CTOs: We Upgrade Rails So That Your Team Doesn’t Have To

Upgrade Rails sponsor

Bundler-Leak: Find Known Memory Leaks in Your Dependencies— Inspired by bundler-audit, bundler-leak checks a moderated database of known, leaky gems.

Luis Sagastume

A Ruby Wrapper Around the Google Places API— The Places API is a service that returns information about geographic locations or points of interest.

Quinten Powell

Stripe Ruby Library 5: Use Stripe from Rubyv5 came out last week and introduced a variety of changes (some breaking) - luckily there’s a migration guide.

Stripe

Moving: A Clean and Minimalist Theme for Jekyll— I really love clean this theme for the popular Jekyll Ruby-based static site generator is (which recently got a major new version).

Yizheng Huang

XGBoost and LightGBM Come to Ruby— These two libraries bring “gradient boosting” to the machine learning story in Ruby, which is an algorithm that performs well on large datasets.

Andrew Kane

Sidekiq 6.0 released, and Matz says no to the pipeline operator

$
0
0

#466 — September 5, 2019

Read on the Web

Ruby Weekly

Matz Says Bye Bye to the Pipeline Operator |>— The ‘pipeline operator’ was a piece of syntax added to Ruby head on an experimental basis as an alternative to method chaining, but Matz said it caused ‘more confusion and controversy’ than he had expected. However, the idea of letting comments appear within multiline method chains appears to have stayed..

The Ruby Programming Language

Sidekiq 6.0 Released— The popular background job framework reaches 6.0 by both adding (logging formatters, ActiveJob integration) and taking away (init.d daemons). Pro and Enterprise versions have also been updated to match.

Mike Perham

🤔 How Well Do You REALLY Know Ruby's Exception System?— Download your free copy of Starr Horne’s thirty-nine-page eBook and quickly level-up to Exception Master. 😎

Honeybadger sponsor

How Ruby Encodes References - Ruby's 'Tiny Objects' Explained— There are three levels of Ruby object in terms of the underlying storage.. large objects, small objects, and ‘tiny’ objects which are stored within a single 8 byte/64 bit reference.

Noah Gibbs

DHH on 'Arming the Rebels' with Rails 6— David Heinemeier Hansson, the creator of Rails, joins the Ruby Rogues crew to discuss Rails 6, how the core team works, and how he feels about Rails’ position in the app development space.

Ruby Rogues

Numbered Parameters Coming to Ruby 2.7, With a New Syntax— If you want to access parameters in a block, say, you could use the normal |param| syntax or, in future, address the parameters numerically using special variables _1, _2, and so on. This replaces a former proposal for using a @1 type syntax instead.

Yukihiro 'Matz' Matsumoto

💻 Jobs

Ruby on Rails Developer at X-Team (Remote)— Join the most energizing community for developers. Work from anywhere with the world's leading brands.

X-Team

Find a Ruby job through Vettery— Make a free profile, name your salary, and connect with hiring managers from top employers.

Vettery

📘 Articles & Tutorials

A Rubyist's First Impressions of GitHub ActionsGitHub Actions, still in beta, is a service for automating ‘software workflows’ such as CI/CD, deployment, releases, etc. How does it feel when using it on a Ruby project?

Vladimir Dementyev

▶  Implementing Push Notifications with ActionCable— How to use ActionCable to broadcast Push Notifications to users of your Rails applicaion.

Drifting Ruby

Automated Code Reviews for Ruby— Set standards and alerts on coverage, duplication, complexity, and style issues, and see real-time feedback in your Git workflow.

Codacy sponsor

Rails 6 Adds filter_attributes on ActiveRecord::Base— Think of it as the attributes version of filter_parameters so you don’t log sensitive info.

Amit Choudhary

Testing an External API Integration with the VCR Gem— The briefest of introductions to the vcr gem, a way to ‘record’ and playback HTTP interactions – ideal for testing.

Alexander Spitsyn

Working with Rails 6's DNS Rebinding Attack Protection— It’s as easy as adding values to config.hosts.

Prathamesh Sonpatki

Service Objects: Beyond 'Fat Models' and 'Skinny Controllers'— A brief explanation of why one team uses service objects whenever they can.

Cleiviane Costa

3 Keys to Upgrading Rails— Thoughts on building a proper workflow to upgrade Rails apps between different versions.

Kevin Solorio

Ruby 2.7 adds FrozenError#receiver

Romil Mehta

🛠 Code and Tools

Ferrum: A 'Fearless' Ruby Chrome/Chromium Driver— If you’ve used JavaScript’s Puppeteer for controlling Chrome from code, this is the same idea but in an idiomatically Ruby fashion. Looks good!

Dmitry Vorotilin

Architect 6.0: A Serverless Deployment Tool Now Supports RubyArchitect is an interesting way to create and deploy serverless apps and now works with JavaScript, Python and Ruby.

Ryan Block

Monitor and Analyze Ruby App Performance in Real-Time. Try Datadog Free

Datadog sponsor

Upcoming Features in Shrine 3.0— An extensive look forward to the future of Shrine, a popular file attachment and uploading toolkit for Ruby apps.

Janko Marohnić

youtube-audio: Extract Videos From YouTube in Audio Format

Jorge Hernandez

An interview with Ruby Object Mapper's Piotr Solnica

$
0
0

#467 — September 12, 2019

Read on the Web

In issue 460 we included an interview with benchmarking expert Noah Gibbs. A lot of you loved how it came out.. so we're back with a new interview with Piotr Solnica of ROM and dry-rb fame! Find it at the end of the issue.

Ruby Weekly

▶  A Plan Towards Types in Ruby 3 Types— Ruby core team member Yusuke Endoh (who is famed for his prowess in the IOCCC) presents an update on progress to supporting the static analysis of types in Ruby 3, currently in a way that doesn’t hugely change the simple Ruby development experience we know and love.

Yusuke Endoh

Running GitHub on Rails 6.0— The story of how GitHub stayed up to date with using Rails 6.0 during its development, resulting in an upgrade process that is an example to follow.

Eileen M. Uchitelle (GitHub)

What It Means to Be Remote First Versus Remote Friendly— Being a truly remote-first organization requires intentionality that spans people, tooling, and process. Product Manager Rose Jen walks us through some of the considerations when striving to build a fully inclusive distributed team.

CircleCI sponsor

A String Corruption Issue in Ruby 2.6.4— If you didn’t upgrade to 2.6.4 yet, hold off until 2.6.5 is out! The bad news is the bug is nondeterministic and hard to reproduce. The good news is it’s fixed, but we’re awaiting releases.

Ruby Issue Tracker

▶  A Visualization of 20 Years of Ruby Development— An hour long (!), Gource-powered visualization showing the various modules of the source and the coming and going of contributors working from 1999 to now.

Landon Wilkins

The Evolution of Ruby Strings from 1.8 to 2.5— This is an interesting diff, version on version, that ends with a look at how allocations have been affected.

Mehdi Farsi

💻 Jobs

Senior Rails Engineer, Product (Remote)— Stack: Ruby on Rails (5.2), Stimulus, Postgres & Heroku — We strive to keep our frameworks/libraries up to date. Perks: Remote team, competitive pay, meaningful company equity.

Fleetio

Find a Ruby job through Vettery— Make a free profile, name your salary, and connect with hiring managers from top employers.

Vettery

📘 Articles & Tutorials

▶  Surrounded by Ruby Microservices— The patterns and practices used at Netflix when building Rails microservices, so you’ll hear things like “ports and adapters”, “repository pattern”, and “dependency injection”. Great to see Netflix using Ruby, too.

Damir Svrtan (Netflix)

Making Friends with Rubocop— A developer shares his company’s story of how they started to rely upon Rubocop, the Ruby code analyzer.

Prathamesh Sonpatki

24/7 Hosting and Support for ROR Applications— Our team keeps your app running, you’re free to develop and release at your own pace.

Reinteractive sponsor

▶  How to Write Tests for Validations in Rails

Go Rails

Migrating From Paperclip to ActiveStorage: A Different Approach— Sortlist has hundreds of thousands of images to migrate while keeping a production app functional.

Sortlist

Using Custom Validators in Rails— A reasonably basic tip, but if you’re jamming a lot of options or regexes into your validations, it’s time to break that validation out into its own class.

Andy Croll

Understanding the next& break Keywords— There are a couple of gotchas, for sure.

Jesus Castello

How to Emulate AWS SQS for Development in a Dockerized Rails App— If you have AWS’s Simple Queue Service (or, possibly, any queue) as a dependency, this is an extremely useful tip to keep development smooth.

Ankit Samarthya

🛠 Code and Tools

Administrate: A Rails Engine for Building Flexible Admin Dashboards— Automatically generate dashboards to enable users to edit data for any model in a Rails app. This week’s release adds Rails 6 support. There’s a demo here.

thoughtbot, inc.

Maxitest: It's Minitest, Plus All The Features You Always Wanted..

Michael Grosser

Free eBook: How to Get a 3x Performance Improvement on Your Postgres Database

pganalyze sponsor

MetaTags: A SEO Helper Plugin for Rails Apps— Helpers for generating meta tags for pages in your Rails app.

Dmytro Shteflyuk

A Huge Collection of Ruby One-Liners— These aren’t new but I love coming back to these every now and then as there’s always something new to learn from these bitesize Ruby examples designed for command-line use.

Benoit Hamelin

RbNacl: Ruby Bindings to the Networking and Cryptography (NaCl) Library (a.k.a. libsodium)

Crypto.rb

💬 A Q&A with…
Piotr Solnica
major contributor to ROM and the dry-rb gems, so he's passionate about quality open source.

Piotr is serious about Ruby and open source. In fact, you can sponsor his awesome work on GitHub, which is something we strongly encourage. We're exceedingly grateful that Piotr took some time to answer our questions this week.

What inspired you to become such a productive open source contributor in Ruby?

Scratching my own itch is probably my biggest inspiration. I always look for existing solutions and when I don't see anything that would satisfy my requirements, I just go ahead and build my own solution. I also spent a lot of time fixing other people's problems, which was a great source of inspiration too. Talking to people is also very inspiring - especially when it happens in the real world. Every time I go to a conference I meet people who use some of the gems I built or help maintain and talking about their experiences (whether bad or good!) motivates me to keep going.

Do you ever use Active Record?

No. I've learned over time that it's a very bad pattern. These days I'm anti-ORM in general and, for me, Active Record is the worst of all the popular ORM patterns. I used to think it's great for simple apps, but the more I worked with rom-rb, the more I realized you can be as productive as with Active Record, yet you have a much better foundation for scaling your code (in terms of both complexity and performance).

I think ditching ORMs is one of the best things programming communities could do. Unfortunately in the case of the Ruby community it's especially hard because of the widespread adoption of the Active Record pattern.

What is your Ruby web app toolset of choice?

I use a mixture of dry-rb and rom-rb libraries, which is probably not a surprise to anybody who knows me 🙂 I try to avoid Rails, but even when I am forced to use it, I can still plug in at least some dry-rb gems and things become better for me. For routing I still use Roda, even though I'm no longer a fan of the routing tree concept.

My dream-stack in Ruby will be Hanami 2.0 though - that's why I started helping with this effort. More specifically - rom-rb for anything database-related, dry-schema for handling HTTP params, dry-validation for complex domain validation, dry-monads for control-flow and Hanami for routing and glueing everything together.

What excites you most about Ruby's future?

Two things: First, a bigger focus on concurrency, because pretty much all of the gems I've been working on since roughly 2014 focused on, amongst many other things, thread-safety and making it easier to write concurrent code in Ruby. I've already built a couple of PoCs using rom-rb and some dry-rb gems just to see how concurrent processing could be leveraged and it looked very promising. If we can achieve better performance by writing concurrent code using MRI, then you'll be able to benefit from dry-rb/rom-rb a lot. It seems like all of that is around the corner.

Secondly, it looks like Ruby core team started paying more attention to the functional aspects of the language. We see features like pattern matching or proc composition operator being added or discussions about adding immutable structs. This is very exciting for me given that I've spent 5+ years convincing people that moving away from classic OO, even when you use Ruby, is one the best things you can do to make your code better.

Piotr currently works for Theorem.

Benchmarking fibers vs threads and processes

$
0
0

#468 — September 19, 2019

Read on the Web

Ruby Weekly

Fullstaq Ruby Epic 2 Released with an APT/YUM Repo and Ruby 2.6.4 Support— Fullstaq Ruby is a distro “optimized for server use cases”. The memory benchmarks are pretty compelling.

Hongli Lai

Start It Up: Improving JRuby's Startup Time— One of JRuby’s few weaknesses has always been startup time, so how is that being addressed and what can we do today to mitigate it? Charles Nutter is back with his first blog post in a year to address these issues.

Charles Nutter

Benchmarking Fibers, Threads and Processes— Fibers are simpler but are they faster than threads? Or is there a way to use fibers that approaches the concurrency of processes?

Noah Gibbs

Your Ruby CI/CD Pipeline Needs an Upgrade— The Superhuman engineering team reduced build time from 17 mins to 70 seconds. With Semaphore, you can go faster too. Model any CI/CD workflow for Ruby, Docker and iOS with autoscaling pipelines. Try it free with GitHub.

Semaphore 2.0 sponsor

7 Great Ruby Gems Most People Haven’t Heard About— Some good picks here, from finding dead routes and code to making your tests faster. I’d heard of 4, but I publish this newsletter.. 😄

Jesus Castello

▶  Recruitment on Rails with Brian Mariani— Brian Mariani, founder of Ruby on Rails focused recruiting firm ‘Mirror Placement’, joins Brittany to reveal how the Rails job market is doing, what accompanying technologies devs should learn, key interview tips and if the fabled ‘full stack developer’ is still relevant.

Brittany Martin (Ruby on Rails Podcast) podcast

TextMate 2.0 Released: The macOS Text Editor Once Associated with Rails— I’m featuring this for nostalgic purposes! If you began to learn Ruby when Rails first came out (2004-2005), you might recall how huge TextMate was as the editor of choice. It’s still DHH’s favorite editor. The downloads are here.

Textmate

💻 Jobs

Find a Ruby job through Vettery— Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.

Vettery

📘 Articles & Tutorials

Ruby 2.7 Adds Module#const_source_locationMethod#source_location provides a way to find out where a method was first defined. Module#const_source_location brings the same idea to constants (which includes classes and modules).

Romil Mehta

Creating Multiple Models with Form Objects in Rails— This is bit of a different look at the interactor pattern that stays within core Rails so you don’t have to add another dependency.

John Maddux

Rails 6 Adds dig Method to ActionDispatch::Request::Session— If you like dig on your hashes, you get it on the session object as well in Rails 6.

Saeloun Blog

strongDM Makes Managing DB Access a Breeze— Adopt a Zero-Trust approach in minutes, not months.

strongDM sponsor

▶  Discussing Opal with Elia SchitoOpal is a Ruby to JavaScript compiler.

Ruby Rogues Podcast podcast

▶  Ruby on the Apple II: Adventures in Retro Programming— A fun presentation delivered itself on the Apple II looking at one developer’s quest to get Ruby running on the early microcomputer (which focuses mostly on the limitations of the Apple II rather than Ruby itself).

Colin Fulton

▶  Drag and Drop Uploads in Rails using Active Storage, Stimulus.js and Dropzone.js

Andy Leverenz

▶  Using ActiveRecord Without Rails: The Basics

Kyle Geske

🛠 Code and Tools

RQRCode: A Ruby library for Generating QR Codes— It lets you choose a size, set an error correction level, and can output as SVG, PNG, or even ASCII (though I couldn’t get my phone to scan that version).

Duncan Robertson

TensorFlow: Bringing the Machine Learning Platform to Ruby— Uses the C API of the popular ML toolkit under the hood.

Andrew Kane

Timezone: Accurate Current and Historical Timezones for Ruby— Supports queries based on timezone name and also lat/long coords. Gets updated whenever the world’s timezones do (which is more often than you’d think..)

Pan Thomakos

RubyMine 2019.3 EAP Available— RubyMine is a (commercial) IDE for Ruby developers from JetBrains but you can use/trial these ‘early access’ versions for 30 days.

JetBrains

Founders/CTOs: We Upgrade Rails So That Your Team Doesn’t Have To

Upgrade Rails sponsor

Passenger 6.0.3 (and 6.0.4) Released— After a long gap between releases, a new version of the popular app server is here. Just the usual bug fixes and one minor feature: the ability to specify the app spawn directory at startup. (There’s also 6.0.4 which just added some Debian 10 packages)

Phusion Blog

Redis::Objects: Map Redis Types Directly to Ruby Objects— An idiomatically Ruby interface to the Redis data structure server that avoids the usual mess of ORMs (since ORMs don’t naturally fit with the lighter Redis approach).

Nate Wiger

Truemail 1.3: A Configurable Plain Ruby Email Validator— Offers three levels of email validation: regex, MX records, and SMTP, and you can now optionally validate only whitelisted domains too.

Ruby Garage


An interview with Bozhidar Batsov of RuboCop and the Ruby Style Guide

$
0
0

#469 — September 26, 2019

Read on the Web

📣 This week we've got another interview for you — check out the bottom of the issue.

Ruby Weekly

▶  The Journey to One Million— A talk from RubyConf Taiwan 2019 all about improving Ruby and making it more scalable, particularly in the context of concurrency and network I/O and being able to handle one million WebSocket connections simultaneously.

Samuel Williams

FriendlyId: Human-Friendly Slugs and Permalinks for Active Record— v5.3.0, the first release in almost a year, is out. FriendlyId lets you do things like manage slug history and versioning, i18n, scoped slugs, and more.

Norman Clarke

Get More Out of Your Postgres Database— pganalyze summarized their learnings on how to get a 3x performance improvement on their Postgres database. Lots of helpful best-practices.

pganalyze sponsor

Chef's Contract with ICE Causes Gem Yanking ControversyChef is a popular Ruby-based infrastructure automation system. The company behind it was found to have entered into a contract with the United States’ Immigration and Customs Enforcement agency. In protest, the developer of chef-sugar yanked his code and gems. Chef has since decided to not renew the contract but has also claimed ownership of the related gems on RubyGems.org.

The Register

Fail Fast and Fail Often: Handling API Errors at Scale— What do you do when 100,000 Sidekiq jobs fail every day? If at first you don’t succeed, retry, retry again.

Akshay Nathan

Puma 4.2 Released: A Rack Web Server Built for Concurrency— A popular, long standing, reactor-based Ruby/Rack web server. Release notes.

Puma

💻 Jobs

Senior Rails Engineer, Product (Remote)— Stack: Ruby on Rails (5.2), Stimulus, Postgres & Heroku — We strive to keep our frameworks/libraries up to date. Perks: Remote team, competitive pay, meaningful company equity.

Fleetio

Find a Ruby job through Vettery— Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.

Vettery

📘 Articles & Tutorials

For Organizing Rails Projects, 'Domain Objects are Good and Service Objects are Bad'— Service objects (or the Interactor pattern) are popular in Ruby/Rails circles. Should they be? Jason doesn’t think so and shows off some refactoring here.

Jason Swett

Ruby 2.7 Adds Integer#[] to Support Range Values— It’ll let you access a range of bits within the binary representation of the integer. As a bit twiddler myself, this is great, but I’m surprised it made it in.

Romil Mehta

Behind-the-Scenes of 'Geared Pagination' in Rails— A dive inside the geared_pagination gem which was written by DHH. The idea of geared pagination is that the number of records shown is based on a ratio to the page number.

Liroy Leshed

10 Lessons Learnt From The 'Tennis Game' Refactoring Kata— Katas are a great way to practice refactoring, as is watching someone else mercilessly refactor their code.

Arkency Blog

▶  How to Use Devise Test Helpers— If you’re using Devise for authentication, did you know it provides helpers to make testing its controllers easier?

GoRails

Automated Code Reviews for Ruby— Set standards on coverage, duplication, complexity, and style issues and see real-time feedback in your Git workflow.

Codacy sponsor

Ruby Templating: Baking an Interpreter— This final post in a three-part series covers using the Visitor Pattern to render the templates.

Benedikt Deicke

Using Vim for Ruby and Rails Development in 2019— The trickiest thing about using Vim can be just getting going. This article goes from zero to fully functional IDE to get you over the hump.

Vim from Scratch

▶  Discussing How to Build a Consulting Business— This isn’t Ruby specific, but consulting is popular in our space and Test Double is a Rails shop, so..

Ruby Rogues Podcast podcast

Flaky Ruby Tests— We’ve all had them. Tests that pass sometimes and fail others. Dan’s approach to address (not fix) the issue is a good study in making flaky tests a bit better.

Dan Mayer

Rails 6 Adds add_foreign_key& remove_foreign_key for SQLite3

Amit Choudhary

🛠 Code and Tools

Chewy: A High-Level Elasticsearch Framework— An ODM and wrapper for working with Elasticsearch in a more idiomatically Ruby, developer-friendly way (check out the code examples).

Toptal

Erubi: A Small, Alternative ERB Implementation

Jeremy Evans

Instantly Know When Ruby Errors Occur & How to Fix Them

Rollbar sponsor

childprocess: Cross-Platform Library for Managing Child Processes

Eric Kessler

Rubyzip: A Library for Working with .zip Files— Create zip archives, open them up, add password protection..

The Rubyzip Team

Faker 2.4: A Library for Generating Fake Data— The popular ‘fake’/dummy data generator continues to improve. It now has a generator for Aeternity blockchain values.

Faker

💬 A Q&A with…
Bozhidar Batsov
author of RuboCop, the Ruby Style Guide, and the Weird Ruby Series.

Bozhidar is the VP of Engineering at Toptal and is a driving force around RuboCop and the Ruby Style Guide. He has also started writing about the weird things he's found in Ruby.

What is the weirdest thing you've ever seen in Ruby?

It's hard to pick just one thing as I've bumped into dozens and dozens of weird aspects of Ruby (and I still encounter new things to this day). One of my personal favourites is that defined? returns all sorts of things except actually a boolean value. Most recently I was amused to discover you could nest heredocs (that look super weird!) and by this difference in the behaviour of regular conditionals and modifier conditionals.

Who is the 'weirdest' Rubyist you know (in a good way)?

That's a simple question - my good friend Nick Sutterer, of Trailblazer fame. His vision for the future of Ruby is pretty bold and many people have considered it to be extra 'weird'. I really think our community needs more people like Nick who are constantly challenging the established rules and norms and are trying existing problems in novel ways (e.g. his ideas for adding real namespaces to Ruby).

What is the weirdest request you've received for the Ruby Style Guide?

There are a lot of strong contenders for the title, but I'll go with this, which was trying to make the case that it's a bad idea to use _ as a thousands separator.

Every now and then someone will suggest we start discouraging some universally adopted practice or start promoting something weird and I guess that's not a bad thing. I have a feeling that the most weird requests ended up in RuboCop's issue tracker though, as every now and then I'd get the request there to add support for a very peculiar coding style that I've never encountered in my entire career with Ruby. With great flexibility comes a lot of potential for weirdness!

Bozhidar works for Toptal.

Using Ruby for primitive but productive automation

$
0
0

#470 — October 3, 2019

Read on the Web

Ruby Weekly

What's New in IRB in Ruby 2.7?— IRB, the trusty Ruby REPL, isn’t something we often see getting updated with new Ruby releases, but Ruby 2.7 is introducing a few niceties like syntax highlighting. Pry may, however, remain the power user’s REPL of choice.

Prajakta Tambe

Ruby 2.6.5 Released (and 2.5.7, and 2.4.9)— Security update time. These fixed security issues are unlikely to affect many in a direct way but include a code injection vulnerability in Shell#[], two issues with WEBrick, and a NUL (ASCII 0) injection vulnerability in two File methods. Here’s 2.5.7 and 2.4.9 if you need them.

ruby-lang.org

The Ruby Security Handbook— Learn actionable best practices to help you protect your Ruby applications. Download the checklist for tips on monitoring, infrastructure, protection, and more.

Sqreen sponsor

Using Ruby for Primitive But Productive Automation— How to use Ruby to script a boring task. I love using Ruby for this sort of thing myself and it’s well worth learning how to do.

Keith R. Bennett

Sidekiq 6.0.1 Should Be '10-15% Faster'?Sidekiq 6.0 only came out a month ago, but there’s already been a big performance patch plus new dark mode support in the Web UI.

Mike Perham

💻 Jobs

Software Engineer, Contract Leading to Perm (Remote within UK)— Help build the future of venture capital through a Ruby-platform. Mostly remote team. Stack: Sinatra, Postgres, AWS, React.

Accelerated Digital Ventures

Scale the Runtime with Ruby Infrastructure at Scribd— Ruby serves billions of pages per year at Scribd. Optimize new versions of Ruby & Rails while contributing improvements upstream.

Scribd

Find A Job Through Vettery— Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.

Vettery

📘 Articles & Tutorials

Using Ruby 2.7 Experimental Features in Production: Pattern Matching and Numbered Block Args— New, edge versions of Ruby are certainly safer to use in production now than they used to be (anyone remember 1.9.0?) and while you should tread with caution, it opens up cool use cases like these.

Akshay Nathan

How I Wrote a Ruby Program to Manage EC2 Instances for Me— Yet more automation using Ruby :-) The end result is a tool (still in its embryonic stages) called Exosuit whose goal is to help provide a Heroku-esque deployment experience but on AWS.

Jason Swett

Explore the Code[ish] Podcast— A podcast from the team at Heroku, exploring code, technology, tools, tips, and the life of the developer.

Heroku sponsorpodcast

Sharing Query Logic Within ActiveRecord Models

Chris Toomey

Building a Rails CI Pipeline with GitHub ActionsActions is GitHub’s new automation platform that you run directly from inside a GitHub repository.

Matt Swanson

Mastering 'Packs' in Webpacker— Webpacker is Rails 6’s system for packaging JavaScript.

Prathamesh Sonpatki

Introducing RuboCop to Legacy Projects: Some TODOs and TODON’Ts

Scott Matthewman

Rails 6's Support for 'Actionable' Error Pages— Let’s say you have a pending migration, start up your app in development mode, and get an error page. In Rails 6, you can click a button to run those pending migrations!

Taha Husain

How to Use The Ruby Ternary Operator (?:)— If code like a ? x : y makes no sense to you, start here. It’s a handy piece of syntax.

Jesus Castello

▶  When You HTTParty, You Must Party Hard with John Nunemaker— If you’ve been in the Ruby world for some time, John Nunemaker’s name will be familiar to you, but even if not, you’ve probably used HTTParty (or his work on GitHub) somewhere down the line. In this 42 minute interview, he talks about why he loves Ruby and Rails and the story behind HTTParty’s (in)famous post-install hook.

Ruby on Rails Podcast podcast

▶  My Ruby Story: David A. Black— A 40 minute chat with David Black, a well known Rubyist and author of The Well-Grounded Rubyist.

My Ruby Story Podcast podcast

🛠 Code and Tools

Introducing dry-effects: The Newest dry-rb Library— The dry-rb family of libraries gets a new member: dry-effects, a way to easily use algebraic effects in your code.

Nikita Shilnikov

HexaPDF 0.10.0: PDF Generation and Manipulation in Ruby— If you not only want to generate PDFs but open them, modify them, extract content, merge them together, etc. then HexaPDF is for you. Note that HexaPDF is AGPL licensed with a commercial license option.

Thomas Leitner

Peek: Take a 'Peek' Into Your Rails Applications— A profiling tool originally built at GitHub for getting a quick look (by way of a information bar on the top of your app) into some metrics underlying a live Rails app.

GitHub

Automated Code Reviews for Ruby, Directly from Your Git Workflow

Codacy sponsor

TestRocker: The Simplest Inline Ruby Testing Library— First built for a contest 8 years ago, this library which leans upon a Ruby syntax quirk has just been updated to use Ruby 2.0’s refinements.

Peter Cooper

Wicked PDF: PDF Generation for Rails Apps— Uses wkhtmltopdf behind the scenes to serve a PDF version of a chosen HTML view.

Miles Z. Sterrett

InvoicePrinter 2.0: Generate PDF Invoices from Ruby— It is absolutely ‘PDF week’ here in Ruby Weekly! :-)

Josef Strzibny

Why RSpec Tests Fail (and How To Fix Them)

$
0
0

#471 — October 10, 2019

Read on the Web

Ruby Weekly

Ruby 2.7 to Deprecate Automatic Conversion of a Hash to Keyword Arguments— The way ‘keyword arguments’ work in Ruby grew from the legacy approach of passing a hash of arguments into methods. Ruby 3.0, however, will have ‘real’ keyword arguments separated from the idea of hashes, so the automatic conversion of a supplied hash into keyword arguments will yield a warning in Ruby 2.7.

Rohit Kumar

The Minitest Style Guide— The Rubocop team have put together a style guide for at least my favorite Ruby testing library of choice: minitest!

Rubocop Team

Pain-Free Rails Deployments— Become a more productive developer with Cloud 66 for Rails. The best tool to build, deploy, and manage your Rails apps on any cloud. Try it free and deploy happy.

Cloud 66 sponsor

Spree 4.0: The Rails-Based Ecommerce System— Spree is a long standing modular, API-driven and Ruby-based open source ecommerce system, and with this latest version is now fully Rails 6.0 compatible.

Spree Commerce

Why RSpec Tests Fail (and How To Fix Them)— A variety of examples of where your tests could fail (time, callbacks, randomness, etc.) and thoughts on troubleshooting such issues.

Thomas Barrasso

▶  A Bunch of Rails Tips and Tricks in 13 Minutes— If you like quick fire grab bags of tips and tricks, this is the video for you. Includes things like the helper object, presence_in, date ranges in Active Record queries, number formatting, bundle outdated, and more.

Drifting Ruby

London Ruby Unconference 2019 on October 19— It’s only a fiver and they asked so nicely we had to include it :-) If you’re in the UK, want to meet some fellow Rubyists, consider heading to London on Saturday, October 19.

London Ruby Unconference

💻 Jobs

Scale the Runtime with Ruby Infrastructure at Scribd— Ruby serves billions of pages per year at Scribd. Optimize new versions of Ruby & Rails while contributing improvements upstream.

Scribd

Find A Job Through Vettery— Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.

Vettery

📘 Articles & Tutorials

▶  How to Write System Tests in Rails— System tests allow you to use a browser for testing your Rails app including the dynamic, JavaScript-powered elements.

Go Rails

How to Build a Rails App That Uses Vue.js and JSX— There aren’t a ton of Rails tutorials that use Vue, so here you go.

Andrea Vassallo

Test Mux Video for Your Ruby App for Free ✨— Easily build beautiful video experiences into your Ruby app. Create a free Mux account and get $20 credit today.

Mux sponsor

The Algorithms Behind RuboCop's Complexity Metrics— A series of posts about how RuboCop calculates its complexity metrics on code.

Abhimanyu Singh

▶  Ruby for Good with Polly Schandorf— Polly Schandorf is an organizer of Ruby for Good, an hackathon-of-sorts about using Ruby to make the world “gooder”.

Ruby on Rails Podcast podcast

Save Your Links From Phishers— Define a special link helper to make links that prevent the remote site indulging in some ‘reverse tabnabbing’.

Eugene Komissarov

Fully Deleting User Data— Whether it’s compliance-driven or not, making sure to fully delete user data is part of delighting your users.

Monolist

🛠 Code and Tools

RuboCop Meets Minitest— RuboCop has had a RSpec extension for years, but they’ve been working on rubocop-minitest for a while and are now happy to show it off.

Bozhidar Batsov

will_paginate 3.2: A Pagination library for Rails, Sinatra, and More— Amazingly it is possible for a long established pagination library to keep getting better. It’s totally up to date, complete with Ruby 2.7 and Rails 6 compatibility.

Mislav Marohnić

Monitoring & Distributed Tracing for Ruby Apps. Try Datadog APM Free

Datadog APM sponsor

connection_pool: Generic Connection Pooling Library— I found this this week and it works very well as a way to use the http gem across numerous threads in a multithreaded app.

Mike Perham

WEBrick 1.5: The HTTP Server Toolkit— WEBrick is best known as a simple, pure Ruby HTTP server that’s been in the standard library for 15+ years. It’s been shifted out to a separate gem, and here’s the first release in a year. Nothing big, but looks like mostly Ruby 2.6-focused tweaks and fixes.

Ruby Core Team

PunyLinux: A Linux Build System Powered by Ruby and Rake— An interesting approach to building a minimal Linux system.

Ryan Scott Lewis

Parallel: Parallel Processing Made Simple and Fast— Uses both processes and threads to cover all bases.

Michael Grosser

Debugging Hidden Memory Leaks in Ruby

$
0
0

#472 — October 17, 2019

Read on the Web

Ruby Weekly

Debugging Hidden Memory Leaks in Ruby— Tracking down a nasty (new with Rails 6) memory leak using tools like mwrap, heaptrack, iseq_collector, and chap. If these tools aren’t in your toolbox, they might be soon!

Sam Saffron

Shrine 3.0 Released: The File Attachment Handler— Shrine is a gem for handling file attachments that supports resumable uploads and can work with Rails and standard Rack apps. This version is even more friendly to non-Active Record frameworks, among other things.

Janko Marohnić

A New Ruby SDK Gem for Rubyists to Use the Square API— The Square SDK gem makes it easy to use Ruby to process payments or store a card on file from your mobile app or web form. You can also make commerce apps that go beyond payments with orders, customers, inventory and more.

Square sponsor

How MJIT Generates C From Ruby - A Deep Dive— If you like digging into the guts of Ruby compilation and C code, this is your jam. If not, “…this may be a good week to skip this blog.”

Noah Gibbs

A Detailed Log of the Changes in Ruby 2.4— “Ruby 2.4!?” you say, “That came out 3 years ago.” True, but zverok has continued to analyse its changes in-depth (as well as those in Ruby 2.5) which can be a handy page to skim to find those new features you simply missed or never noticed (e.g. I never knew about Integer#digits till just now).

zverok

Ruby 2.7 Introduces a Array#intersection method— Ruby 2.6 added union and difference methods to Array (which broadly work like the | and - operators), and Ruby 2.7 is going a step further with intersection that will work like the & operator.

Aditya Narsapurkar

faastRuby: An Indie Ruby Serverless Platform Shuts Down?— faastRuby was an interesting, independent serverless platform built at a time when AWS Lambda didn’t support Ruby at all. Reading between the lines, it seems the developer may have been acqui-hired by Shopify but he says he’ll be “taking down all faastRuby servers” as a consequence.

Paulo Arruda

💻 Jobs

Sr. Rails Engineer - Top Consultancy (Remote First / India)— Highly-technical Rails/React/React Native firm led by to of the top 100 Rails contributors.

BigBinary.com

Rails Developer— Help build crowdsourcing tools that democratize decision making and fight politics in large organizations.

CultivateLabs

Find A Job Through Vettery— Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.

Vettery

📘 Articles & Tutorials

Getting Started with AWS S3 IAM Policies Security Config for Rails Apps— The joy of getting S3 bucket access and permissions often leads to incorrect and insecure configurations. Is yours configured properly?

Paweł Urbanek

Let's Hash This Out— Some history and advice on using hashes, including why the author prefers Hash over HashWithIndifferentAccess and you probably should, too.

Steve Jackson

Automate and Standardize Ruby Code Quality— Set standards on coverage, duplication, complexity, and style issues and see real-time feedback in your Git workflow.

Codacy sponsor

Exploring Linux File Locking Mechanisms in Ruby— The usage and gotchas of a couple of file locking mechanisms that discusses bits like advisory and partial file locking.

Prajjwal Singh

▶  Surviving Webpack with Ross Kaffenberger— If the introduction of Webpack into Rails 6 (via Webpacker) has caused confusion, maybe these tales of making the move will fill you with confidence.

Ruby Rogues Podcast podcast

How to Make Colors With Ruby and Bitwise Operations— We don’t see many posts about using Ruby with a Raspberry Pi and this one is particularly fun, nerdy, and colorful.

Valentino Stoll

Rails 6's delete_by and destroy_by Methods

Saeloun Blog

Rails, Webpacker, and Vue CLI Can Actually Play Nicely— This is more of a “rip it all out and then put it back a bit differently” approach to the problem, just so you know.

Andrew Hunter

🛠 Code and Tools

Humanize: A Library to Make Your Numbers More 'Fancy'— If by ‘fancy’ you mean turn into natural language versions, e.g. 15.humanize # => "fifteen" .. it supports English, Spanish, French, and 7 other languages out of the box.

Ryan Bigg

with_advisory_lock: Advisory Locking for ActiveRecord— Think of an advisory lock as a mutex that can span multiple hosts.

ClosureTree

eBook: Best Practices for Optimizing Postgres Query Performance

pganalyze sponsor

Piperator 1.0: Composable Pipelines for Enumerators— Inspired by both Elixir’s pipe operator and Node.js streams.

Ville Lautanala

Active Merchant: Shopify's Simple Payment Abstraction Library— A well-established, long-standing gem that continues to get frequent updates.

Shopify

Xcodeproj: Create and Modify Xcode Projects from Ruby— One for you macOS/iOS developers, this could help you script away boring management tasks or auto generate projects, etc.

CocoaPods

Ruby 2.7.0 Preview 2 Released

$
0
0

#473 — October 24, 2019

Read on the Web

Ruby Weekly

Ruby 2.7.0 Preview 2 Released— Progress towards a final Ruby 2.7 release on Christmas Day is going well! As a reminder, there are some big new bits in 2.7: ‘compaction’ GC (which defragments the memory space your programs are using), pattern matching, irb enhancements (including multi-line editing support), and quite a bit more. It’s a perfect time to get playing.

Yui Naruse

Fun with each_with_object and Other Enumerator Adventures— This really is fun and a demonstration that even if you’re an experienced Rubyist, there’s often another, cleaner way to achieve something. each_with_index is another one I find that’s worth using on occasion.

Zverok

The Easiest Way to Run Redis— Better monitoring, seamless scaling, durable and portable Redis hosting supporting all the latest features.

RedisGreen sponsor

The Annual Fukuoka Ruby Award Competition is Back— Every year, both Ruby’s creator, Matz, and a prefecture of Japan run a ‘Ruby competition’ with a prize of 1 million yen (about $9000) for Ruby-related projects built in the past year. Entries are due by December 11.

Ruby Blog

Ruby's Lazy Enumerators— In Ruby, you can make enumerators lazy so that they are only run when the data they provide is actually needed. I did a video about them several years ago if you want more depth.

Alkesh Ghorpade

Rails 6.0 New Framework Defaults: What They Do and How to Safely Uncomment Them— When you run rails app:update on a Rails 5.2 app, it creates a file with 9 new default configuration settings. Here’s what they do and how you should use them.

Dylan Reile

💻 Jobs

Software Developer - Ruby— Join our team and help to realize international cloud-native software projects based on Ruby on Rails.

anynines

Senior Rails Engineer, Product (Remote)— Stack: Ruby on Rails (5.2), Stimulus, Postgres & Heroku — We strive to keep our frameworks/libraries up to date. Perks: Remote team, competitive pay, meaningful company equity.

Fleetio

Have You Tried Vettery?— Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.

Vettery

📘 Articles & Tutorials

Please Don't Write 'Clever' Code“I came across this code the other day, the author was quite proud of it but I would reject this PR in a heartbeat..”

Jeremy Williams

Loading Additional Ruby Gems in Development— A way to temporarily bring other gems into your project without adding them to your primary Gemfile.

Philipe Fatio

eBook: Best Practices for Optimizing Postgres Query Performance— Learn how to get a 3x performance improvement on your Postgres database and 500x reduced data loaded from disk in this free pganalyze eBook.

pganalyze sponsor

How Ruby Can Surprise You— Some difficult ‘interview questions’ that Showmax asks Ruby candidates. (These sorts of questions can be controversial as they merely test obscure language feature knowledge, so take the interview part of this with a pinch of salt.)

Showmax Engineering

The One Who Created Elixir— An interview with José Valim, a Rubyist that created Elixir, where he discusses the problems and the process that launched Elixir.

Anne-Laure Civeyrac

Why to Use Active Support in Rails for Deprecation Messages— It’s essentially an ‘internal’ tool but you can use it too.

Andy Croll

The Tools Rails 6 Introduced for Action Cable Testing.— ..and the bare basics of using them.

Narendra Rajput

The Art of PostgreSQL: A Book to Learn How to Best Use SQL from Your Ruby App

The Art of PostgreSQL sponsor

🛠 Code and Tools

command_line: An Easier Way Execute Command Line Applications— Run a shell command, in a very Rubyish way, with access to standard in and out along with environment variables.

DragonRuby

Lowkiq: Ordered Background Jobs Processing— A sort of Sidekiq-a-like for a specific use case.

BIA Technologies, LLC

tapping_device: A Gem That Helps You Tracking Method Calls— Built on top of TracePoint.

Stan Lo

bundle-diff: Bundler Plugin for Showing Diffs of Bundled Gems Against Latest Versions

Tim Craft

Modulation 1.0: Explicit Dependency Management for Ruby

Sharon Rosner

🕰 ICYMI(Some older stuff that's worth checking out...)

This week's Ruby news

$
0
0

#474 — October 31st, 2019

Read on the Web

Ruby Weekly

HTTPX: A Ruby HTTP Library 'for Tomorrow'— httpx has a slew of features, the most interesting being HTTP/2 support and concurrent requests by default.

HoneyryderChuck

A Quick Speed Update on Ruby 2.7 Preview 2— Last week we announced the release of Ruby 2.7 preview 2 (final due on Christmas Day as usual) and Ruby benchmarker extraordinaire Noah has already put it through its paces.. don’t get too excited, it’s barely faster than 2.6 so far.

Noah Gibbs

eBook: Best Practices for Optimizing Postgres Query Performance— Learn how to get a 3x performance improvement on your Postgres database and 500x reduced data loaded from disk in this free pganalyze eBook.

pganalyze sponsor

JRuby 9.2.9.0 Released— The popular JVM-based Ruby implementation takes a few more baby steps forward with the complete Ruby 2.5.7-level standard library, RubyGems 2.7.10, thread safety improvements, and better Java module support.

JRuby Core Team

Taming Large Rails Applications with Private ActiveRecord Models— The biggest gain here is a ‘privacy by default’ approach to models (and their underlying data) but there are peripheral benefits around simpler testing, among other things.

Kelly Sutton

Managing PostgreSQL's Partitioned Tables with Rubypg_partition_manager is a new gem for maintaining partitioned tables that need to be created and dropped over time as you add and expire time-based data in your app.

Benjamin Curtis

💻 Jobs

Senior Web Developer at Dr. Bill— Dr. Bill helps Canadian doctors save time by streamlining their billing. Help lead our team into the next phase of growth.

Dr.Bill

Have You Tried Vettery?— Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.

Vettery

📘 Articles & Tutorials

Streaming Large ZIP Files in Rails— A thorough article that is download framework agnostic. I especially enjoyed the content around HTTP headers and how they affect the browser’s behavior.

Piotr Murach

Using Bind Parameters in Active Record for Security and Performance— Arel makes it possible to formulate such complex queries now that writing your own SQL is rarely necessary, but if you do..

Rohit Kumar

WebSockets: A Deep Dive into the Underlying Protocol of Action Cable— Learn about the nitty gritty technical details and limitations of WebSockets when building apps with Action Cable.

Ably sponsor

Improving Performance with Flame Graphs— This post explains a quick and easy set up for Rails alongside an explanation of how to read a flamegraph to find opportunities for optimization.

Howard Wilson

Ruby 2.7 Adds inherit As An Optional Argument to Module#autoload?

Romil Mehta

Go Is The New Ruby(?)— This is not so much a comparison to Ruby as it is to Rust, citing the happiness of a Ruby developer is analog to their Go counterpart.

Frank Denis

9 Industries Where Flagship Companies Choose Ruby on Rails— The list of industries is impressive, as are the companies within. Another arrow in the “Rails ain’t dead” quiver.

Rubyroid Labs

🛤 Small Things Rails 6 Added

The folks at BigBinary write frequent blog posts covering the non-headline features of Rails 6 (which came out two months ago now) and while we include them from time to time, they have so many that we're doing a round-up here 😄

🛠 Code and Tools

RubyCritic 4.2.0: Now With SimpleCov SupportRubyCritic is a tool for producing reports about your Ruby code’s quality. It uses other tools like Reek, Flay, Flog, and now SimpleCov to produce reports about things like complexity, code smells, and test coverage.

Fast Ruby Blog

full_request_logger: Make Full Request Logs Accessible Via Web UI— Writes Rails logs to an auto-expiring Redis key. “This is ideal for when you’re testing a feature in the wild with production-levels of data, which may reveal performance or other issues that you didn’t catch in development.”

Basecamp

Monitoring and Distributed Tracing for Ruby Apps. Try Datadog Free

Datadog APM sponsor

Slate: Beautiful Static Documentation for Your API— Built on top of Middleman, Slate is being used by an impressive list of companies, so it’s probably good for you, too.

Slate

Invisible: Override Methods While Maintaining Their Original Visibility— So, you can’t accidentally make a private method public by overriding it. Neat.

Chris Salzberg

Hashie 4.0: Classes and Mixins That Make Hashes More Powerful— Bring things like coercion, access methods, indifferent access, and more to hashes quickly. I’ve seen this used as a dependency in many libraries.

INTRIDEA Inc.

An interview with GitHub's Eileen Uchitelle

$
0
0

#475 — November 7th, 2019

Read on the Web

💬 This week we've got another interview for you — check out the bottom of the issue.

Ruby Weekly

How Ruby Really Uses Memory: On the Web and Beyond— Ruby’s memory allocation algorithm is not quite what you might think. As you add threads, considering the per-thread and across-all-threads impacts are necessary to get a firm picture of what is happening.

Richard Schneeman

Try the Fastest CI/CD Solution for Free— Faster CI/CD means greater productivity for your team and a better experience for your users. Automate your CI/CD pipeline with Semaphore to release 2x faster than with other platforms.

Semaphore 2.0 sponsor

Prism: Build Frontend Web Apps with Ruby and WebAssembly— Designed to feel like virtual DOM-based frameworks, like React, it uses mruby (the lightweight Ruby interpreter) and Emscripten to compile Ruby to WASM ready for the browser.

Prism

The Hidden Cost of The Ruby 2.7 Dot-Colon Method Reference Usage— It’s no secret that some of Ruby’s syntactic sugar comes with a payment to the performance piper. Here’s another fee you might be paying (though the example given is a nice demonstration of using .:, regardless.)

Maciej Mensfeld

Static Typing in Ruby with a Side of Sorbet— A look at the results of adding Sorbet (a type checker for Ruby) to an existing Rails app to see if the juice is worth the squeeze. Their findings? A good experience with small wins but a bright future.

Heroku

Rails 6.0.1 Released— Minor fixes abound.

Official Rails Blog

💻 Jobs

Agave.com Is Hiring a CTO (Remote or SF Bay Area)— Help us build the modern hiring platform. World-class technical team with a top 250 Rails contributor. Competitive compensation.

Agave

Cloud Platform Engineer - Kubernetes, Cloud Foundry, BOSH— Accelerate your experience and build products that help developers to ship software faster.

anynines

Find a Job Through Vettery— Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.

Vettery

📘 Articles & Tutorials

Persisted Queries in GraphQL: Slim Down Apollo Requests to Your Ruby Application— The idea behind persisted queries is reducing request size by only sending a query ID that is stored on the backend, which is then retrieved and executed.

Evil Martians

Writing A Program That Writes Itself— Learn about quines and how they make you go “hmmmm…”

Ju Liu

Announcing Square’s New YouTube Channel with Developer Shows— With Square’s new Ruby SDK gem you can run a business, take payments, or be a backend for a kiosk or mobile payment app.

Square sponsor

▶  Plugging In AnyCable— Rails’ own ActionCable can handle quite a bit of traffic, but AnyCable will allow you to scale further.

Drifting Ruby

A Look at Changes Made to Active Storage in Rails 6

Saeloun Blog

Use GitHub Actions for Rails CI with Postgres

Andy Croll

Getting Started with Svelte and Rails 6— If you are that person that likes to jump on the newer JavaScript frameworks, here you go.

Nikola Đuza

▶  Discussing How Speed is a Feature at Shopify— A relatively brief 15 minute podcast episode with Gannon McGibbon, a developer at Shopify, talking about how he improves the ‘codebase health’ and performance of Shopify’s famously monolithic Rails app.

The Ruby on Rails Podcast podcast

eBook: Best Practices for Optimizing Postgres Query Performance

pganalyze sponsor

🛠 Code and Tools

Tabulo: A Terminal Table Generator with a DRY, Column-Based API— I could see using this in a live-coding presentation, among other scenarios.

Matt Harvey

Skunk: Combining Code Quality and Coverage to Calculate a 'Stink' Score— Skunk aggregates scores from various code quality and coverage gems. Use it to assess a new code base or keep your code smelling better. If this reminds you of RubyCritic, which we linked last week, Skunk is built upon it!

Fast Ruby

rspec-tap-formatters: TAP Formatters for RSpec 3— The Test Anything Protocol (TAP) is a “simple text-based interface between testing modules a test harness” with its origin in Perl. Rack for Testing, anyone?

Abhimanyu Singh

How to Find the Unused Routes of a Large Rails App— No gem required. (By ‘unused’, it means either unwritten/unimplemented or which has no view file.)

Rishi Pithadiya

💬 A Q&A with…
Eileen Uchitelle
Engineer at GitHub and Rails Core Team Member

Eileen Uchitelle is a Staff Software Engineer on the Ruby Architecture Team at GitHub and a member of the Rails Core team. She's an avid contributor to open source focusing on Rails and its dependencies. Eileen is passionate about scalability, performance, and making open source communities more sustainable and welcoming.

What is the most exciting thing you've worked on as part of the Rails core team?

Implementing multiple database support. It's a hard project because there's a lot of stakeholders who want to see the feature implemented — Active Record is one of the original gems included in Rails so there's a lot of legacy code in there, and a lot of input from the community to consider.

I've been working on this for more than a year and decided to implement it in parts starting with the public facing API and working backwards. This is an interesting way to work on legacy code because often we try to fix the underlying issues first. But implementing the features starting with the rake tasks, then the connection API, then the underlying legacy code made sense in this case because it exposed the sharp edge cases that were always there but hiding away.

You've worked on some pretty solid teams (Basecamp, GitHub) What, in your opinion, is the secret to a "good" software organization?

The secret is understanding the difference between a technical problem and an organizational/cultural problem. Technology cannot solve underlying organizational problems and reorganizing teams can't solve technology problems.

Do you think Rails will be used at GitHub for the foreseeable future?

You can pry Rails from my cold, dead hands. In all seriousness, it rarely makes sense to rebuild a functioning, working application. It makes more sense to look at your application and ask "what doesn't belong here?" and move that to a service. In some cases functionality is being moved out of the Rails app because it makes sense to do that. For the majority of the application you interact with, it will be Rails for the foreseeable future because there's no good reason for it to be rebuilt in something else.

Can you tell us how to say your last name? 😁

Uchitelle was originally Uchitel, which I've been told is the Russian word for "teacher". The name was changed by adding an "le" and the pronunciation is now "You sha tell".

You can read some of Eileen's posts on the GitHub blog.


Ruby roots, Stripe's approach to testing, and the 'ambiguous' operator

$
0
0

#476 — November 14, 2019

Read on the Web

Ruby Weekly

Ruby's Roots and Matz's Leadership— Noah summarizes a recent talk Ruby’s creator, Matz, gave about the history of Ruby, where he got various language feature ideas from, and what he thinks Ruby’s greatest invention was (psst.. blocks!)

Noah Gibbs

The Delegation Challenge of Ruby 2.7— This is a somewhat odd situation where a change to arguments changes delegation so things are handled differently in Ruby 2.6, 2.7, and 3.0. It’s a tough nut to crack and a great example of language design related edge cases.

Benoit Daloze

Happy Rails Deployments— Cloud 66 for Rails is like your in-house DevOps team. It deploys Rails apps 2 million times a day for thousands of developers around the world and gets better every time. Use RubyWeekly code to get $50 free credits.

Cloud 66 sponsor

▶  Discussing Testing at Scale at Stripe— Nelson Elhage spent 7 years at Stripe spearheading developer productivity initiatives. In this 48 minute interview, he shares what he learnt and digs into why Stripe created the Sorbet Ruby type checker.

The Accidental Engineer Podcast podcast

Tomo: A Friendly CLI for Deploying Rails Apps— There’s a short tutorial for deploying Rails, and the documentation is thorough. Tomo is opinionated but extensible with a simple (not Rake dependent) plugin system.

Matt Brictson

💻 Jobs

Agave.com is hiring a CTO (Remote or SF Bay Area)— Help us build the modern hiring platform. World-class technical team with a top 250 Rails contributor. Competitive compensation.

Agave

What Will 🌆 City Life 🌆 Be Like in 2030? Want to Have a Say?— Join the coliving revolution in Paris as our tech lead - code, mentor a growing team, and change people's lives for the better.

Colonies

Find a Job Through Vettery— Make a profile, name your salary, and connect with hiring managers from top employers. Vettery is completely free for job seekers.

Vettery

📘 Articles & Tutorials

Solving Puzzles with the 'Ambiguous' Operatoramb is an ‘operator’ that “given a set of constraints and options to choose from, amb returns options satisfied by those constraints.” Some cute examples here.

Nikita Misharin

▶  How to Test Active Job Background Jobs— Active Job provides helper methods to make testing easy.

Go Rails

Handling Attachments in Action Text in Rails 6— The second part of a two-part series on Action Text. This part focuses on blocking files by type, how files are rendered, and previewing PDFs.

Saeloun Blog

Build Video for Your Ruby App in Just Two API Calls— Easily build beautiful video experiences into your Ruby app. Create a free Mux account. No credit card required.

Mux sponsor

Go Celebrity Spotting with Twilio, WhatsApp, AWS Rekognition and Ruby— Let’s play ‘tie together as many services as possible’ :-) ..by building an app that lets you send an image to WhatsApp, analyze the image with AWS Rekognition and respond to say whether there are any celebrities in the picture.

Phil Nash (Twilio)

Is It Time to Replace Rake?— You can guess where the author stands, but it’s not quite as simple as that. Maybe we replace part of what Rake does, returning Rake to its initial objective.

Daniel Azuma

How to Write An Intercom Messenger App with RailsIntercom is a business/customer-service focused messaging system – naturally, it has an API you can use.

Kirill Shirinkin

Feedback About Writing A Technical (Ruby) Book— One author’s experience writing an “open source” book. The book in question is APIs on Rails, but this is more about lessons learned than APIs.

Alexandre Rousseau

Downloading Large Heroku Postgres Backups

Justin Searls

🛠 Code and Tools

Strings::Case: Convert Strings Between Different Cases— For when you want a little more than upcase, downcase and capitalize. This library supports camel case, const case, Pascale case, snake case, and more.

Piotr Murach

Reek: A High Level 'Code Smell' Detector for Ruby Code— It’ll detect things like vague variable names, unused parameters, overuse of constants and methods, and cohesion problems.

Timo Rößner

Invisible Captcha: Unobtrusive Spam Protection for Rails Forms— Your mileage may vary as ‘honeypot’ approaches can work well at first but are easily overcome by a determined abuser. It’s not a bad idea, though.

Marc Anguera Insa

Automate and Standardize Code Reviews for Ruby and 27 Other Languages

Codacy sponsor

Clearance 2.0: Email and Password-Based Rails Authentication

thoughtbot, inc.

activestorage-resumable: Resumable Support for ActiveStorage— Currently only supports Google Cloud Platform, but every great journey starts with a single step, etc.

fnix

Chartkick: Beautiful JavaScript Charts in One Line of Ruby— See some examples, along with code, here. Works fine with Rails 6 and Webpacker, etc.

Andrew Kane

10 new things in Active Record

$
0
0

#477 — November 21, 2019

Read on the Web

Ruby Weekly

Ruby Next: A Way to Transpile Modern Ruby Code to Run on Ruby 2.5 or mruby?— If you’ve used Babel in the JavaScript world, the concept here may be familiar to you. Ruby Next is designed to let us code using cutting edge (or even experimental) Ruby features and then transpile that code to run on Ruby 2.5 or mruby, say. It's still early days, but interesting. Here’s a slidedeck with more info.

Vladimir Dementyev

Isolating Rails Engines with RuboCopEngines provide a convenient way to break larger apps into a loosely coupled collection of smaller ones. Here’s how Flexport uses RuboCop to help programmatically enforce the isolation of their engines.

Max Heinritz

Production-Grade Redis— Better monitoring, seamless scaling, durable and portable Redis hosting supporting all the latest features.

RedisGreen sponsor

10 New Things in Active Record (in Rails 6)— A neat roundup that covers things like rails db:prepare, database switching, #annotate, #touch_all and implicit ordering by a specific column (which is nicer than using a default scope).

Jason Dinsmore

▶  The Raw RubyConf 2019 Video Streams— RubyConf took place in Nashville earlier this week and while we’re waiting for the videos to be separated and shared properly, you can already see all three days of full streams on YouTube. We’ve linked here to Matz’s opening keynote, but will link to more videos individually in future issues.

RubyConf 2019

Rails 6: The Missing Developer Setup Guide— Going beyond the Rails Guides, Vincent sets up VS Code, Webpacker, Growl, reproducible environments, Heroku, and more. Whew. One for either beginners or if you’ve simply not started a Rails app from scratch for a while.

Vincent Voyer

💻 Jobs

Software Developer - Ruby— Join our team and help to realize international cloud-native software projects based on Ruby on Rails.

anynines

Senior Rails Engineer (Remote)— Ruby on Rails (5.2), Stimulus, Postgres & Heroku — We strive to keep our frameworks/libraries up to date. Perks: Remote team, competitive pay, meaningful company equity.

Fleetio

Find a Job Through Vettery— Make a profile, name your salary, and connect with hiring managers from top employers. Vettery is completely free for job seekers.

Vettery

A Picture of the 'Post Your Jobs Here' Notice Board at Ruby Conf 2019— It's hard to make out, but don't feel like you missed out if you couldn't attend RubyConf. Zoom in far enough and you may find the job of your dreams 😄

📘 Articles & Tutorials

How to Update Counter Caches in Your Rails App Without Active Record Callbacks— A Postgres-focused approach to keeping your counter caches in sync using nothing but database triggers.

Dmitry Tsepelev

Dealing with Similarity in Postgres and Rails using Trigramspg_trgm is a core Postgres module that provides functions for determining the similarity of strings based on trigram matching.

Leigh Halliday

Are You Running Rails 6 in Production? Great, Follow These Steps to Stay Up to Date— FastRuby.io has upgraded hundreds of applications. Implement their tips to never fall behind again.

FastRuby.io sponsor

▶  Testing Times and Dates with Rails— Rails provides several helper methods for testing times and dates in your apps. Freeze time and time travel like a superhero 😂

GoRails

How I Approach Test Coverage Metrics“Test coverage is a useful metric but only in a very approximate and limited sort of way.” Comparing 90% coverage to 100% coverage really isn’t a great use of your time.

Jason Swett

Working with Capistrano: Tasks, Roles, and Variables

Piotr Murach

Write One Test— Much, much better than none..

Andy Croll

🛠 Code and Tools

Browser: A Browser Detection Library— A handy API for browser detection from within Ruby. Pass in a user agent string and query it in various ways (e.g. browser.webkit? or browser.device.name). Includes ActionController integration, as well as optional Rack middleware for agent-based redirections.

Nando Vieira

A Tetris Game Powered by Ruby2D— A neat little example of creating a simple game in Ruby especially as it’s under 200 lines of code (all in one file).

Victor Maslov

Chatwoot: Simple, Open Source Live Chat Software— Bills itself as a Rails-based open source alternative to a service like Intercom.

Chatwoot

JetBrains RubyMine: Cross-Platform IDE for Ruby & Rails Development

JetBrains sponsor

Shrine 3.1: The File Attachment Toolkit for Ruby Webapps

Shrine

Ruby Trello API: An Implementation of the Trello API for Ruby— For users of the popular Trello list-management webapp.

Jeremy Tregunna

Ruby 2.7.0 Preview 3 Released

$
0
0

#478 — November 28, 2019

Read on the Web

Ruby Weekly

Ruby 2.7.0 Preview 3 Released— We’re now less than a month from the final release of Ruby 2.7 (which, fingers crossed, should be on Christmas Day, as is the tradition). If you want to get playing with pattern matching, the improved irb, and other new features though, the current preview release is pretty stable.

Yui Naruse

The .: Syntax For Referencing Methods Is Cancelled— One new feature that was expected to appear in Ruby 2.7 (and which was only just dropped in preview 3) was .: as a short hand for referencing methods. This thread covers the reasons why it’s been dropped for now – not everyone is happy with the outcome.

ruby-lang.org

Continuous Deployment Without Downtime— How do you ensure that your team can achieve zero-downtime deployments?

CircleCI sponsor

Using UUIDs in Rails 6 with Postgres and ActiveRecord— UUIDs (which look like long strings of hexadecimal numbers) are an alternative primary key type for databases with pros and cons over standard, ordered integer-based keys. Rails 6 can work with UUID keys pretty well and here’s a quick tour.

Paweł Urbanek

Ruby 2.7's Enumerator#produceproduce provides a way to generate sequences - think inject but without a single end result, and instead a sequence of results built around each step.

Prajakta Tambe

▶  RubyConf 2019 Opening Keynote: A Ruby Progress Report— The RubyConf 2019 videos are slowly beginning to come out one by one, but why not start with Matz’s keynote where he reflects on his goals for the language, how things are progressing and some of the things not making it into 2.7.

Yukihiro Matzumoto

💻 Jobs

Senior Rails Engineer (Remote)— Ruby on Rails (5.2), Stimulus, Postgres & Heroku — We strive to keep our frameworks/libraries up to date. Perks: Remote team, competitive pay, meaningful company equity.

Fleetio

Find a Job Through Vettery— Make a profile, name your salary, and connect with hiring managers from top employers. Vettery is completely free for job seekers.

Vettery

📘 Articles & Tutorials

Ruby Refinements and the Sorbet Type Checker— From a team actually using Sorbet and refinements! As you might guess, there are issues, but this story has a happy ending.

Paul Trippett

Configurable Ruby Modules: The Module Builder Pattern— This pattern enables the ability to tailor a module to the context of the including class, enabling code reuse and proper specificity.

Michael Kohl

Some Surprising Behaviour of Empty Arrays— Did you know that [].all? { |n| n.even? } will return true? If not, step this way..

Tim Ash

Troubleshoot Ruby App Errors and Latency with Datadog APM— Trace requests across service boundaries and optimize bottlenecks by drilling into individual traces end-to-end.

Datadog APM sponsor

Bulk Inserting Records in Rails 6— If you want to load in a lot of data in one go, Rails 6 introduces some extra methods you’ll find useful: insert_all, insert_all!, upsert_all (upsert_all lets you basically merge a bunch of records into a database, updating existing entries as it goes).

Alkesh Ghorpade

Faking External Services in Tests with Adapters— A quick, practical example of faking external services for testing purposes.

German Velasco

Track Email Statuses in Rails with SendGrid— One for SendGrid users only (we use them to send this newsletter!)

Phil Nash

Using Bootstrap with Rails Webpacker— A tutorial for integrating Bootstrap 4 with Rails and Webpacker 4.

Ross Kaffenberger

▶  Principles of Awesome APIs and How to Build Them

Keavy McMinn

🛠 Code and Tools

Artichoke: A Ruby Made with Rust— We’ve linked to articles about Artichoke (which you can play with at that link) before, but here’s a presentation from RubyConf.

artichoke project

Rails 5.2.4 Released— Just a minor maintenance release. 6.0.1 remains the latest product release of Rails, though 6.0.2rc1 is also out with 6.0.2 final due next week.

Official Rails Blog

Put an End to Manual Code Reviews: Automate from Your Workflow

Codacy sponsor

Carmen: A Repository of Geographic Regions for Ruby— A quick way to get data and convenience methods for countries and their subregions/states/provinces.

Carmen

ezmetrics: A Simple Tool for Capturing and Displaying Rails Metrics— Captures and stores (in Redis) values for duration, views, queries, etc. for the duration specified.

Nicolae Rotaru

Some more of what's new in Ruby 2.7

$
0
0

#479 — December 5, 2019

Read on the Web

Ruby Weekly

Ruby 2.7 Adds Shorthand Syntax for Argument Forwarding— In short, you can use the syntax ... in parameter or argument lists to basically ‘pass through’ (or forward) arguments from one method to another. “It acts similar to calling super without any arguments.”

Narendra Rajput

What’s New in Ruby 2.7?— There’s a lot coming in 2.7 (due on Christmas Day), including controversial features like pattern matching, numbered parameters, and keyword argument changes. Also, this will be the last point release before 3.0 a year from now.

Guy Maliar

Powerful CI/CD Pipelines. Pay Only for What You Use— Built for developer productivity, Semaphore lets you model your CI/CD workflow with fully-customizable pipelines. With our pricing model, you pay for only what you use. Sign up for free with GitHub and give it a try today.

Semaphore sponsor

▶  JRuby: From Zero to Scale— Two of the creators of the JRuby project (the JVM-based Ruby implementation that’s now 18 years old) talk about its history, how it compares to CRuby/MRI, how to scale it, and more.

Charles Oliver Nutter and Thomas E Enebo

Main Takeaways From Matz's RubyConf 2019 Keynote— We linked to the keynote video last week, but appreciate not everyone enjoys watching videos.. here’s some written impressions instead.

Snir David

Ruby Conferences ‘n’ Camps in 2020 - What’s Upcoming?— A list of 14 events (so far) coming up in 2020 for Rubyists.

Planet Ruby

💻 Jobs

Software Engineer (San Francisco)— Help us fix technical hiring. We're growing our team and are looking for full-stack, frontend, ML and dev-ops engineers.

TRIPLEBYTE

Senior Rails Engineer (Remote)— Ruby on Rails (5.2), Stimulus, Postgres & Heroku — We strive to keep our frameworks/libraries up to date. Perks: Remote team, competitive pay, meaningful company equity.

Fleetio

Find a Job Through Vettery— Make a profile, name your salary, and connect with hiring managers from top employers. Vettery is completely free for job seekers.

Vettery

📘 Articles & Tutorials

Using Rubyfmt with AtomRubyfmt is inspired by Go’s gofmt formatting tool and enforces styling choices, such as indentation, etc.

Nick Schwaderer

Ruby Literals You May Not Know— Be rational and read this (not really) complex post to improve your character by a endless percent.

Michael Kohl

From ActiveRecord Callbacks to Publish/Subscribe Pattern and Event-driven Design— Move away from callbacks with the Wisper gem as the first step in your journey to better distributed application design.

Karol Galanciak

How to Build Realtime Presence Function in Ruby— Tutorial demonstrating the Ruby realtime library in action, shows how to build presence function with EventMachine.

Ably sponsor

▶  From jQuery to ES6— Yes, this screencast covers JavaScript but it’s aimed at Rubyists or very casual JavaScript developers who might be intrigued how things have changed since the jQuery era.

Drifting Ruby

Overpacking.. A Common Webpacker Mistake— If you’re using Webpacker and your asset compilation is taking a long time, maybe you’re an overpacker?

Ross Kaffenberger

A Brief Interview with Eileen Uchitelle— We included this in the newsletter several weeks ago, but if you missed it, here’s a few questions with Eileen Uchitelle, a Rails core member.

Glenn Goodrich

▶  Containerizing Local Development... Is It Worth it?

Tony Drake

raise Exception.new or raise Exception? They're The Same

Andrzej Krzywda

🛠 Code and Tools

RubyMine 2019.3 Released— RubyMine is a commercial product but if you want a full-scale, traditional IDE, it’s a reasonable option and only continues to get more features.

JetBrains

Strings::Inflection: Convert Between Singular and Plural Forms of English Nouns— It can also inflect many nouns to verbs.

Piotr Murach

ImageProcessing: High-Level Image Processing Wrapper for Libvips and ImageMagick“The goal of this project is to have a single gem that contains all the helper methods needed to resize and process images.”

Janko Marohnić

Statesman: A State Machine Library— Takes a different approach to most other state machine libraries by having you define state behavior in separate classes that are then instantiated from within your other classes.

GoCardless

eBook: Best Practices for Optimizing Postgres Query Performance

pganalyze sponsor

Grape: An Opinionated Framework for Creating REST-like APIs— It’s been around for years but continues to get frequent updates (v1.2.5 came out just this week).

Michael Bleigh

ProgressBar: A Progress Bar for Your Terminal Apps

Paul Sadauskas

Rack::Cors: Rack Middleware for Handling Cross-Origin Resource Sharing (CORS)— Version 1.1.0 is out.

Calvin Yu

excon 0.70.0: A Fast, Simple HTTP 1.1 Client for Ruby

excon

Fixing real world Ruby performance and memory problems

$
0
0

#480 — December 12, 2019

Read on the Web

Ruby Weekly

▶  Fixing Real World Ruby Performance and Memory Problems— A dense 30 minute RubyConf talk that digs into two real world stories of resolving performance problems and memory leaks using rbtrace, ruby-prof, stackprof, and other tools and techniques. You will learn things here!

Frederick Cheung

Ruby Concurrency Progress Report— The results of a discussion with Matz and Koichi about concurrency in Ruby 3. I am not sure any of it is binding (yet), but it’s interesting to hear which topics and approaches made the list.

Samuel Williams

The Easiest Way to Run Redis— Better monitoring, seamless scaling, durable and portable Redis hosting supporting all the latest features.

RedisGreen sponsor

JIT and Ruby's MJIT— An excellent explanation of what JIT is, what Ruby’s MJIT is, where it helps, where it hurts, and how you can use it.

Noah Gibbs

Ruby, Where Do We Go Now?— The author of RuboCop goes through recent additions, rejections, and reversions of features in Ruby in what is a bit rantish but comes from a well-informed place.

Bozhidar Batsov

An Epic Collection of Ruby One Liners— This was a popular item last year, but I wanted to feature it again as recently I’ve really been enjoying using Ruby as a ‘swiss army knife’ for all sorts of tasks, and these examples are helpful.

Sundeep Agarwal

💻 Jobs

Senior Software Developer (UK, Hampshire, On-Site)— Write great code for a product you can feel good about every day. Join our small team, in an amazing country manor house office.

Rocksteady Music School

Backend Engineer (Stockholm)— Join an interactive presentation service, Stockholm based, product-first, gender-equal, inclusive and profitable startup with customers from over 150 countries

Mentimeter

Find a Job Through Vettery— Make a profile, name your salary, and connect with hiring managers from top employers. Vettery is completely free for job seekers.

Vettery

📘 Articles & Tutorials

Decimating Deprecated Finders— If you’ve been sitting on upgrades of your Rails 5 (and earlier) apps and you have a bunch of old-style finders, then maybe Synvert can help with all its parser-y goodness.

thoughtbot

Nested API Parameter Validation in Rails with ActiveModel::Validations— This is much easier to understand than some previous approaches (PRMD, pliny, etc.) especially if your use case is simple.

Kalina Tech

Automate and Standardize Ruby Code Reviews— Set and enforce standards on coverage, duplication, complexity, style issues and security directly from your Git workflow.

Codacy sponsor

Working Around ActiveRecord Callbacks— A pragmatic strategy for getting things done when excessive ActiveRecord callbacks get in your way.

Jared Norman

Rails 6 Adds Ability to Block Writes to A Database— Seems like one of those features that sounds useful but should be handled with much care.

Saeloun Blog

The Case for Stabby Lambda Notation— The conciseness and pictorial nature of -> encourage the use of lambdas, and in my opinion, that is a Good Thing.

Keith Bennett

How to Set Up an AWS RDS Database for Rails— The latest in a series of posts about deploying a Rails app on AWS.

Jason Swett

▶  Discussing Solidus with Alessandro DesantisSolidus is an open source e-commerce system built with Rails.

Ruby Rogues Podcast podcast

Behind The Scenes of GitHub's Vulnerability Alerts— Learn more about what’s going on behind the scenes with GitHub’s vulnerability alerts.

Justin Hutchings

🛠 Code and Tools

Win32::Screenshot: Capture Screenshots on Windows from Ruby— It uses FFI to directly call the relevant functions in the Windows GDI system.

Jarmo Pertman

Godmin 2.0: An Admin Framework for Rails 4— Use this to build dedicated admin sections for apps or for stand alone admin apps such as internal tools. Basic demo here.

Varvet

The Art of PostgreSQL: A Book to Learn How to Best Use SQL from Your Ruby App

The Art of PostgreSQL sponsor

Torch-rb: Deep Learning for Ruby, Powered by LibTorch— LibTorch is a machine learning framework.

Andrew Kane

rack-mini-profiler: Profiler for Your Rack Apps in Dev or Production

Sam Saffron et al.

Opal 1.0.1: The Ruby to JavaScript Compiler— It’s only a patch level release but we haven’t linked Opal for a while. (Psst.. I’d really love to see some articles about using Opal in production.)

Elia Schito

Snabberb: A Simple Component View Framework for Opal— If you want to create reactive views for the front-end.. but in Ruby!

Toby Mao

Viewing all 465 articles
Browse latest View live