lib/appsignal/cli/install.rb in appsignal-1.3.5 vs lib/appsignal/cli/install.rb in appsignal-1.3.6.beta.1

- old
+ new

@@ -91,15 +91,10 @@ puts " Sinatra requires some manual configuration." puts " Add this line beneath require 'sinatra':" puts puts " require 'appsignal/integrations/sinatra'" press_any_key - puts "Configure subclass apps" - puts " If your app is a subclass of Sinatra::Base you need to use this middleware:" - puts - puts " use Appsignal::Rack::SinatraInstrumentation" - press_any_key done_notice end def install_for_padrino(config) puts 'Installing for Padrino' @@ -134,10 +129,25 @@ puts " http://docs.appsignal.com/getting-started/supported-frameworks.html#grape" press_any_key done_notice end + def install_for_capistrano + capfile = File.join(Dir.pwd, 'Capfile') + return unless File.exist?(capfile) + return if File.read(capfile) =~ %r{require ['|"]appsignal/capistrano} + + puts 'Installing for Capistrano' + print ' Adding AppSignal integration to Capfile' + File.open(capfile, 'a') do |f| + f.write "\nrequire 'appsignal/capistrano'\n" + end + periods + puts + puts + end + def colorize(text, color) return text if Gem.win_platform? color_code = case color when :red then 31 when :green then 32 @@ -185,19 +195,10 @@ end end end def configure(config, environments, name_overwritten) - deploy_rb_file = File.join(Dir.pwd, 'config/deploy.rb') - if File.exist?(deploy_rb_file) && (File.read(deploy_rb_file) =~ /require (\'|\").\/appsignal\/capistrano/).nil? - print 'Adding AppSignal integration to deploy.rb' - File.open(deploy_rb_file, 'a') do |f| - f.write "\nrequire 'appsignal/capistrano'\n" - end - periods - puts - puts - end + install_for_capistrano puts "How do you want to configure AppSignal?" puts " (1) a config file" puts " (2) environment variables" loop do