rvm-capistrano 1.3.0.rc3 → 1.3.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
@@ -100,6 +100,23 @@ module Capistrano
100
100
  EOF
101
101
  end
102
102
 
103
+ def with_rvm_group(command)
104
+ case rvm_type
105
+ when :root, :system
106
+ "sg rvm -c \"#{command}\""
107
+ else
108
+ command
109
+ end
110
+ end
111
+
112
+ def rvm_task(name,&block)
113
+ if fetch(:rvm_require_role,nil).nil?
114
+ task name, block
115
+ else
116
+ task name, :roles => fetch(:rvm_require_role), block
117
+ end
118
+ end
119
+
103
120
  desc <<-EOF
104
121
  Install RVM of the given choice to the server.
105
122
  By default RVM "stable" is installed, change with:
@@ -110,7 +127,7 @@ module Capistrano
110
127
 
111
128
  set :rvm_install_shell, :zsh
112
129
  EOF
113
- task :install_rvm do
130
+ rvm_task :install_rvm, :roles => :rvm do
114
131
  command_fetch = "curl -L get.rvm.io"
115
132
  command_install = case rvm_type
116
133
  when :root, :system
@@ -130,15 +147,6 @@ module Capistrano
130
147
  run_silent_curl "#{command_fetch} | #{command_install}"
131
148
  end
132
149
 
133
- def with_rvm_group(command)
134
- case rvm_type
135
- when :root, :system
136
- "sg rvm -c \"#{command}\""
137
- else
138
- command
139
- end
140
- end
141
-
142
150
  desc <<-EOF
143
151
  Install RVM ruby to the server, create gemset if needed.
144
152
  By default ruby is installed, you can reinstall with:
@@ -153,7 +161,7 @@ module Capistrano
153
161
 
154
162
  set :rvm_install_shell, :zsh
155
163
  EOF
156
- task :install_ruby do
164
+ rvm_task :install_ruby, :roles => :rvm do
157
165
  ruby, gemset = rvm_ruby_string.to_s.strip.split /@/
158
166
  if %w( release_path default ).include? "#{ruby}"
159
167
  raise "ruby can not be installed when using :rvm_ruby_string => :#{ruby}"
@@ -178,14 +186,14 @@ module Capistrano
178
186
 
179
187
  Full list of packages available at https://rvm.io/packages/ or by running 'rvm pkg'.
180
188
  EOF
181
- task :install_pkgs do
189
+ rvm_task :install_pkgs, :roles => :rvm do
182
190
  rvm_install_pkgs.each do |pkg|
183
191
  run "#{File.join(rvm_bin_path, "rvm")} pkg install #{pkg}", :shell => "#{rvm_install_shell}"
184
192
  end
185
193
  end
186
194
 
187
195
  desc "Create gemset"
188
- task :create_gemset do
196
+ rvm_task :create_gemset, :roles => :rvm do
189
197
  ruby, gemset = rvm_ruby_string.to_s.strip.split /@/
190
198
  if %w( release_path default ).include? "#{ruby}"
191
199
  raise "gemset can not be created when using :rvm_ruby_string => :#{ruby}"
@@ -204,7 +212,7 @@ module Capistrano
204
212
 
205
213
  The gemset can be created with 'cap rvm:gemset_export'.
206
214
  EOF
207
- task :import_gemset do
215
+ rvm_task :import_gemset, :roles => :rvm do
208
216
  ruby, gemset = rvm_ruby_string.to_s.strip.split /@/
209
217
  if %w( release_path default ).include? "#{ruby}"
210
218
  raise "gemset can not be imported when using :rvm_ruby_string => :#{ruby}"
@@ -223,7 +231,7 @@ module Capistrano
223
231
 
224
232
  The gemset can be imported with 'cap rvm:gemset_import'.
225
233
  EOF
226
- task :export_gemset do
234
+ rvm_task :export_gemset, :roles => :rvm do
227
235
  ruby, gemset = rvm_ruby_string.to_s.strip.split /@/
228
236
  if %w( release_path default ).include? "#{ruby}"
229
237
  raise "gemset can not be imported when using :rvm_ruby_string => :#{ruby}"
@@ -235,12 +243,12 @@ module Capistrano
235
243
  end
236
244
 
237
245
  desc "Install a gem, 'cap rvm:install_gem GEM=my_gem'."
238
- task :install_gem do
246
+ rvm_task :install_gem, :roles => :rvm do
239
247
  run "#{File.join(rvm_bin_path, "rvm")} #{rvm_ruby_string} do gem install #{ENV['GEM']}", :shell => "#{rvm_install_shell}"
240
248
  end
241
249
 
242
250
  desc "Uninstall a gem, 'cap rvm:uninstall_gem GEM=my_gem'."
243
- task :uninstall_gem do
251
+ rvm_task :uninstall_gem, :roles => :rvm do
244
252
  run "#{File.join(rvm_bin_path, "rvm")} #{rvm_ruby_string} do gem uninstall --no-executables #{ENV['GEM']}", :shell => "#{rvm_install_shell}"
245
253
  end
246
254
 
@@ -1,5 +1,5 @@
1
1
  module RVM
2
2
  class Capistrano
3
- VERSION="1.3.0.rc3"
3
+ VERSION="1.3.0.rc4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rvm-capistrano
3
3
  version: !ruby/object:Gem::Version
4
- hash: 924436459
4
+ hash: -765880092
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
9
  - 0
10
10
  - rc
11
- - 3
12
- version: 1.3.0.rc3
11
+ - 4
12
+ version: 1.3.0.rc4
13
13
  platform: ruby
14
14
  authors:
15
15
  - Wayne E. Seguin