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.
Should you use scopes or class methods?
Scopes are a great way to grab the right objects out of your database. But when you call them, they look almost exactly like calling a class method. And class methods can do most of the same things scopes can. So why would you use a scope when you could use regular Ruby class methods?
Debug Rails Faster with Quiet Assets & Quieter Logs
You may find Rails’ default logging obstructs your debugging efforts when it floods the server output with waves of asset requests. Bypass this extra logging and streamline your debugging workflow by installing the Quiet Assets gem: https://eliotsykes.com/quiet-assets
How to Write Smoke Tests for an Ember Rails Stack
Micah Woods explains how to run smoke tests when writing an app using the Ember Rails stack. http://blog.codeship.com/how-to-write-smoke-tests-for-an-ember-rails-stack/
Locally Sourced: Using Tests to Add a Feature to a Rails Application
Noel Rappin has released a new sort-of book, “Locally Sourced: Adding a Feature to a Rails Application”, which describes the entire process of building features into Rails including integration and unit testing, and also covers the difference between traditional and mock tests. Get the issue at https://www.patreon.com/posts/3254253. Support a Patreon campaign for more content at http://www.patreon.com/noelrap.
Rubinius 3 Gitter
How and why the Rubinius team uses Gitter, and why we love it so.
Extending Objects' Behavior With Module#prepend
New blog post on blog.Ragnarson [more inside]
How to exit a Ruby program
If you want your app to behave well in a unix environment, it’s important that it exit correctly. In this post you’ll learn all about unix exit codes, the mechanism that Ruby uses to exit a program, and how you can add custom behavior on exit. - http://blog.honeybadger.io/how-to-exit-a-ruby-program/
Simple Twitter Bot in Ruby
In just a few lines of Ruby, you can create a simple bot for Twitter actions http://www.codebycodes.com/blog/2015/08/31/creating-a-simeple-twitter-bot-with-ruby/
Transactional Services Through Background Jobs
Mitigate the lack of transactional safety by leaning on Sidekiq for discrete background jobs when interfacing with external systems. http://sorentwo.com/2015/09/01/transactional-services-through-background-jobs.html
Inflections Everywhere: Using ActiveSupport Inflector
Grammar is important, especially when it comes to following Rails conventions. But grammar is also hard, and languages have all sorts of exceptions! Rails’ ActiveSupport::Inflector is a great tool when it comes to handling these linguistic roadblocks. This blog post walks through using the Inflector and writing your own custom inflections.
The ModelAttribute gem - an alternative to Virtus
ModelAttribute provides a simple alternative to Virtus for adding attributes to models. Its key advantage over Virtus is built-in dirty tracking, making ModelAttribute perfect for models that are backed by a web service. [more inside]
Upcoming Ruby Conferences - September 2015 Edition - Live Version Try $ rubyconf
Hello, For you convenience the upcoming Ruby Conferences as listed with the whatson gem and the included rubyconf command line tool (for a live version try $ rubyconf): [more inside]
(Rails) Application directories named as architectural patterns antipattern
Explaining why grouping class files in directories using an architectural pattern name is unintuitive and giving an alternate solution at: http://teotti.com/application-directories-named-as-architectural-patterns-antipattern/
[Lesson #2] Build Less, But Better Software
Do you want to help your clients or business accelerate product development and business growth? [more inside]
Who's Using Ruby (or Not), for What, and Why?
A brief survey for, and possible chat with, Rubinius developer Brian Shirai on the use of Ruby. [more inside]
Tips & Tricks: Gettings Random Records in Rails
Learn how to use the built in random methods in PostgreSQL and MySQL with Rails & ActiveRecord http://solidfoundationwebdev.com/blog/posts/getting-random-records-in-rails
JSON Validation by Committee
I have penned the second of two posts talking about JSON API documentation and validation with Ruby. Learn how to use the prmd and committee gems do test, document, and validate (in production, no less) the data provided to and by your API
You are using nano editor on linux?
Here are some helpful commands especially for mac users I always forget: [more inside]
The plugin system of Sequel and Roda
Sequel and Roda use a special kind of plugin system as a design pattern. Since this is a general pattern that anyone can apply to their gem, I thought it would be really useful to share with you how it works and why it is awesome.
Colt 0.3.0 Released
Added update credit card expiration, add new default credit card and save credit card features. Check out the Colt Gem
Dr Jekyll's Themes of the Month - August'15 Edition - Leonids, Video, Centrarium, etc
Hello, let’s welcome the August’15 Edition of the Dr. Jekyll’s Themes of the Month series that highlights ready-to-fork static site themes. The new themes include: Leonids by RenYuan Zou; Video by Max White; Centrarium by Ben Centra; Mickey by Vincent Chan; Material Design Lite (MDL) by Oscar Cortez and Planet Jekyll’s Starter (Minimal) by Gerald Bauer. Find all themes at the Dr. Jekyll’s Themes directory. Any theme missing? Add your theme! Cheers.
How can Ruby heroes write better code?
For a practical discussion, please read : Fail Early and Loudly
Lita 4.6 released
Hot on the heels of Lita 4.5, version 4.6 of Lita, the Ruby ChatOps framework, has been released. This release adds long-requested support for chat-service-specific APIs. The Slack adapter for Lita has also been updated to add support for sending Slack attachments from your bot. [more inside]