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.
Optimize Early!!!
I constantly hear developers say “Don’t optimize too early”. I say make it easy for yourself to optimize early.
Lolize: Colorize your Ruby output with rainbow
I just made a fun project named lolize. It can colorize your Ruby standard output with rainbow :D The algorithm is based on lolcat. Hope you like it.
Termistat : a status bar for your terminal
Ever want to display progress for a long-running process but keep your verbose output too? Check out Termistat, a status bar for your terminal.
rubygems-pwn: A Vulnerability in RubyGems (currently being fixed)
If you’ve seen people saying to run gem install rubygems-pwn on Twitter (which I don’t advise!), it’s because it’s a proof of concept for a vulnerabilty in RubyGems. The rubygems-pwn project on GitHub has more information about it, but essentially you can push arbitrary Ruby code into gemspec parameters which will then be executed later on. The vulnerability has been discussed in the rubygems repo where a fix has already been made but, hopefully, more general fixes should be made available soon. (If you want to see the direct example of a malicious gemspec, look here.) [more inside]
Testing a Rails 3.1 Engine's Javascript with Jasmine
At work, we just upgraded a Rails engine to use the Rails 3.1 asset pipeline. Getting our Jasmine tests to run in the engine’s dummy app wasn’t easy. Here’s the solution we came up with.
Server-Sent Event Notifications with HTML5 & Goliath
Server-Sent Events are an HTML5 feature which allows you to easily push real-time notifications from the server to the client! Why not use a websocket? Turns out SSE offers a much simpler API optimized for one way push. A quick look at an SSE API and a Ruby/Goliath server implementation.
Double Clicking in Capybara through WebDriver
New post on the Collective Idea blog detailing how we got around Internal Chrome Errors by using WebDriver’s double click instead of page.execute_script(javascripty_code).
Dummy Text Gem
I just launched dummy text gem v.0.0.2: - lorem ipsum text generator with possibility to generate own template.
Introducing Stasis: A new way to build static sites
Build static sites with logical directory structures, any markup language in existence, and the power to change anything at runtime. Learn more.
Online GitHub repository statistics - powered by Metior
Want to see some statistics about your GitHub-hosted repositories? For example, who did the most commits or line changes? Metior allows this using a simple, powerful Ruby API, but now you can do this online! Using just the name of your (or any other public) GitHub repository to generate some stats about it. [more inside]
Getting HTTPS Going On Your Local POW Instance Using Nginx
For a Rails developer, getting HTTPS going locally isn’t just a matter of adding a gem to your Gemfile, and running bundler - unfortunately it’s a bit more involved. In this post, I’ll go through some of the steps that I took to get HTTPS going on a Rails application running locally under POW. Hopefully, it’ll be of use to somebody.
Never sleep() using Capybara!
Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations? A simple code example from HomeMarks v3 which uses Capybara’s wait_until block.
Writing Ruby Gems #5 - Setting up Rspec
I wrote up the 5th part of the series of blog posts about writing Ruby gems. This one is about setting up Rspec to test your gem. If you missed the previous posts, you can find all the posts linked here.
What is the method method_missing in Ruby?
I just posted a little explanation with definition and how to use the Method Missing in Ruby.
Active Admin 0.3.0 Released: I18N, Rails 3.1, New Docs and more...
We just launched Active Admin 0.3.0 (website, gem, code). Active Admin is an administration framework for Ruby on Rails applications. I wrote a short blog post with some of the new features or take a look at the full changelog for details of the release.
Webmachine v0.1.0 released
I just released the first version of Webmachine (gem) (code) in advance of my RubyConf talk. Webmachine is an HTTP toolkit that lets you focus on building resources declaratively, while transparently handling the hard parts of content-negotiation, conditional requests, and proper response codes.
Hire a Guard for Your Project
If you aren’t using Guard to automate your development projects (Ruby and otherwise), you should be! Learn the basics and get started with this new post.
jQuery Mobile & Rails
A few helpful hints from my first jQuery Mobile & Rails project. Includes advice on mobile page ids, data attributes, page layouts and testing with Capybara-WebKit.
Valium: The Cure for Your ActiveRecord Instantiation Woes
I just released a tiny little gem called Valium that makes it simpler to get at your attribute values (properly cast and deserialized) without going through the pain of ActiveRecord instantiation. Here’s the blog post.
Raad 0.3.1 released
I just released version 0.3.1 of Raad - Ruby as a daemon lightweight service wrapper. Raad is a non-intrusive, lightweight, simple Ruby daemon wrapper. Basically a simple class which implements the start and stop methods, can be used seamlessly as a daemon or a normal console app.
How to - Master/Slave cluster Engineyard setup with Chef
I just released a chef cookbook to nearly automatically configure master/multiple slave clusters on Engineyard using Seamless Database Pool.
Filet 0.2.1 just released
I just released version 0.2.1 of Filet. Filet is a small DSL on top of test unit to help you write acceptance tests, similar to Steak. It also supports some nice features as nested contexts and setup methods and works with several ruby implementations.
When Developers Go To Great Length To Save Typing 4 Letters
When you’re using Rails, swapping a new web server in is pretty painless. But if you want the “rails server” command to pick up your new web server as a default - it will require a little bit of hacking. This shows you how and does a bit of a dive into Rails and Rack in the process.