Skip to content
Browse files

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

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

0 comments on commit 6ed1a80

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