Skip to content

Commit

Permalink
Dev: improved thor task
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed May 12, 2011
1 parent bcaf04c commit a6cd192
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Thorfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
class Gemfile < Thor
desc "use VERSION", "installs the bundle using gemfiles/rails-VERSION"
def use(version)
gemfile = "--gemfile gemfiles/rails-#{version}"
say `bundle install #{gemfile} --binstubs`
say `bundle #{gemfile} update rails` unless version =~ /^\d\.\d\.\d/
"gemfiles/rails-#{version}".tap do |gemfile|
ENV["BUNDLE_GEMFILE"] = File.expand_path(gemfile)
say "Using #{gemfile}"
end
"bundle install --binstubs".tap do |m|
say m
system m
end
unless version =~ /^\d\.\d\.\d/
"bundle update rails".tap do |m|
say m
system m
end
end
say `ln -s gemfiles/bin` unless File.exist?('bin')
`echo rails-#{version} > ./.gemfile`
end
Expand Down

0 comments on commit a6cd192

Please sign in to comment.