/usr/lib/ruby/vendor_ruby/mina/rvm.rb is in mina 0.3.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | # # Modules: RVM
# Adds settings and tasks for managing [RVM] installations.
#
# [rvm]: http://rvm.io
#
# require 'mina/rvm'
#
# ## Common usage
#
# task :environment do
# invoke :'rvm:use[ruby-1.9.3-p125@gemset_name]'
# end
#
# task :deploy => :environment do
# ...
# end
# ## Settings
# Any and all of these settings can be overriden in your `deploy.rb`.
# ### rvm_path
# Sets the path to RVM.
#
# You can override this in your projects if RVM is installed in a different
# path, say, if you have a system-wide RVM install.
set_default :rvm_path, "$HOME/.rvm/scripts/rvm"
# ## Tasks
# ### rvm:use[]
# Uses a given RVM environment provided as an argument.
#
# This is usually placed in the `:environment` task.
#
# task :environment do
# invoke :'rvm:use[ruby-1.9.3-p125@gemset_name]'
# end
#
task :'rvm:use', :env do |t, args|
unless args[:env]
print_error "Task 'rvm:use' needs an RVM environment name as an argument."
print_error "Example: invoke :'rvm:use[ruby-1.9.2@default]'"
die
end
queue %{
echo "-----> Using RVM environment '#{args[:env]}'"
if [[ ! -s "#{rvm_path}" ]]; then
echo "! Ruby Version Manager not found"
echo "! If RVM is installed, check your :rvm_path setting."
exit 1
fi
source #{rvm_path}
#{echo_cmd %{rvm use "#{args[:env]}" --create}} || exit 1
}
end
# ### rvm:wrapper[]
# Creates a rvm wrapper for a given executable.
#
# This is usually placed in the `:setup` task.
#
# task ::setup => :environment do
# ...
# invoke :'rvm:wrapper[ruby-1.9.3-p125@gemset_name,wrapper_name,binary_name]'
# end
#
task :'rvm:wrapper', :env, :name, :bin do |t,args|
unless args[:env] && args[:name] && args[:bin]
print_error "Task 'rvm:wrapper' needs an RVM environment name, an wrapper name and the binary name as arguments"
print_error "Example: invoke :'rvm:wrapper[ruby-1.9.2@myapp,myapp,unicorn_rails]'"
die
end
queue %{
echo "-----> creating RVM wrapper '#{args[:name]}_#{args[:bin]}' using '#{args[:env]}'"
if [[ ! -s "#{rvm_path}" ]]; then
echo "! Ruby Version Manager not found"
echo "! If RVM is installed, check your :rvm_path setting."
exit 1
fi
source #{rvm_path}
#{echo_cmd %{rvm wrapper #{args[:env]} #{args[:name]} #{args[:bin]} }} || exit 1
}
end
|