Skip to content

Commit

Permalink
Merge pull request #41 from cheald/master
Browse files Browse the repository at this point in the history
Allow for overriding of RVM roles
  • Loading branch information
kirs committed Jan 24, 2014
2 parents 6aa7cb9 + e5b9771 commit e8c3b81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,16 @@ or

set :rvm_ruby_version, '2.0.0@mygemset'


### Custom RVM path: `:rvm_custom_path`

If you have a custom RVM setup with a different path then expected, you have
to define a custom RVM path to tell capistrano where it is.

### Custom Roles: `:rvm_roles`

If you want to restrict RVM usage to a subset of roles, you may set `:rvm_roles`:

set :rvm_roles, [:app, :web]

## Restrictions

Expand Down
4 changes: 2 additions & 2 deletions lib/capistrano/tasks/rvm.rake
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ RVM_USER_PATH = "~/.rvm"
namespace :rvm do
desc "Prints the RVM and Ruby version on the target host"
task :check do
on roles(:all) do
on roles(fetch(:rvm_roles, :all)) do
puts capture(:rvm, "version")
puts capture(:rvm, "current")
puts capture(:ruby, "--version")
end
end

task :hook do
on roles(:all) do
on roles(fetch(:rvm_roles, :all)) do
rvm_path = fetch(:rvm_custom_path)
rvm_path ||= case fetch(:rvm_type)
when :auto
Expand Down

0 comments on commit e8c3b81

Please sign in to comment.