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.
Profiling Ruby’s Memory Allocation with TCmalloc
Everytime Ruby needs to request memory from the operating system it has to call the malloc function…
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.
Qo - Pattern Matching and Fluent Querying in Ruby
Qo is a gem to emulate pattern matching and ActiveRecord-like querying in Ruby [more inside]
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.
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
Cache your assets with S3 for your Elastic Beanstalk
A few tips to improve the speed of deploying new instances of your rails application in an AWS elasticbeanstalk environment
Debug with Metaprogramming in Ruby
Have you ever been unable to reproduce a bug in development? Here are some ways to get insights from your staging console.
Ruby-Devscoop: Issue #7
Feel free to browse the issue #7 of the Ruby-Devscoop Newsletter here
The Missing Ruby Reference
Here is modern-looking, actual, comprehensive Ruby reference is compiled from Ruby source and other sources. And a blog post about it.
How to Migrate a Ruby on Rails App from Heroku to Dokku
Dokku is dev ops for dummies and a cheaper alternative to Heroku. Recently I’ve migrated a couple of my projects to it. In this blog post, I will describe how to setup and migrate a Rails app to Dokku with PostgreSQL, Sidekiq, Redis and Let’s Encrypt or Cloudflare for free SSL. [more inside]
Um pouco sobre IRB (A little bit about IRB)
Oi, como vai? O post de hoje fala um pouco sobre o IRB, vai lá dar uma olhadinha! https://merubygirl.wordpress.com/2018/04/06/manda-que-eu-faco/ [more inside]
Code editors for Mac (III)
In this last part of the series, I’m going to compare two of the features I use most in my work: project search and open quickly.
persistent-💎: a ruby gem for beautiful immutable data structures
A gem with a simple objective: make programming with immutable data structures in Ruby as joyful and frictionless as using the built-in Array and Hash classes. So easy, in fact, that using immutable structures becomes the norm, rather than the exception.
Persistent-💎 gives you a very tidy syntax for creating immutable: arrays (my_array = a💎[1, 2, 3]; hashes (my_hash = h💎[key1: 'foo', key2: 'bar']; and sets (my_set = s💎[:sephiroth, :kills, :aeris]). See project website for more details!
4 levels of the data validation in a Rails application you should be aware of
If you receive a user input in your application, you need a validation – no doubt about it. When thinking about the validation in a Ruby on Rails application we used to think about a model validation in the first place. But how about other levels of the validation? READ MORE
Content Security Policy coming to Rails 5.2 - the full guide on how to introduce it
This header helps to reduce or completely remove Injection and information leakage vulnerabilities. A basic Content Security Policy is easy, but for an effective one you’ll need a CSP strategy.
Encrypted Credentials — A new way to use Secrets in Rails 5.2
Rails 5.2 has a new way to use secrets.yml. It’s secure and much simpler than we are using in version 5.1. Now, you can even track GitHub history of your secrets. For details you can check my blog here: [more inside]
Would you like to see ActiveStorage work with models that use UUIDs as primary keys?
ActiveStorage will not work with UUIDs out of the box. Chime in on the PR to change that here:
Handling Errors Gracefully
I created a way to implement some kind of “Result Object” by rescuing StandardError instances and handling these errors gracefully. See my implementation here.
TIL - Ruby Array Multiplication
Today I learned that if you call a multiplication operator on a Ruby array, it duplicates each element of the array by the multiplier. Not sure what the use case would be. For fun, I created an exponent operator for array as well, using this functionality. [more inside]
Free eBook: Rails Testing Handbook
Tired of fragile code? This hands-on book will teach you how to build better Rails apps with confidence. What we share inside has helped us get Semaphore to web scale without losing minds. Download today.
How to Contribute to Ruby
Do you want to become a Ruby committer? Are you interested in learning from language designers? Do you want to get in the loop on conversations in the Ruby open-sourced development community? If so, this post is for you. More.