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.
market_beat gem released
Market Beat fetches stock quotes and 100+ other market indicators (including real-time) from publicly available sources. Currently Google and Yahoo U.S. financial reporting services are supported. Check out Market Beat source code on Github.
gabbler gem released
Feed Gabbler any coherent text file with adequate number of sentences. Once trained, Gabbler produces pseudo-random phrases based on the original text. Check out Gabbler source code on Github.
awesome_print gem 1.0.2 released
Maintenance release of your bug bash party favorite. New version adds formatting of Mongoid documents, improves Rails.logger.ap, and more. Check out CHANGELOG for details.
Konf - Simple Configuration Reader
Simple configuration reader: Konf. There are many like it, but this one is mine.
Making a custom Markdown renderer with Redcarpet
I just blogged some fun custom Markdown rendering code with Redcarpet. Normally, I’m all about best practices, but this code is just quick and dirty!
Get a Sinatra/JSON/MongoDB service up and running in 5 minutes or less
A quikstart walkthrough tutorial of creating a Sinatra JSON API coupled with MongoDb
Mounting a Cell to a Route with Cells 3.8.
Cells 3.8 is out! Since we got rid of the ActionController dependency we can now mount cells on Rails routes, directly and have super fast view components.
Let’s Talk About Conditional Expressions
Evan Light talks about conditional expressions in this guest blog post on RubyLearning.
Otto - auto-define your rack apps in plain-text
Apps built with Otto have three, basic parts: a rackup file, a ruby file, and a routes file. If you’ve built a Rack app before, then you’ve seen a rackup file before. The ruby file is your actual app and the routes file is what Otto uses to map URI paths to a Ruby class and method.
dust-deploy (sprinkle/chef/puppet alternative)
I just launched dust. It’s a ssh/facter only push-deployment tool, designed to handle complex linux server structures. Configure nodes using simple yaml files, and push your nginx, iptables, mysql, duplicity, ssh authorized_keys, … to one or multiple servers.
Write better Cucumber steps using the rel attribute
I just blogged about Cucumber and the rel attribute. It’s really more about web standards and automated testing, though.
Rails: rails vs ./script/rails
As the DevOps guy in our organization, I spend a lot of time booting consoles and running scripts against our application, so Jesse’s post about the overhead of rails and exec(2) really piqued my interest. A savings of a second or two can make a big difference. Read on to see the difference between rails and ./script/rails in our application.
The rails command and exec(2)
The rails command is just a thin wrapper around exec(2). Read the article to find out what exec(2) is, why the rails command uses it, and how you can skip it altogether.
Thinking of using Ruby metaprogramming?
Be sure to follow some simple best practices; see: Learning from the masters part 2: three metaprogramming best practices.
Eventually: an evented API with Ruby callback idioms in mind
I just finished writing eventually, a new gem built with a similar API to the excellent EventEmitter library that comes with NodeJS. The README says it all, or go grab it off rubygems and let me know how it fares. Comments welcome.
link_to_unless_current and other secret helpers
I’ve just finished a blog post about link_to’s little brothers and sisters: http://www.rails-troubles.com/2009/12/to-link-or-not-to-link-rails-link.html Read more
Evax Gem: Another Ruby Assets Compressor
The idea behind it is to have a really simple library to compress your assets in the simplest way without any weird dependency (who said Java?). There are nice assets packaging systems out there but they have too many options for some cases. Sometimes, you just want to play with a pet project. I hope that Evax will help you!
Don’t “Push” Your Pull Requests
Don’t “push” your pull requests - good work gets “pulled”. Avoid the trap of working in the dark and being surprised when your contributions don’t get merged.
Github Concern: Easily integrate github service hooks with your app
I just launched github concern. Automatically integrate with github and easily associate commits to models and users.
Large-Scale Machine Learning with Shogun-Toolbox and Ruby
I posted some information on compiling and using Shogun-Toolbox in Ruby. The Ruby bindings for Shogun-Toolbox are listed as “proof-of-concept” but work well regardless.
Geo-Rails part 5: Spatial Data Formats
I just posted Geo-Rails part 5: Spatial Data Formats, the latest installment in my ongoing series on geospatial programming using Ruby and Rails. It provides an overview of geometry serialization, shapefiles, GeoJSON, and related topics, along with examples using RGeo.
How to zip/unzip stuff with Ruby and Zip library
Small tutorial on how to zip/unzip directories and how to access single files stored in those archives without unzipping whole packages. Read more
Rails Gem cookie_tracker for easily storing and updating user preference settings.
The cookie_tracker gem simplifies the task of keeping track of certain user preference settings, typically display related. It provides a nice instance method you can use in your controller to define these settings as a hash along with default options. Each setting is made available to your controllers and views as instance variables and stored in the users cookies. Any time a user changes the value and submits the form, the instance variables and cookies are updated to reflect that change. Settings can be stored in the session store if that’s what you prefer. You can override default values using an initializer file. Check out the Github page: CookieTracker Give it a shot and let me know what you think.