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.
Random, Previous and Next entries from Active Record models using offset
Finding a random active record entry can be a tricky task and many of the solutions out there come with considerable performance hits. This quick blog post shows a couple of options and how to make use of the offset option, something quite often ignored by rails developers.
How slow are (Ruby) Exceptions?
If you are used to benchmark your Ruby scripts or if you ever had to improve the performance of some strategic tasks, then this post won’t tell you nothing new because you should already know that Ruby Exceptions are slow. And this is not really a Ruby problem: .NET Exceptions are slow, JAVA Exceptions are slow just because the begin/raise/rescue (or try/throw/catch) architecture is slow by nature.
Asynchronous Table Views With MacRuby
New blog post about speeding up NSTableView loading for BirdWatch, a MacRuby Twitter search app…read more here
Play with Rendera and learn HTML5 and CSS3!
I recently launched Rendera.heroku.com so I could easily test out some HTML5 and CSS3 examples, and I decided to open it up for others to use. I’ve added several examples, as well as support for HAML and SASS. There’s no support for saving your work on my server, but you can export anything you do to a standalone HTML file. [more inside]
Introducing Churn, a gem for class and method level churn rates
A post introducing a Churn gem, which will give detailed churn metrics for Ruby projects. High churn sections of code have been correlated with high defect rates. This tool will help identify potentially problematic code so it can be refactored.
Using geokit with searchlogic
I’ve got quite a few emails asking me the best way to use geokit with searchlogic. So I wrote an article describing how I do this. Hopefully this helps some of you. If not, its an interesting way to change the behavior of named_scopes.
Discover the Magic
Magic gem uses magic library (used by file command) to determine content types and encodings of files and strings. The library does three types of tests: filesystem tests, magic number tests, and language tests.
Miniskirt: factory_girl in about 30 LOC
For a bit of fun, I recreated the bulk of factory_girl (with some nice syntax niceties), packaged à la minitest, into about 30 LOC. The source is on Gist.
Ruby 1.9 character encoding field notes
The last few weeks I’ve been spending some time figuring out how to handle character encoding in your Ruby 1.9 application. I’ve posted my findings with a short blog post and a released a gem.
Screencast: live audio VST plugins coding with JRuby
Daniel309 made a screencast demonstrating how to use Opaz-PlugDK (experimental JRuby VST plugin framework) to code and tweak VST plugins in real-time. [more inside]
Introduction to ActiveModel
Yehuda Katz published a great introduction about ActiveModel which will be shipped with Rails 3.
Introducing the new Web Spider Obstacle Course.
Introducing the new Web Spider Obstacle Course (WSOC). WSOC was completely re-written as a Sinatra app, and can easily be used to test the robustness of any Web Spider/Crawler/Scanner. Currently, Spidr uses WSOC as part of it’s test suite.
Collaboratively developing Facebook apps with Rails
Robert Shedd just posted a tutorial on how to set up a collaborative development environment for Facebook apps. The set-up utilizes Facebooker’s tunneling system.
RailsBridge BugMash for Rails 3
The upcoming BugMash will take place on 1/16 and 1/17. We're going to try something a little different. With Rails 3 on the way, we didn't want to spend a lot of effort on withstanding 2.3.x bugs, so the idea is to have participants get to know Rails 3 better. [more inside]
script/plugin can now keep track of url / revision / install-date / updates
With tracked_plugins installation stays the same and new meta information (url / installed_at / revision / …) is stored <-> used to update plugins, try it!
2dconcept's JqGrid in unobtrusive way
How to use JqGrid and being not in the way in the same time? Here’s a recipe how to use JqGrid + SearchLogic + jQuery Tools in the same time.
Using Facebook callbacks with Rails
Robert Shedd wrote a blog post on how to use Facebook’s post-authorize and post-deauthorize callbacks in a Rails-built Facebook app to track which users have added and removed the application.
Shoulda Macros for Testing (Not) Logged-In Filters
A new blog article: In any Rails app with a user system, certain actions are likely to have a before_filter to ensure that a user is either logged in or not logged in before accessing those actions. With Shoulda, we can easily create a few macros which make testing this behavior as simple as adding a single line to the test context for each action that uses one of these filters.
Efficient, Immutable, Thread-Safe Collection classes for Ruby
Started as a spike to prove a point, Hamster has since morphed into something usable with Persistent Data Structure implementations of Hash, Set, List, and Stack. My primary concern has been to round out the functionality with good test coverage and clean, readable code. It’s still a work in progress but as I said, definitely useable now.
Rack::Rewrite 0.2.1 Released
I just released Rack::Rewrite 0.2.1. Rack::Rewrite is a web-server agnostic rack middleware for defining and applying rewrite rules. In many cases you can get away with Rack::Rewrite instead of writing Apache mod_rewrite rules. To install, simply run gem install rack-rewrite.
Oracle PL/SQL unit testing with Ruby
I created screencasts showing how to do Oracle PL/SQL unit testing with Ruby using ruby-plsql and RSpec.
Fat Free CRM 0.9.9b released, adds support for localization.
Fat Free CRM is Ruby on Rails-based customer relationship management platform. Check out the release notes and fork the source at Fat Free CRM project page on Github.
BirdWatch: MacRuby Twitter Search App Released
An open-source twitter search client written in MacRuby, using the apple PubSub framework and the twitter search atom api. read more here
gem install woot
Scrapes woot.com sites: http://github.com/shuber/woot. Also allows you to receive live updates from woot’s twitter streams.