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.
Trip: concurrent tracer built on Thread#set_trace_func.
trip is a concurrent tracer for the ruby programming language. It yields control between two threads, most likely the main thread and a thread that trip creates. It is implemented in pure ruby(no C) and with the help of “Thread#set_trace_func”. It can be useful when building developer tools like a debugger or if you want to step through code progmatically at runtime.
Cron Jobs and Rails
We wrote up a new tutorial on how to run Cron jobs with your Rails apps. We talked about use Cron to run rake tasks, Rails runners and the Whenever gem, and some alternatives such as Sidekiq/Sidetiq and the Heroku Scheduler. [more inside]
Dragonfly processed elements tracking with two layer cache – Memcached na ActiveRecord
Default thumbnails tracking for Dragonfly can be a bit slow - since it performs DB query each time you request an image. here’s a solution that’s using two cache layers: memcached and underneath a DB cache storage.
Gem Configurations in Ruby — How to improve the configure block pattern
I just wrote a little something here with suggestions on how to improve your Gem configuration in order to avoid misconfigurations, missing values, configuration scope issues, and more generally: disappointment.
Gem Configurations in Ruby — How to improve the configure block pattern
I just wrote a little something here with suggestions on how to improve your Gem configuration in order to avoid misconfigurations, missing values, configuration scope issues, and more generally: disappointment.
I just released Test Driven Development ...
I just released Test Driven Development in Ruby for Beginners book on Amazon.
Recent Releases from Rubyworks
Facets 3.0.0 ANSI 1.5.0 RSpec On Tap 0.3.0
I just launched a new course Test Driven...
I just launched a new course Test Driven Development in Ruby for beginners. This link will get you a $35 discount. Enjoy!
Why does Ruby have blocks?
Newcomers to Ruby often have difficulty with the concept of blocks. Here’s how I like to explain them.
First public release of Rbkit - A low pause profiler for Ruby
We just made first public release of Rbkit . A low pause profiler with very easy to use Desktop companion app.
Why Learning Rails is Not So Hard
Learnings Rails takes time because you’re learning to be a good software engineer, not just a Rails developer. Learning Rails Is Not About Learning Rails! is a comment to lately popular mind maps trying to explain why learning Ruby on Rails is hard.
Mongoid (MongoDB) has_many/belongs_to relation and wrong index being picked
If you have issues with your Mongoid relations and wrong indexes being picked, you may want to look here: Mongoid (MongoDB) has_many/belongs_to relation and wrong index being picked.
Release Candidate 2 for middleman-presentation 0.16.0
I just released the second release candidate for <a href=”https://github.com/fedux-org/middleman-presentation”middleman-presentation 0.16.0</a>. Detailed information about changes made can be found in the RELEASE_NOTES.md.
Refactoring Controller Helper Methods
I just recorded a screencast where we take a look at refactoring controller methods into a much more organized format.
railsbox - Ruby on Rails virtual machines configurator
I’ve created a small tool to configure virtual machines for Ruby on Rails development - railsbox.io. It uses VirtualBox, vagrant and ansible under the hood.
Debugging Super Methods with Ruby 2.2
Debug more, quicker with the new debugging super_method introduced in Ruby 2.2.
search_cop v1.0.5 is out
I just released a new version of search_cop. v1.0.5 is a bug fix release that fixes issues regarding quotation. [more inside]
Tropical Ruby 2015 announces its full lineup
Tropical Ruby 2015, the beach Ruby conference announced its full lineup, including talks, workshops and activities.
When edge cases poke holes in your perfect solution
You found the perfect solution to your crazy testing problem. All you have to do is override DEFAULT_HOST, and you’ll be in business. Except that you have to turn off warnings. And you have to figure out that one test where you don’t want to override the host. And then… Except… [more inside]
A menu system using Pundit
A blog post about we wrote a menu system that incorporates the Pundit gem for permissions, based on Rails’ routes parsing.
Recalculate counter cache columns in Rails
Rails has this great feature called counter_cache. When you have a has_many/belongs_to relationship between two models, it basically lets you say that you want to save the number of associated objects on the has_many side. So if you have Post has many Comments, you can do post#size and no SQL query is executed, Rails simply just looks at the comments_count field of the post. [more inside]
gauguin - a RGB image colors counter (a new gem created by Ania Ślimak)
gaugauin gem, created by Ania Ślimak, helps you count colors of a RGB image. It allows you to count a realistic number of image colors or to create color palettes based on images. Useful in apps for e.g. printing houses, promo agencies, designers. [more inside]
Understanding some Enumerable methods by implementing them in Ruby
Want to learn how to use Enumerables? Time to learn by building the Enumerable module yourself. Check how you could build the methods implemented at Enumerable yourself and use them in your code.
Spyke: A pretty good, full-featured ORM for API-backed apps
Extracted from an API-backed Rails app currently running in production, Spyke provides an ActiveRecord-like interface for interacting with REST services. It comes complete with features I was unable to find in other solutions, such as properly working scopes, customizable associations, ActiveRecord-style log output, fast JSON handling, etc. View Spyke on GitHub
Code Quality: Metrics That Matter
The Ruby ecosystem has dozens of tools for evaluating the quality of your code, but there’s a lot of variability in their usefulness and ease of use. Here are some that I’ve found to be both important and easy to integrate into my development workflow. http://chriskottom.com/blog/2015/01/code-quality-metrics-that-matter/