penchant/template/script/gemfile

17 lines
283 B
Plaintext
Raw Normal View History

2011-07-14 19:50:51 +00:00
#!/usr/bin/env ruby
2011-07-14 20:51:54 +00:00
if !File.file?('Gemfile.erb')
puts "Not using Gemfile.erb, exiting."
exit 0
end
2011-07-14 19:50:51 +00:00
require 'erb'
env = ARGV[0]
File.open('Gemfile', 'w') { |fh| fh.print ERB.new(File.read('Gemfile.erb')).result(binding) }
system %{bundle}
puts "Gemfile switched to #{env}"