12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/forge-cli/modules/base/post_hooks.rb', line 12
def fix_gemfile
if RUBY_VERSION.to_f > 1.9
gemfile_content = File.read(File.join(@app, 'Gemfile'))
new_content = gemfile_content.gsub("gem 'forge-rad'", "gem 'forge-rad20'")
File.open(File.join(@app, 'Gemfile'), 'w') do |f|
f.puts new_content
end
elsif RUBY_VERSION.to_f > 1.8
gemfile_content = File.read(File.join(@app, 'Gemfile'))
new_content = gemfile_content.gsub("gem 'capybara', '~> 2.0.0'", "gem 'capybara'")
new_content = gemfile_content.gsub("gem 'shoulda-matchers', '~> 2.0.0'", "gem 'shoulda-matchers'")
new_content = new_content.gsub("gem 'forge-rad'", "gem 'forge-rad19'")
File.open(File.join(@app, 'Gemfile'), 'w') do |f|
f.puts new_content
end
end
end
|