penchant/template/script/gemfile

17 lines
283 B
Ruby
Executable File

#!/usr/bin/env ruby
if !File.file?('Gemfile.erb')
puts "Not using Gemfile.erb, exiting."
exit 0
end
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}"