Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed Rails 3 generator not to append cap hooks for vlad deploys

  • Loading branch information...
commit 6ed1a8081bf2a063e6953c3b6bfafe9deec8f24d 1 parent d072ff3
Joe Ferris jferris authored
4 features/rails.feature
@@ -104,5 +104,5 @@ Feature: Install the Gem in a Rails application
104 104 And I configure my application to require the "hoptoad_notifier" gem
105 105 And I run "touch config/deploy.rb"
106 106 And I run "rm Capfile"
107   - And I run "script/generate hoptoad -k myapikey"
108   - Then "config/deploy.rb" should not contain text of "generators/hoptoad/templates/capistrano_hook.rb"
  107 + And I run the hoptoad generator with "-k myapikey"
  108 + Then "config/deploy.rb" should not contain "capistrano"
7 features/step_definitions/rails_application_steps.rb
@@ -274,3 +274,10 @@ def initialize(*args)
274 274 file.write(content)
275 275 end
276 276 end
  277 +
  278 +Then /^"([^\"]*)" should not contain "([^\"]*)"$/ do |file_path, text|
  279 + actual_text = IO.read(File.join(RAILS_ROOT, file_path))
  280 + if actual_text.include?(text)
  281 + raise "Didn't expect text:\n#{actual_text}\nTo include:\n#{text}"
  282 + end
  283 +end
2  lib/rails_generators/hoptoad/hoptoad_generator.rb
@@ -33,7 +33,7 @@ def ensure_plugin_is_not_present
33 33 end
34 34
35 35 def append_capistrano_hook
36   - if File.exists?('config/deploy.rb')
  36 + if File.exists?('config/deploy.rb') && File.exists?('Capfile')
37 37 append_file('config/deploy.rb', <<-HOOK)
38 38
39 39 require 'config/boot'

0 comments on commit 6ed1a80

Please sign in to comment.
Something went wrong with that request. Please try again.