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.
Rails 3.2.2 has been released
Rails 3.2.2 has been released. This release contains various bug fixes and two important security fixes. The official announcement advises, “Users are recommended to upgrade as soon as possible.” Here are detailed instructions for Installing Rails 3.2 with advice and tips.
A Taste of Metaprogramming
I’ve posted A Taste of Metaprogramming to rakeroutes.com. It’s a quick look into using define_method and method_missing to dynamically write methods for a class.
How I deceased my rails startup time by 60%
I just blogged about how I deceased my rails startup time by 60% with ruby patches from funny-falcon
TConsole 1.1: Dedicated console for MiniTest suite runs
TConsole 1.1 is out! TConsole is a dedicated environment for running your MiniTest suites, both for Rails test suites and for any other project you’re working on that happens to test with MiniTest. It supports Rails environment preloading if you’re into that kind of thing, and also offers a nice concise syntax for running specific test classes and methods. Check out this quick screencast for a demo, or just check out the project page on GitHub.
Work-Stealing & Recursive Partitioning with Fork/Join
JDK7’s Fork/Join combines a double ended queue (deque) and a recursive job partitioning step to minimize synchronization - a great design pattern to keep in mind for single host and distributed cases! A look under the hood of the Fork/Join framework, and a few JRuby examples which will light up all of your available cores.
Learning from Rails' failures
I compiled a list of things Rails didn’t/doesn’t do right in the hope that we can learn from our mistakes.
Two Factor Authentication Example Rails App
I just pushed code to https://github.com/robertwahler/two_factor_authentication_example. A bare bones example Rails 3.2 application and test suite demonstrating the use of the Authlogic gem and custom two-factor authentication (TFA) with Google authenticator support. Feedback on the implementation will be appreciated.
Jump to method definitions in gems with ctags
Vim and Emacs users can easily jump to any method definition in a project using ctags. You can also configure ctags to let you jump to any method in your bundled gems; this quick post shows you how… Using ctags with bundled gems in Vim
Auto-retry transactions on deadlocks in a db-agnostic way
I recently published transaction_retry gem. It’s like good old deadlock_retry but works across all major databases, is well tested against Rails 3.x and supports all isolation levels (not only the default REPEATABLE READ). The gem was extracted from a large financial application and comes with good test coverage. Give it a try if you see errors like these: [more inside]
Rails Testing for Zombies
We just launched Rails Testing for Zombies. Play the first level free (you don’t even have to make an account). If you’re unsure about Rails testing, or just want to solidify your knowledge – this course is a blast. Enjoy!
Fun with Rock, Paper, Scissors
Fun with Rock, Paper, Scissors. Today on Rake Routes we dive into Ruby Quiz #16: creating player strategies to win at rock, paper, scissors. We start with the simplest of strategies and work all the way up into players that rewrite the game logic itself to guarantee a win.
Wizard-ify Your Rails Controllers with Wicked
Use Wicked to turn any Rails controller into a step-by-step wizard. To get started read the post or watch the screencast.
Global Hack Day #2, Thursday 3/8
The idea of having weekly or monthly hack nights has worked great for Ruby users groups all over the world, but the folks at Mendicant University feel like the internet deserves a similiar kind of event. Our next gathering is on Thursday 3/8 from 19:00 - 03:00 UTC. Please join us if you can! You can bring your own project to share and work on, or you can help others by offering code reviews and patches to their projects.
Life in a shade of ruby
I just posted an article about my rendition of Conway’s Game of Life in Ruby, you should read it here.
Aggresive caching with nginx and the Rails asset pipeline
In this post, I explain how to cache your Rails assets properly using nginx. This is one of the easiest and most effective performance optimizations you can make for you app, and can reduce page load times by seconds(!) on high latency connections.
New gem: rack-allow-from - white listed hosts can connect to your app
I just launched rack-allow-from, white listed host controls. Add hosts, like config.allow_from += ["1.2.3.4", "8.8.8.*", "example.com", "*.example.com"] to your application.rb. One caveat, using hostnames requires the client send the header X-Remote-Hostname (see the docs). Everyone else gets 403 unauthorized access… Tests and some docs to boot.
Go-powered web-services with Rails
Hey folks, my new blog post about Go-powered web-services with Rails is out. Enjoy!
Transaction isolation with ActiveRecord
I just launched transaction_isolation gem. It allows you to set transaction isolation level in a database agnostic way. [more inside]
Faye 0.8: new WebSocket and Redis libraries, and performance improvements
I just shipped version 0.8 of Faye, the pub/sub messaging toolkit for the Web. It splits the WebSocket support and Redis backend into new libraries, and makes it possible for 3rd parties to implement their own pluggable backends. Everything you need to know is on the blog.
Strict Validations in ActiveModel
Rails v3.2 has added the concept of strict validations. I briefly explain how they work and how to configure them.
Command Line Reporter 3.2 Released
The latest version of Command Line Reporter now supports unicode drawing characters for better looking output if your ruby version supports unicode. Check out the wiki to see examples of nicely formatted tables. As always The gem is available on rubygems.org with source on github. For those not familiar with “the reporter”, it provides a ruby DSL for writing reports with built in features for progress reporting and table formatting. It is very handy for system level and data reporting scripts.