Permalink
Browse files

install_ruby? needs to be available outside the namespace

  • Loading branch information...
Arie committed Jan 16, 2013
1 parent 6672fae commit 326cc84e005a33f325d2bc833c1568178703c445
Showing with 21 additions and 21 deletions.
  1. +21 −21 lib/roundsman/capistrano.rb
@@ -84,6 +84,27 @@ def ensure_roundsman_working_dir
end
end
+ def install_ruby?
+ installed_version = capture("ruby --version || true").strip
+ if installed_version.include?("not found")
+ logger.info "No version of Ruby could be found."
+ return true
+ end
+ required_version = fetch(:ruby_version).gsub("-", "")
+ if installed_version.include?(required_version)
+ if fetch(:care_about_ruby_version)
+ logger.info "Ruby #{installed_version} matches the required version: #{required_version}."
+ return false
+ else
+ logger.info "Already installed Ruby #{installed_version}, not #{required_version}. Set :care_about_ruby_version if you want to fix this."
+ return false
+ end
+ else
+ logger.info "Ruby version mismatch. Installed version: #{installed_version}, required is #{required_version}"
+ return true
+ end
+ end
+
namespace :install do
@@ -147,27 +168,6 @@ def ensure_supported_distro
end
end
- def install_ruby?
- installed_version = capture("ruby --version || true").strip
- if installed_version.include?("not found")
- logger.info "No version of Ruby could be found."
- return true
- end
- required_version = fetch(:ruby_version).gsub("-", "")
- if installed_version.include?(required_version)
- if fetch(:care_about_ruby_version)
- logger.info "Ruby #{installed_version} matches the required version: #{required_version}."
- return false
- else
- logger.info "Already installed Ruby #{installed_version}, not #{required_version}. Set :care_about_ruby_version if you want to fix this."
- return false
- end
- else
- logger.info "Ruby version mismatch. Installed version: #{installed_version}, required is #{required_version}"
- return true
- end
- end
-
end
namespace :chef do

0 comments on commit 326cc84

Please sign in to comment.