Browse files

Adding a usage message to install.rb script

Previously, invoking the install.rb script with zero arguments
caused it to attempt to install all gems without a version
suffix, which would fail spectacularly. Failing gracefully with
a usage message is more helpful to a first-time user.
  • Loading branch information...
1 parent a896609 commit 66258c0e48ed5cf26641a3096272a272611a783c @timraymond timraymond committed Jan 3, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 install.rb
5 install.rb
@@ -1,5 +1,10 @@
version = ARGV.pop
+if version.nil?
+ puts "Usage: ruby install.rb version"
+ exit(64)
%w( activesupport activemodel activerecord actionpack actionmailer railties ).each do |framework|
puts "Installing #{framework}..."
`cd #{framework} && gem build #{framework}.gemspec && gem install #{framework}-#{version}.gem --local --no-ri --no-rdoc && rm #{framework}-#{version}.gem`

0 comments on commit 66258c0

Please sign in to comment.