rvm-capistrano 1.3.0.rc8 → 1.3.0.rc9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  module RVM
2
2
  class Capistrano
3
- VERSION="1.3.0.rc8"
3
+ VERSION="1.3.0.rc9"
4
4
  end
5
5
  end
@@ -10,9 +10,9 @@ module Capistrano
10
10
  end
11
11
  end
12
12
 
13
- set :rvm_shell do
13
+ _cset :rvm_shell do
14
14
  shell = File.join(rvm_bin_path, "rvm-shell")
15
- ruby = rvm_ruby_string.to_s.strip
15
+ ruby = fetch(:rvm_ruby_string_evaluated).strip
16
16
  case ruby
17
17
  when "release_path"
18
18
  shell = "rvm_path=#{rvm_path} #{shell} --path '#{release_path}'"
@@ -26,7 +26,7 @@ module Capistrano
26
26
  shell
27
27
  end
28
28
  if fetch(:rvm_require_role,nil).nil?
29
- set :default_shell, fetch(:rvm_shell)
29
+ _cset :default_shell, fetch(:rvm_shell)
30
30
  else
31
31
  class << self
32
32
  def run(cmd, options={}, &block)
@@ -83,11 +83,19 @@ module Capistrano
83
83
  end
84
84
  end
85
85
 
86
+ set :rvm_ruby_string_evaluated, do
87
+ value = fetch(:rvm_ruby_string, :default)
88
+ if value.to_sym == :local
89
+ value = ENV['GEM_HOME'].gsub(/.*\//,"")
90
+ end
91
+ value.to_s
92
+ end
93
+
86
94
  # Let users configure a path to export/import gemsets
87
95
  _cset(:rvm_gemset_path, "#{rvm_path}/gemsets")
88
96
 
89
97
  # Use the default ruby on the server, by default :)
90
- _cset(:rvm_ruby_string, "default")
98
+ _cset(:rvm_ruby_string, :default)
91
99
 
92
100
  # Default sudo state
93
101
  _cset(:rvm_install_with_sudo, false)
@@ -189,7 +197,7 @@ module Capistrano
189
197
  set :rvm_install_shell, :zsh
190
198
  EOF
191
199
  rvm_task :install_ruby do
192
- ruby, gemset = rvm_ruby_string.to_s.strip.split /@/
200
+ ruby, gemset = fetch(:rvm_ruby_string_evaluated).to_s.strip.split /@/
193
201
  if %w( release_path default ).include? "#{ruby}"
194
202
  raise "ruby can not be installed when using :rvm_ruby_string => :#{ruby}"
195
203
  else
@@ -221,7 +229,7 @@ module Capistrano
221
229
 
222
230
  desc "Create gemset"
223
231
  rvm_task :create_gemset do
224
- ruby, gemset = rvm_ruby_string.to_s.strip.split /@/
232
+ ruby, gemset = fetch(:rvm_ruby_string_evaluated).to_s.strip.split /@/
225
233
  if %w( release_path default ).include? "#{ruby}"
226
234
  raise "gemset can not be created when using :rvm_ruby_string => :#{ruby}"
227
235
  else
@@ -240,12 +248,12 @@ module Capistrano
240
248
  The gemset can be created with 'cap rvm:gemset_export'.
241
249
  EOF
242
250
  rvm_task :import_gemset do
243
- ruby, gemset = rvm_ruby_string.to_s.strip.split /@/
251
+ ruby, gemset = fetch(:rvm_ruby_string_evaluated).to_s.strip.split /@/
244
252
  if %w( release_path default ).include? "#{ruby}"
245
253
  raise "gemset can not be imported when using :rvm_ruby_string => :#{ruby}"
246
254
  else
247
255
  if gemset
248
- run "#{File.join(rvm_bin_path, "rvm-shell")} #{rvm_ruby_string} rvm gemset import #{File.join(rvm_gemset_path, "#{rvm_ruby_string}.gems")}", :shell => "#{rvm_install_shell}"
256
+ run "#{File.join(rvm_bin_path, "rvm-shell")} #{fetch(:rvm_ruby_string_evaluated)} rvm gemset import #{File.join(rvm_gemset_path, "#{fetch(:rvm_ruby_string_evaluated)}.gems")}", :shell => "#{rvm_install_shell}"
249
257
  end
250
258
  end
251
259
  end
@@ -259,24 +267,24 @@ module Capistrano
259
267
  The gemset can be imported with 'cap rvm:gemset_import'.
260
268
  EOF
261
269
  rvm_task :export_gemset do
262
- ruby, gemset = rvm_ruby_string.to_s.strip.split /@/
270
+ ruby, gemset = fetch(:rvm_ruby_string_evaluated).to_s.strip.split /@/
263
271
  if %w( release_path default ).include? "#{ruby}"
264
272
  raise "gemset can not be imported when using :rvm_ruby_string => :#{ruby}"
265
273
  else
266
274
  if gemset
267
- run "#{File.join(rvm_bin_path, "rvm-shell")} #{rvm_ruby_string} rvm gemset export > #{File.join(rvm_gemset_path, "#{rvm_ruby_string}.gems")}", :shell => "#{rvm_install_shell}"
275
+ run "#{File.join(rvm_bin_path, "rvm-shell")} #{fetch(:rvm_ruby_string_evaluated)} rvm gemset export > #{File.join(rvm_gemset_path, "#{fetch(:rvm_ruby_string_evaluated)}.gems")}", :shell => "#{rvm_install_shell}"
268
276
  end
269
277
  end
270
278
  end
271
279
 
272
280
  desc "Install a gem, 'cap rvm:install_gem GEM=my_gem'."
273
281
  rvm_task :install_gem do
274
- run "#{File.join(rvm_bin_path, "rvm")} #{rvm_ruby_string} do gem install #{ENV['GEM']}", :shell => "#{rvm_install_shell}"
282
+ run "#{File.join(rvm_bin_path, "rvm")} #{fetch(:rvm_ruby_string_evaluated)} do gem install #{ENV['GEM']}", :shell => "#{rvm_install_shell}"
275
283
  end
276
284
 
277
285
  desc "Uninstall a gem, 'cap rvm:uninstall_gem GEM=my_gem'."
278
286
  rvm_task :uninstall_gem do
279
- run "#{File.join(rvm_bin_path, "rvm")} #{rvm_ruby_string} do gem uninstall --no-executables #{ENV['GEM']}", :shell => "#{rvm_install_shell}"
287
+ run "#{File.join(rvm_bin_path, "rvm")} #{fetch(:rvm_ruby_string_evaluated)} do gem uninstall --no-executables #{ENV['GEM']}", :shell => "#{rvm_install_shell}"
280
288
  end
281
289
 
282
290
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rvm-capistrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0.rc8
4
+ version: 1.3.0.rc9
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: