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.
Decouple ActiveRecord callbacks with some Pub/Sub
I put together a blog post on how clean up your ActiveRecord callbacks using wisper a ruby gem that provides publish-subscribe capabilities to ruby objects.
Telegrammer released
I’ve just released telegrammer, a gem to interact with the new Telegram’s Bot API. All contributions and suggestions are welcome.
Ruby data processing: how to explode rows with multivalued attributes?
Here is a new Ruby ETL article in which you’ll see how to write then refactor ETL components that transform data like this: [more inside]
whatson gem - Use $ kickoff to list upcoming football tournaments on command line
Hello, For fun I’ve added yet another dataset to the whatson gem that lets you list upcoming football tournaments from around the world. Ever wonder how many days to the next World Cup? Just type in your shell: $ kickoff The command will fetch the football event calendar page (from the intertubes) and print out: NOW ON 18d Women's World Cup 2015, Sat-Sun Jun/6-Jul/5 (30d) @ Canada › World (FIFA); NOW ON 13d Copa América 2015, Thu-Sat Jun/11-Jul/4 (24d) @ Chile › South America (CONMEBOL); in 14d Gold Cup / Copa de Oro 2015, Tue-Sun Jul/7-26 (20d) @ United States+Canada › North America (CONCACAF); in 1087d World Cup 2018, Thu-Sun Jun/14-Jul/15 (32d) @ Russia › World (FIFA) ... and so on. Cheers.
Restore BUNDLED WITH section in Gemfile.lock from git repository
We should use latest Bundler, but sometimes we are afraid we have to use older/newer Bundler. RestoreBundledWith solves these conflicts. restore_bundled_with
Webinar Recording: Refactoring Rails Applications with RubyMine
Last week, together with JetBrains, we presented a webinar on using RubyMine with Rails apps in the context of refactoring. The recording is now available. [more inside]
HOWTO use form objects with Rails
HOWTO use form objects with Rails–a new guide I wrote showing you how to use form objects in your Rails application, useful for decoupling validation logic from models and reducing complexity.
mruby-r: Use (m)Ruby for returning data to R
I have just released a mruby gem called mruby-r. It provides a way to call a Ruby script from R, making it convenient for generating sets of data on-the-fly. Check it out!
Pair Ranking Gem Released
Select a single winner using votes that express preferences. This can also be used to create a sorted list of winners. rasam gem
Optimizing Full Text Search with Postgres tsvector Columns and Triggers
Improve the speed of Postgres full-text search by introducing a tsvector column to cache lexemes and using a trigger to keep the lexemes up-to-date.
Say no to chained ActiveRecord scopes!
Chaining ActiveRecord scopes outside their models resist change and testability. Fortunately, there’s an easy solution!
Top 6 Ruby Links for Busy Developers
Here is the Top 6 Ruby Links for Busy Developers .
Locally Sourced, a magazine of technical writing
I’ve launched a Patreon campaign to support Locally Sourced. The center of each issue of Locally Sourced will be an article about 15 to 20 pages long (like a book chapter), covering some task or tool in more depth than a blog post. The topics will often be about Rails and JavaScript, and particularly about testing. Please check it out at https://www.patreon.com/noelrap.
Let's build a simple RSS to email digest script
In our office we need to be able to easily pull lists of blog posts into a simple HTML email format. I wrote a little script to do it, and wrote it up in a post: http://blog.honeybadger.io/lets-build-an-rss-to-email-digest-script-with-ruby/
Easy SEO metatags with Rails 4
Having the right SEO meta tags generated for your website is a must have nowadays, and setting them up is easy and fast in Rails with the Metatags gem. Here’s how we do it.
Preloading Rails scopes
Rails’ scopes make it easy to find the records you want. But you can’t really preload a scope. So if you’re not careful, your scopes will turn into N+1 queries, which turns into slow controller actions. How can you keep that from happening?
ANN Mustache v1.0.2
An update to the Mustache gem was just released with some improvements:
Over-engineering?
Is your code over-engineered or well-factored? We like to think that we know how to structure our code. But as will all things related to software development, there are trade-offs and decisions to make.
List of Best Ruby Gems for harder, better, faster, stronger web development
New to Ruby? This Ruby Gem Guide will show you how to install and work with our favourite local gems via Prograils.
Lotus - one year later
My review of lotus, a wonderful ruby web framework
Strategy before details: Keep up with Rails security + guide free until June 30
This new Rails security guide is about strategies before going into the details. And it will be available for free here before the release on June 30. It will help you creating a system for how to keep up with web app security and to introduce top security with just 10-30 minutes of work every day.
Ruby Productivity Scripts : Simple Whois Client
As web developers we have thousands of ideas for web applications than can make us get rich quick. We buy domains in bulk when we get too excited. Why do we need to Google for the details? Why do we put up with Captchas? Why not write our own scripts to get the details from a terminal? Read Ruby Productivity Scripts : Simple Whois Client to learn more.
How OpenStruct can kill performance
I was looking into moving some data out of hashes and into objects, and decided to compare the performance of classes, structs, hashes and openstructs. The results were pretty interesting: http://blog.honeybadger.io/how-openstruct-and-hashes-can-kill-performance/
Always Use Double-quoted Strings in Ruby
If you’re nerdy about what quote style you use (single or double), especially in Ruby, give this a read and tell me what you think.