Dr Nic's Journey

The small things in my day so I don't clutter the Dr Nic site.

Areas of interest: Ruby, Rails, JavaScript, Editors, and my life in general.

Subscribe:

Dr Nic Blog:

Hot Damn - I’ve never seen the Ruby Ruby Ruby video clip before. Its hot diggity. Kaiser Chiefs - Ruby
Chasers APEC Motorcade Stunt in Sydney where they drove thru $60m security up to George Bush’s hotel (via astekcbe)

Testing code to the (incorrect) extreme


it "should validate_presence_of digits" do
   my_model.line(7).should_read "validates_presence_of :digits" 
end
- Jay Levitt (here)
Ethan and Mark, we’re very happy with Prototype and script.aculo.us at 37signals, but thanks for your concern. Prototype has served me quite well since I created it in early 2005. SamS @ 37signals

Packaging a rails/ruby app

Want to send a copy of your Rails app to someone? Our old friend Rake comes to the rescue. Stick this in your Rails app’s Rakefile:

require 'rake/packagetask'
require 'rake/clean'

NAME    = File.basename(File.expand_path(File.dirname(File.expand_path(__FILE__)))) unless defined? NAME
VERS = ENV['VERSION'] || begin
  `svn info` =~ /Revision: (\d+)/
  $1
end unless defined? VERS
CLEAN.include('pkg')

Rake::PackageTask.new(NAME, VERS) do |p|
  p.need_tar = true
  p.need_zip = true
  p.package_files.include('**/*')
  p.package_files.exclude(".svn")
  p.package_files.exclude("vendor/rails")
end
Now run rake package and it will generate tar and zip files, without edge rails included (tell them to install it themself).
Yesterday, … I tried to install the god gem. It asked me if I wanted to install the daemons gem which is a dependency, and proceeded to do so. Shortly after that the power failed, maybe the name of that gem is sacreligious after all. Rick DeNatale on RubyGems-Dev list