Permalink
Browse files

fix configuration deffering for requiring rvm/capistrano from a task,…

… fix #76
  • Loading branch information...
1 parent bacfd9c commit 217b41025af775362bdd1260815a9c044a77d0cf @mpapis mpapis committed Jul 9, 2013
@@ -3,7 +3,7 @@
rvm_with_capistrano do
- on :load do
+ deffered_load do
_cset :rvm_shell do
shell = File.join(rvm_bin_path, "rvm-shell")
ruby = fetch(:rvm_ruby_string_evaluated).strip
@@ -66,7 +66,7 @@
## not needed in base but are used in many extensions
- on :load do
+ deffered_load do
# Let users set the install shell of their choice
_cset(:rvm_install_shell, :bash)
end
@@ -2,7 +2,7 @@
rvm_with_capistrano do
- on :load do
+ deffered_load do
# Let users configure a path to export/import gemsets
_cset(:rvm_gemset_path, "#{rvm_path}/gemsets")
@@ -1,4 +1,13 @@
module Capistrano
+ class Configuration
+ def deffered_load(&block)
+ if current_task
+ instance_eval(&block)
+ else
+ on(:load, &block)
+ end
+ end
+ end
end
def rvm_with_capistrano(&block)
@@ -2,7 +2,7 @@
rvm_with_capistrano do
- on :load do
+ deffered_load do
# Default sudo state
_cset(:rvm_install_with_sudo, false)
end
@@ -4,7 +4,7 @@
warn "task 'rvm:install_pkgs' is deprecated, please read about autolibs => http://rvm.io/rvm/autolibs especially check the autolibs mode 'rvm_pkg'."
- on :load do
+ deffered_load do
# Additional rvm packages to install.
_cset(:rvm_install_pkgs, [])
@@ -5,7 +5,7 @@
rvm_with_capistrano do
- on :load do
+ deffered_load do
# Let users set the (re)install for ruby.
_cset(:rvm_install_ruby, :install)
@@ -4,7 +4,7 @@
rvm_with_capistrano do
- on :load do
+ deffered_load do
# Let users set the install type of their choice.
_cset(:rvm_install_type, :stable)
@@ -1,7 +1,7 @@
require 'rvm/capistrano/base'
rvm_with_capistrano do
- on :load do
+ deffered_load do
# conflicts with rvm/capistrano/selector_mixed
unless fetch(:rvm_require_role,nil).nil?
@@ -1,5 +1,5 @@
module RVM
class Capistrano
- VERSION="1.4.0.rc2"
+ VERSION="1.4.0.rc3"
end
end

0 comments on commit 217b410

Please sign in to comment.