Permalink
Browse files

Clarify the usage of Shell::Helpers.

  • Loading branch information...
1 parent 905f0b3 commit 4fba900e6eb8e8e36373ef2aab6971e5f05d1c1a @martinemde martinemde committed Apr 27, 2012
@@ -78,7 +78,7 @@ def check_for_ey_config
if gemfile? && lockfile
configured_services = parse_configured_services
if !configured_services.empty? && !lockfile.has_ey_config?
- warning "Gemfile.lock does not contain ey_config. Add it to get EY::Config access to: #{configured_services.keys.join(', ')}."
+ shell.warning "Gemfile.lock does not contain ey_config. Add it to get EY::Config access to: #{configured_services.keys.join(', ')}."
end
end
end
@@ -89,7 +89,7 @@ def check_repository
if lockfile
shell.status "Gemfile.lock found."
unless lockfile.any_database_adapter?
- warning <<-WARN
+ shell.warning <<-WARN
Gemfile.lock does not contain a recognized database adapter.
A database-adapter gem such as mysql2, mysql, or do_mysql was expected.
This can prevent applications that use MySQL or PostreSQL from booting.
@@ -99,7 +99,7 @@ def check_repository
WARN
end
else
- warning <<-WARN
+ shell.warning <<-WARN
Gemfile.lock is missing!
You can get different versions of gems in production than what you tested with.
You can get different versions of gems on every deployment even if your Gemfile hasn't changed.
@@ -319,13 +319,13 @@ def setup_services
begin
sudo(services_command_check)
rescue StandardError => e
- info "Could not setup services. Upgrade your environment to get services configuration."
+ shell.info "Could not setup services. Upgrade your environment to get services configuration."
return
end
sudo(services_setup_command)
rescue StandardError => e
unless previously_configured_services.empty?
- warning <<-WARNING
+ shell.warning <<-WARNING
External services configuration not updated. Using previous version.
Deploy again if your services configuration appears incomplete or out of date.
#{e}
@@ -549,7 +549,7 @@ def write_system_version
def check_node_npm
if File.exist?("#{c.release_path}/package.json")
- info "~> package.json detected, installing npm packages"
+ shell.info "~> package.json detected, installing npm packages"
run "cd #{c.release_path} && npm install"
end
end
@@ -10,7 +10,7 @@ def compile_assets
if rails_version
shell.status "Precompiling assets for rails v#{rails_version}"
else
- warning "Precompiling assets even though Rails was not bundled."
+ shell.warning "Precompiling assets even though Rails was not bundled."
end
run(cmd)
end
@@ -3,8 +3,6 @@
module EY
module Serverside
class Task
- include EY::Serverside::Shell::Helpers
-
attr_reader :config, :shell
alias :c :config
View
@@ -240,6 +240,14 @@ def where_code_runs_with(code)
it "#current_role returns the first role" do
deploy_hook(:current_roles => %w(a b)).eval_hook('current_role').should == 'a'
end
+
+ it "has info, warning, debug, logged_system, and access to shell" do
+ deploy_hook.eval_hook('respond_to?(:info) ').should be_true
+ deploy_hook.eval_hook('respond_to?(:warning) ').should be_true
+ deploy_hook.eval_hook('respond_to?(:debug) ').should be_true
+ deploy_hook.eval_hook('respond_to?(:logged_system)').should be_true
+ deploy_hook.eval_hook('respond_to?(:shell) ').should be_true
+ end
end
end
end

0 comments on commit 4fba900

Please sign in to comment.