The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Ruby instance_eval
Adding methods to an instance “on-the-fly” is a pretty common pattern in Ruby (activerecord, activesupport, etc..). [more inside]
Better sessions with JWT
Have you ever had issues building an authentication microservice or an API for your SPA using JWT? If so then today is your lucky day! [more inside]
Export your Rails performance metrics with scout_dogstatsd
Want your Rails performance KPIs (response time, throughput, error rate, time-in-queue, etc) in your DogStatsD-compatible metric system with almost zero effort? Try the scout_dogstatsd gem. scout_dogstatsd automatically instruments your web + background jobs, sending metrics to systems that support the DogStatsD protocol (like DataDog).
Microservices for Startups: An Interview with Chris McFadden of SparkPost
SparkPost’s VP of Engineering discusses how microservices have helped improve workflow and deployment at this leading email infrastructure provider.
The Ruby on Rails Maintenance Policy has been updated !
The security patches are no longer applied to the Rails 5.0.Z series.. see more
Explicit contracts for Rails - HTTP API RSpec usecase
in this article we will look at how to write tests when our application needs to make calls to 3rd party API using Test Contracts. Unlike Mocks, Test Contracts offers “fixture” like consistency across app while being easier to maintain than VCR gem “cassettes” [more inside]
tty-config - Ruby apps configuration data management
I’ve written tty-config to help with managing configuration options in Ruby apps, especially CLIs. I needed a simple api that will easily define, get and merge keys of arbitrary depth. It supports reading and writing of configuration options in YAML, JSON & TOML formats. No magic DSLs and converting keys into method calls. Pure and simple data lookups.
Ruby Multithreading: Queues, Consumers & Producers
In this video you will learn how to use the built-in queue class to implement a thread-safe consumer & producer model. https://www.youtube.com/watch?v=x7NYf9xughk
Deploy your Rails app faster with Mina, Phusion Passenger, Ngnix and MySQL on Ubuntu
Deploy your Rails application seamlessly using Mina - a faster deployment tool, Passenger, and Nginx. [more inside]
Polish Rails migrations like a boss
Wrote an article about Rails migrations work process: https://railsguides.net/polish-rails-migrations/
Microservices for Startups: An Interview with Steven Czerwinski of Scalyr
Steven Czerwinski of Scalyr discusses how his experiences at Google colored his approach to microservices at Scalyr and how his team has successfully used microservices for their scalable log monitoring and analysis SaaS product.
WordpRSS - a simple gem to help with the RSS aggregation app creation
Have you ever thought about building an RSS aggregator app with Rails? If yes then I have some goods news for you. I created WordpRSS – a simple Ruby gem that will help you to pull the data from any WordPress RSS channel. READ MORE
Ruby Bitwise Operators
An operator is bitwise when instead of treating integers as whole numbers, it treats them as a sequence of bits. [more inside]
Turbolinks, Stimulus, and React living in harmony
I recently started porting our React SPA back to Rails where it made sense and found a nice way to use Turbolinks, Stimulus, and React together along the way. [more inside]
Full text searching Linux man pages with Elasticsearch
A post about playing around with the elasticsearch gem to index Linux man pages for full text searching. Ruby script on GitHub.
class_eval vs module_eval
Adding methods or attributes to a class/module “on-the-fly” is a pretty common pattern in Ruby (activerecord, activesupport, rake, rack, etc..). [more inside]
Ruby 2.5 supports measuring branch and method coverages
Ruby 2.5 has added many features to know precisely what line of code has been executed and how many times. This blog discusses all that and much more. [more inside]
Profiling Ruby’s Memory Allocation with TCmalloc
Everytime Ruby needs to request memory from the operating system it has to call the malloc function… https://www.rubyguides.com/2018/04/ruby-tcmalloc-profiling/
Microservices for Startups: An Interview with Oleksiy Kovyrin of Swiftype
Oleksiy Kovyrin of Swiftype offers great insights into thoughtfully extracting microservices from a monolith and the costs and benefits of doing so. Swiftype is the leading platform for Site Search and Enterprise Search that powers search for thousands of enterprises and websites.
Easily transform hash keys in API data
The hash_key_transformer gem makes it easy to deeply transform a JSON-like data structure from one style of key to another (from camelCase to snake_case, for example). Useful when providing JSON data to a JavaScript client or receiving JSON data in a Rails controller action. See more
Lies, Damn Lies, and the State of Testing in Rails
How much do Rails developers really write tests? Take a data-driven look into test coverage and CI speed of commercial Rails apps running on Semaphore. Read the report →
Hanami v1.2.0
HTTP/2 Early Hints, Unobtrusive JavaScript (UJS), new error page based on better_errors, CLI hooks, project middleware, enhanced support for plugins, custom repositories commands, coloured logging, bug fixes. Starting from tomorrow we’ll team with ROM and DRY teams to build Hanami 2, ROM 5, and DRY 1. http://hanamirb.org/blog/2018/04/11/announcing-hanami-120.html
The yield keyword
The yield keyword — in association with a block — allows to pass a set of additional instructions during a method invocation.. see more