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.
Speed up integration tests in Rails 5 app
Don’t wait for 5.0.2, get 40% faster tests now: https://gist.github.com/printercu/23bce83879eaaf8161410324ad56b235
Connecting Ruby and Elixir with Erlectricity
Communicate between Ruby and Elixir using Erlang Ports and Erlectricity. [more inside]
PATCH vs PUT and the PATCH JSON syntax war
There is still lot of confusion on PUT vs PATCH HTTP methods and the JSON syntax. In this article I will try to explain the difference and present pragmatic solution to PATCH syntax problems [more inside]
6 tips I learned after 6 months of web dev
http://www.seanwinner.com/2016/12/6-tips-i-learned-after-6-months-of-web.html
New release of poly_belongs_to gem 0.3! via @6ftdan
PolyBelongsTo is a meta-programming friendly ActiveRecord method helper gem. This allows you to work with all DB relations in a uniform way. This gem also provides database integrity methods and record deep cloning functionality (with or without associations). It has been featured in Ruby Weekly #233 and featured in Green Ruby #118. This update includes child relation helper methods and has_and_belongs_to_many support.
Handy Rails Development Tricks for Efficiency
In this post I detail a few pry and ruby tricks I use every day to boost my development and audit efficiency when going through code bases. [more inside]
The Pure Functions experiment
Today I would like to talk about pure functions and how they help to write better and maintainable code. I tried myself as an experiment and it resulted in mind change, for good of course, applicable to any programming language you use even though the term is more common in the functional programming (FP) community. This is not a new conclusion you might say, but for me it was. There are lots of new ideas coming everyday, lots from FP actually which is trendy ATM, but still you need to convince yourself something is good for you, you need to try it and see if you should move from evaluate to adopt in your tool set. That’s what I did and here are the results. Continue reading
Using tags to browse ruby and gem source with Vim
Using tags brings your Vim closer towards a fully capable IDE and makes code browsing and navigation easier. This setup allows you to jump into not just the project code but you also inside your gem and ruby source. Full article
Unit Testing Chef Guard Clauses: Command Strings vs. Ruby Blocks
This blog post explores the use of “guards” in Chef execute
resources and the implications for unit tests when guarding with Ruby blocks vs. command strings: [more inside]
Why you should keep your dependencies up to date
As an extension to Murphy’s law, critical security updates for your dependencies come in at the least convenient time possible. That’s one reason why it’s a good idea to keep your dependencies up to date, so that upgrading on short notice doesn’t turn into a nightmare full of yaks and blunt shears. Full article (depfu.io)
Ruby Coercion Protocols - Part 1
Ruby has powerful protocols to coerce a type into another one. We’ll learn how to take advantage of this mechanism to make our code open for extension. https://blog.dnsimple.com/2016/12/ruby-coercion-protocols-part-1/
Getting ready for new concurrency in Ruby 3 with Guilds
Ruby Guilds are the new way concurrency will be handled in Ruby 3. There’s still a long way to go until we reach that point, but I believe that we can already start implementing some of the concepts that will make our lives easier when we reach Ruby 3. In this article I try to describe some of things we should either do differently or avoid at all. [more inside]
Ruby 2.4 Performance Is Looking Good
There are some articles highlighting new features of the upcoming Ruby 2.4. I decided to run a basic benchmark comparing Ruby 2.4 to Ruby 2.3.3 and was pleasantly surprised.
to_duration - A ruby gem for converting seconds into human readable format
Did you ever need to convert seconds into human readable format? This gem may help you. Check it out!
Emoji - Jekyll Plugin of the Month - Add Thumbs Up (+1), Smileys, Santas n More
Hello, I’ve posted the latest article in the Planet Jekyll Plugin of the Month series that presents a new addon for your (static) web pages every month. Let’s welcome - Emoji - Add Thumbs Up (+1), Smileys, Santas, Snowflakes n More to Your Pages. Happy Publishing (w/ Jekyll). Cheers.
Replacing Sinatra with Rack in Sidekiq
This article is about how Sidekiq replaced their Sinatra powered Web UI with a pure Rack powered one.
A Beginner's Guide to Exceptions in Ruby
The other day I was searching for an introduction to Ruby exceptions written for beginners - people who know basic Ruby syntax but aren’t really sure what an exception is or why it’s useful. I couldn’t find one, so I decided to have a go at it myself. I hope you find it useful. http://blog.honeybadger.io/a-beginner-s-guide-to-exceptions-in-ruby/
Zero Downtime Migrations with ActiveRecord and PostgreSQL
Catch problematic migrations at development/test time using the zero_downtime_migrations gem!
9 New Features in Ruby 2.4
Ruby 2.4 is almost here! Are you aware of the new features? Read this post to find out. http://www.blackbytes.info/2016/12/new-ruby-features/
A gem to check npm front-end dependencies easier for a back-end developer
If you use a modern, npm-backed build system for your front-end, it may be a hassle to check for dependencies after every pull, especially if you are a back-end guy or gal. [more inside]
New gem 'multiples'!
When you want to step through all numbers that are divisible by either of two digits there is a palindrome pattern in that sequence (much like the patterns in frequencies that overlap). This gem discovers that palindrome and creates a custom enumerator like object that lets you step through each of those numbers. danielpclark/multiples This may help save you some time by not looping over non-multiples when iterating through any range of numbers.