In my current Silverlight project the amount of JavaScript is growing exponentially. Everything that I took for granted in Flash which took years to build and “perfect” now needed to be converted to JavaScript.
For the first beta release which is looming next week, the amount is about 130k. “Compressing” it with JSMin yields a file of 75kb in size. Yesterday I tried YUI Compressor which managed to squeeze it down to 65kb.
I’m very happy I no longer have to look at JSMin code which induces gag reflex and makes my eyes bleed. The amount of effort and self restraint it took not to rewrite it can not be described in words.
It’s nice to do some Ruby once in a while. Lately I’ve been involved in a Silverlight project and haven’t touched Ruby in 2 months (hence the lack of activity on my Ruby blog). However, I’m making a build script in Ruby.
I have run into a weird exception when using my favorite IO gem RIO (btw, Noobkit page got beaten with the ugly stick and parser needs a spanking).
Exception occur when calling rio(...).rmtree or rio(...).mkpath or rio(...).mkdir. It reads as follows: “wrong number of arguments (0 for 1)”. I know for a fact that these methods don’t take any arguments, but just for kicks, passing a single random argument results in an ironic “wrong number of arguments (1 for 0)”.
Basically the problem came down to the fact that RIO doesn’t like Rake. I can live without Rake, but not without RIO.
Another cup of fresh Rails and not so Rails brew. If you’d like to send in a link, please use this page.
Rails
- Rails 2.0: Release Candidate 2
- Attachment_fu updated!
- Installing Mingle with Capistrano/Deprec
- RSpec and Inline RJS
- Master/Slave Databases with Ruby on Rails
Ruby
- Measuring your test coverage with Heckle and RCov
- How To Start Playing With Ruby 1.9 Right Now!
- Ruby DSL Blocks: A Common Pattern For Developing DSL
- RDDB: RESTful Ruby Document-Oriented Database
- Sinatra: Classy web-development dressed in a DSL
- RubyInject - a Mac OS X framework that allows you to inject at runtime the Ruby interpreter into any running application.
- RubyGems 0.9.5
Web Development
Another cup of fresh Rails and not so Rails brew. If you’d like to send in a link, please use this page.
Rails
- Fixtures in Rails 2.0 - new Railscast.
- Plugin: create better urls with has_wfid.
- Sexy Chart - The video.
- Create Builder Applications Using Cheri.
Ruby
Another cup of fresh Rails and not so Rails brew. If you’d like to send in a link, please use this page.
Rails
- Super fast IP to lat/lng in Rails (part 2)
- Generate Named Routes - new Railscast.
- iPhone subdomains with Rails.
Ruby
- Backing up MySQL and Subversion with Ruby.
- Getting Started with the wxRuby GUI Toolkit.
- NetBeans Ruby IDE 6.0 Beta 2 - my Ruby/Rails IDE of choice turns another version.
- An introduction to RDoc.
Web Development
Another cup of fresh Rails and not so Rails brew. If you’d like to send in a link, please use this page.
Rails
- Avoid exception_notification message floods.
- Rails Edge - making fixtures easier.
- Showing off data on a timeline - using the amazing Timeline DHTML component in Rails.
- Simplify your ActionMailer configuration with YAML.
Web Development
Another cup of fresh Rails and not so Rails brew. If you’d like to send in a link, please use this page.
Rails
- Plain Text RSpec Stories on Rails.
- Story Runner in Plain English.
- In-browser editor for RSpec stories.
- A Ruby on Rails OpenID Server.
Software
I looked all over and couldn’t find a bash script which could check and if missing install a list of gems. I had to hack my own up:
GEMS=( `cat gems.txt` ) # gems.txt has one gem name per line
for gem in "${GEMS[@]}"; do
found=`gem list $gem | grep -i $gem`
if [ "$found" != "" ]; then
parts=( $found )
echo "Found ${parts[0]} ${parts[1]}"
continue
fi
echo "---------------------------"
echo "Installing $gem"
sudo gem install $gem -y
echo "---------------------------"
done
Another cup of fresh Rails and not so Rails brew. If you’d like to send in a link, please use this page.
GUI edition
- Shoes - a lightweight Ruby interface to Windows, Linux and OSX applications. Best for small utilities. (into one, two and three by Juxie)
- Cheri::Swing - a full blow JRuby builder style interface to Java’s Swing.
- Ruby-GNOME2 - bindings for the GNOME 2.0 development environment.
- WxRuby - allows writing native-looking desktop applications for Windows, OS X, Linux GTK and other platforms. Probably the most complete GUI package.
- FXRuby - provides an interface to the FOX GUI library.
- RubyCocoa - OSX bindings for Ruby.
- VisualuRuby - Windows bindings for Ruby.
- Linux GUI Programming with Ruby - a short video demonstrating Glade based Linux GUI with Ruby.
Another cup of fresh Rails and not so Rails brew. If you’d like to send in a link, please use this page.
Rails
- Ruby 101: Naming Conventions.
- Zero to Riding the Rails in Four Months.
- Default Order Plugin - order_by :fields => [’last_name’, ‘first_name’], :mode => :desc
Ruby
- Mailtrap - dummy SMTP server for testing your emails.
- New netbeans update from Oct 12th.
Web Development
Sometimes you want to focus on just one example in your RSpec file. I had to do this quite often in the last 3 days and I got tired of commenting out stuff back and forth. So, I give you “it_only” example.
module Spec
module DSL
module BehaviourEval
module ModuleMethods
def it(description = :__generate_description, opts = {}, &block)
return if @it_only_found
examples << Example.new(description, opts, &block)
end
# Same as +it+ only blocks all other examples making this the
# only example that would run.
def it_only(description = :__generate_description, opts = {}, &block)
@it_only_found = true
@examples = [Example.new(description, opts, &block)]
end
end
end
end
end
Drop this into your spec_helper.rb and now if you want to focus on a single example, just make it “it_only” instead of “it“.
Another cup of fresh Rails and not so Rails brew. If you’d like to send in a link, please use this page.
Ruby
Web Development
Misc
Another cup of fresh Rails and not so Rails brew. If you’d like to send in a link, please use this page.
Rails
- Multiple Database Connections in Ruby on Rails.
- Payment Processing in Rails.
- Mocking/Stubbing partials and helper methods in RSpec view specs.
- Getting started with Autotest - Continuous Testing.
Web Development
Another cup of fresh Rails and not so Rails brew. If you’d like to send in a link, please use this page.
Rails
- jMaki on Rails screen cast.
- Rails 1.2.4: Maintenance release.
- “How I Learned to Love Testing” presentation.
- deepTest - running test in multiple threads for performance sake (via).
Ruby
- Many Skinny Methods - readability vs. number of lines.
- Removing elements with Hpricot
Web Development
- Releasing the Source Code for the .NET Framework Libraries - this is a pretty radical move from Microsoft. Unfortunately it’ll be under MS-RL license.
I’ve recently started experimenting with using Ubuntu for my Ruby development. Some of the Gems like JSON and HPricot have extension compilation step which doesn’t work on a default Ubuntu installation.
Here are a few steps that you need to get it to work.
- Open up Synaptic Package Manager from System > Preferences
- Search for “ruby1.8-dev”, right click and check “Mark for installation”
- Search for “build-essential” and mark it for installation as well
- Click “Apply” in the toolbar
After the update is finished, you should be able to install Gems which require native extensions compilation.

