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.
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 https://tomk32.github.io/2018/03/18/rails-on-elasticbeanstalk.html
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. https://medium.com/@davidmles/code-editors-for-mac-iii-3c40dd6986b9
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: https://github.com/rails/rails/pull/32466
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.
Rspec, system tests, JavaScript and Select2 recipes
System tests are great and they can actually be fast now. They just currently have a few gotchas. This article aims at introducing system tests onto your app and test a jQuery select2 tag implementation. Read more on blog
How To Make An App Like Periscope
How To Make An App Like Periscope [more inside]
SOLID Principles #4 - Interface Segregation Principle
Five-part series of blog posts about SOLID Principles. This one is about the fourth of them - Interface Segregation Principle: [more inside]
Fixing Kernel#singleton_method bug in Ruby.
It’s a story about how I fixed a bug in Ruby’s Kernel#singleton_method. [more inside]
ImageProcessing 1.0 Released: Wrapper for ImageMagick and Libvips
ImageProcessing is a gem that provides higher-level image processing helpers that are commonly needed when handling image uploads. Initially the gem came with a simple module-based API and provided only processing with ImageMagick (via MiniMagick), but recently it was rewritten with a more flexible chainable API, and also gained libvips support which can be up to 10x faster than ImageMagick. Read more about it here.
Understanding a Ruby Wat
http://pauloancheta.com/ruby/wat/2018/03/23/explaining-wats/ A few weeks ago, a co-worker found something really interesting. He posted on our slack channel this line of code. Does anyone know what the output of this is? “(data)”.gsub(“(data)”, “15\01\2018”) [more inside]