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.
Multiple sets of independent validations with validation_scopes
I cooked up ValidationScopes to expose the full power of ActiveRecord validations to more than one set of errors. Useful if you want to display different sets of errors in different contexts and still be able to save the object regardless of the additional validation sets’ state. It is about as loosely coupled as possible to ActiveRecord::Validations which means you can expect a smooth transition to Rails 3.
Learn more about MongoMapper
This article will help you during your MongoMapper learning phase by explaining a few features not yet documented.
Gem webhooks on Gemcutter
Get notifications of gems as they’re pushed to any URL you want. Read more here and check out an example app that uses this new feature.
Gravatar Image Tags: Updated and bundled into a gem
With the 0.0.2 release of gravatar_image_tag: Https support was added.; Ratings support was added; File extension support was added. It really is this easy: gravatar_image_tag email and you have gravatars in your application. Check out the well documented and configurable project on github
Cromwell — Lord Protector of your scripts
Cromwell allows you to easily protect your scripts from being killed while they are doing something that should not be interrupted (e.g. interacting with some non-transactional service) or is too costly to restart (e.g. long computations). Links: blog post, Cromwell on github, Cromwell on gemcutter.
RubyConf Taiwan 2010 CFP
RubyConf Taiwan 2010 will be held on April 25, 2010 in Taipei, Taiwan. If you want to give a presentation at RubyConf Taiwan 2010, please submit your paper. Any topics related to Ruby are welcomed. The deadline of call of papers is Jan 31, 2010. We have two session lengths for speakers: Session(45 min) or Talk(20 min). Please submit the subject, extract and author intro, by sending email to: 2010@rubyconf.tw
Get your local Rails application ready for I18N
I just launched a handy tool helping transfer your local Rails project to an i18n one by extracting text from HTML and helper methods from ERB views.
An introduction blog or Fork it at Github
Install: gem install ready_for_i18n
Usage: ready_for_i18n <path_to_ERB_source_files> [target path]
Non-Enligsh project usage: Check here
Cryptic Ruby Global Variables and Their Meaning
How many times have you looked at some ruby code and found strange variable names (eg. $0, $:, etc) and wondered what they meant? Well here’s an explanation
A custom Hoe template
I like to create Ruby projects, and I also like to use Hoe to manage them. With any Ruby project generator, I always hate having to add my usual boilerplate code and Rake tasks. Luckily, Hoe supports using project templates, stored in ~/.hoe_template, with the sow command. For example, here is the Hoe template I use to generate new projects, with RSpec 1.2.9 and YARD 0.5.2 setup. [more inside]
Lemon Unit Testing Framework
I just released v0.6 of Lemon, a unit testing framework that enforces a one-to-one correspondence between test cases/units and classes/methods. While still an early development release, it’s quite usable. And I’m curious to find out what others think of the approach.
R18n 0.4 for Rails
R18n now has full compatibility with Rails I18n and add to Ruby on Rails: filters, i18n support for models, time formatters, nice syntax and out-of-box pluralizations and autodetect user locale. Also R18n has Sinatra, Merb and desktop plugins.
HTML5 form helpers for Rails
I’ve added HTML5 form helpers to my gem of Rails patches, giving you, for example, email_field_tag and email_field, which are already very helpful for the iPhone, Safari, and Opera.
Attribute Normalizer now a gem: Looking for roadmap feedback
I just released a gem version of the attribute normalizer active record plugin over on gemcutter. I’m now looking for your feedback on the roadmap to the 0.2 release of the gem before I dig in working on it. Please leave your feedback on the latest release annoucement. Or email me at the address found in the source notes.
Rails Package Management
Released a tool that will act as Rails::Initializer’s config.gem and extract plugins and gems to vendor/ like “rake gems:unpack”. It’s portable configuration where you can copy it and paste to another Rails application. You can paste your .rpkg file to gist/pastie/pastebin and download it and merge it with rpkg merge Just good for people who don’t want to type: sudo gem install [plugin/gem] to run Rails application. Read this post about Rails Package Management.
LocalNewsRadar : A rails plugin which gathers local news/tweets like a spider for an AR Model
Found This: LocalNewsRadar Looks like its based on Outside.in api with ability to hook various other open apis.
New Screencast: Essential CSS for Every Web Developer
Want to know the basics of CSS? Watch this screencast and learn everything you should know as a web developer. We’ll cover the basics which include colors, borders, padding, margins, lists, fonts, backgrounds, tables, links and floats. This is a very basic screencast, so if you are already familiar with these topics, this might be just a review for you. Watch this screencast and more at TeachMeToCode.com
Remember - Ruby object persistence
Remember provides quick and easy Ruby object persistence using Moneta to interface with key-value stores via a Hash. This allows you to have a globally persisted hash whose keys are available across different servers or ruby instances. [more inside]
Better Task Management with Nake
Nake is a task manager inspired by Rake. As well as Rake, Nake supports dependencies, multiple task definitions, file tasks, rules etc, but it can do more. It also supports advanced arguments parsing and task configuration. Nake is also 4x times faster than Rake. Nake comes with a lot of useful tasks for gem building, installation and releasing, running specs and also with snake executable for system-wide task (similar to Sake for Rake). If you are looking for documentation, take a look at Nake Wiki or clone the repository and go through examples.
Radiant CMS extension deactivating
I’ve got a quick read on the deactivate method in Radiant’s extensions and exactly what it does and does not do.
IM New Year countdown with MacRuby
Matt Aimonetti wrote another example of how to use MacRuby for something you might not have thought of. This time he shows how to programmatically change your iChat status to display a countdown to 2010.
PHPs extract and compact functions implemented in ruby
Due to a series of questions on how to dynamically define local variables (which is an anti-pattern, mind you, you almost certainly should use a Hash instead), I went ahead and implemented Kernel#extract and Kernel#compact. Ruby being OO, those pseudo-functions would probably be better implemented as methods (e.g. Binding#extract), but that’s left as an exercise for the reader ;-)
Mongo3 - rule your mongoDB clusters
Just released V0.0.6 mongo3. If you mongo please try mongo3…
MailStyle: Easier HTML Emails
I’ve just released MailStyle, a plugin to ease the pain of writing HTML emails in rails.
Detect the language of a string
Matt Aimonetti just posted a short blog post showing how to detect the language of a string with MacRuby in less than 10 LOC. "Happy new year!".language # => "en"
Run, I18n, Run!
José Valim talks about the latest I18n gem release with the extensions newly added. It tells how to use them to speed up translations and includes some benchmarks as well!