Class: ForgeCLI::BasePostHooks
Instance Method Summary
collapse
Methods inherited from PostHooks
#initialize, run!
Instance Method Details
#fix_gemfile ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/forge-cli/modules/base/post_hooks.rb', line 12
def fix_gemfile
if 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
|
#run! ⇒ Object
3
4
5
6
7
8
9
10
|
# File 'lib/forge-cli/modules/base/post_hooks.rb', line 3
def run!
STDOUT.puts "Installing Routes..."
ri = ForgeCLI::RouteInstaller.new(@app, module_path)
ri.install_routes
ri.install_routes(:forge)
fix_gemfile
end
|