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.
integrate Emacs with rbenv - announcing rbenv.el
Ruby developers using Emacs and rbenv should take a look at rbenv.el. It let’s you configure your Emacs session with the rbenv ruby of your choice.
Creating immutable tree data structures in Ruby
What are the advantages of immutable data structures outside functional programming? We explore the benefits of immutability when designing a search query API in Ruby. Continue reading…
Clipboard Helpers for IRB
A simple .irbrc addition to access Mac OS X’s pbcopy & pbpaste commands from IRB.
A proposal for better mocks
After reading “Growing Object-Oriented Software Guided by Tests” (GOOS), I finally stopped worrying and learned to love the “mockist” or “London School” of TDD. However, the unfortunate fact of this style in Ruby is that tests using mocks can easily find themselves out of sync with the concrete implementations instructed into existence by those mocks, especially when making adjustments to the design of the system. [more inside]
ActiveRecord Join Models Hash Themselves into Bad Performance
ActiveRecord’s hash method is broken for id-less (join) models, causing massive performance issues when dealing with non-trivial datasets. Here’s how we fixed it.
The Asset Pipeline Isn't Actually Slow. ...
The Asset Pipeline Isn’t Actually Slow. rake assets:precompile shouldn’t take forever, and can be patched now without any special gems.
State Machine with Rails. Basics
State Machine comes to the rescue when models in your application need statuses and events. There is a state_machine gem for ruby. I recommend you to spend some time studying basics before you start using it with rails. Here is a nice tutorial
Blind Refactoring, Guided by Tests
Can you write good code if you don’t understand what you’re doing? I was recently surprised to discover that sometimes, with a good test suite, you can.
Hexagonal Architecture for Rails Developers
Recently, the topic of building loosely coupled systems with Rails has gotten a lot of attention. More and more people are experimenting with different approaches trying to make their Rails applications more maintainable. The hexagonal architecture is one such approach. And in this article I am going to show how it can be used with Rails. Read more…
How to handle naming conflicts on a polymorphic has_many
Naming conflicts on a polymorphic has_many is an issue we came across in a recent rails application. Read how to handle this issue and avoid it.
Open Source in your Inbox: Code Triage
“I don’t have time to contribute to open source”. But who does? We’re too busy shipping products and open source is so daunting and time consuming. Sure tools and technologies are our livelihood, but there’s just so much there. Even if you’ve got the time - where do you start? continue reading….
RubyMine 5 is Out: RubyMotion, Ruby 2.0, CoffeeScript debugging
JetBrains releases RubyMine 5, its intelligent Ruby and Rails IDE, bringing the full stack of development tools for more types of Ruby applications, with smart code assistance, testing and debugging features now available for RubyMotion, cutting-edge Ruby 2.0, JRuby, Web applications and many others.
Hopla: a Rake-based front-end dev suite
Hopla is a dev suite built in a single Rakefile and a few methods which gives you full access to Sprockets, Compass, and any template format supported by Tilt.
PartyFoul 1.0 - Capture errors in your app and open as a Github issue!
PartyFoul 1.0 includes background processor adapters, custom label handlers, and strategies for capturing errors in your Workers. Stop paying tons of money for exception capturing services and start using Github. (you get a higher API limit than anything else out there)
All future Net-SSH gem releases will now be signed (as of 2.6.5)
As of today, all net-ssh (and family) gems will be signed. “gem install net-ssh” will continue to work as is, but you will now be able to verify the authenticity of each release with “-P HighSecurity”:
$ curl -O <https://raw.github.com/net-ssh/net-ssh/master/gem-public_cert.pem>
$ gem cert --add gem-public_cert.pem
$ gem install net-ssh -P HighSecurity
RSpec Shared Examples and Ruby Metaprogramming
I wrote a quick tutorial on using RSpec Shared Examples with Ruby Metaprogramming.
Rex, Rexical and Rails Routing
We wrote a blog on Rex, Rexical and Rails routing . [more inside]
Lessons Learned in Concurrency with Ruby – Part I
Check out Jeremy Budnack of Engine Yard’s journey with concurrency in Ruby right here.
Receive Gmail Email Messages in Rails with mail_room
I just released mail_room to make it easy to have gmail email messages pushed into your Rails applications and wrote a little bit about it on tpitale.com. - Tony Pitale
Visualising KPIs of your Rails project with Google Charts
It is extremely important to know how well your project is going. The best way to do it – just plot some metrics. In blog post Visualising database some tricky ActiveRecord queries are described with code examples of Google Charts to visualise query results.