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.
Get to know your twiddle-wakka
That squiggly operator in your Gemfile, how does it work? Learn all about the pessimistic version constraint pattern in Rubygems and how to use it correctly.
Natural Language Processing in Ruby
The Ruby Language is presumably not the first choice for people doing scientific research. Fortunately there are some attempts (e.g. SciRuby) to change the situation, but Ruby still remains in our opinion underestimated. [more inside]
Rails feature that you've never heard about: schema cache
In the new series of posts, I write about Rails features that you have probably never used before. [more inside]
Keeping Data in Sync with ActiveRecord::UpdatedAt
ActiveRecord does not touch updated_at when calling update_all, update_column, or update_columns. We realized that we rarely ever have a reason to modify data WITHOUT touching updated_at so we’ve enabled the touching behavior by default using the active_record-updated_at gem.
TUNS - Twitter Unfollower Notification Service
just a twitter service written in RAILS. [more inside]
Ruby 2.4 adds Comparable#clamp method
In Ruby 2.4, clamp method is added to the Comparable module. This method can be used to clamp an object within a specific range of values. [more inside]
Go Full Stack Rails - A Pipeline of Functional Transformations
This post is part of a series that aims to discuss matters around a full-stack application written in Rails and ES6, but it goes beyond the app itself. Follow me as I write a functional parser in JavaScript using TDD. There’s also some discussion around how we should deal with JavaScript in Rails apps.
Rails security essentials
With all the high profile hacks in the news lately, I thought an overview of Rails security essentials would be timely.
[Screencast] Mail Previews and Templates
Using ActionMailer::Preview preview email samples without sending them. Using Zurb’s Foundation for Emails, learn how to use email templates with the Ink framework. https://www.driftingruby.com/episodes/mail-previews-and-templates
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.