Skip to content

Commit

Permalink
fix configuration deffering for requiring rvm/capistrano from a task, f…
Browse files Browse the repository at this point in the history
…ix #76
  • Loading branch information
mpapis committed Jul 9, 2013
1 parent bacfd9c commit 217b410
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/rvm/capistrano/base.rb
Expand Up @@ -3,7 +3,7 @@


rvm_with_capistrano do rvm_with_capistrano do


on :load do deffered_load do
_cset :rvm_shell do _cset :rvm_shell do
shell = File.join(rvm_bin_path, "rvm-shell") shell = File.join(rvm_bin_path, "rvm-shell")
ruby = fetch(:rvm_ruby_string_evaluated).strip ruby = fetch(:rvm_ruby_string_evaluated).strip
Expand Down Expand Up @@ -66,7 +66,7 @@


## not needed in base but are used in many extensions ## 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 # Let users set the install shell of their choice
_cset(:rvm_install_shell, :bash) _cset(:rvm_install_shell, :bash)
end end
Expand Down
2 changes: 1 addition & 1 deletion lib/rvm/capistrano/gemset_import_export.rb
Expand Up @@ -2,7 +2,7 @@


rvm_with_capistrano do rvm_with_capistrano do


on :load do deffered_load do


# Let users configure a path to export/import gemsets # Let users configure a path to export/import gemsets
_cset(:rvm_gemset_path, "#{rvm_path}/gemsets") _cset(:rvm_gemset_path, "#{rvm_path}/gemsets")
Expand Down
9 changes: 9 additions & 0 deletions lib/rvm/capistrano/helpers/base.rb
@@ -1,4 +1,13 @@
module Capistrano module Capistrano
class Configuration
def deffered_load(&block)
if current_task
instance_eval(&block)
else
on(:load, &block)
end
end
end
end end


def rvm_with_capistrano(&block) def rvm_with_capistrano(&block)
Expand Down
2 changes: 1 addition & 1 deletion lib/rvm/capistrano/helpers/rvm_if_sudo.rb
Expand Up @@ -2,7 +2,7 @@


rvm_with_capistrano do rvm_with_capistrano do


on :load do deffered_load do
# Default sudo state # Default sudo state
_cset(:rvm_install_with_sudo, false) _cset(:rvm_install_with_sudo, false)
end end
Expand Down
2 changes: 1 addition & 1 deletion lib/rvm/capistrano/install_pkgs.rb
Expand Up @@ -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'." 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. # Additional rvm packages to install.
_cset(:rvm_install_pkgs, []) _cset(:rvm_install_pkgs, [])
Expand Down
2 changes: 1 addition & 1 deletion lib/rvm/capistrano/install_ruby.rb
Expand Up @@ -5,7 +5,7 @@


rvm_with_capistrano do rvm_with_capistrano do


on :load do deffered_load do


# Let users set the (re)install for ruby. # Let users set the (re)install for ruby.
_cset(:rvm_install_ruby, :install) _cset(:rvm_install_ruby, :install)
Expand Down
2 changes: 1 addition & 1 deletion lib/rvm/capistrano/install_rvm.rb
Expand Up @@ -4,7 +4,7 @@


rvm_with_capistrano do rvm_with_capistrano do


on :load do deffered_load do


# Let users set the install type of their choice. # Let users set the install type of their choice.
_cset(:rvm_install_type, :stable) _cset(:rvm_install_type, :stable)
Expand Down
2 changes: 1 addition & 1 deletion lib/rvm/capistrano/selector.rb
@@ -1,7 +1,7 @@
require 'rvm/capistrano/base' require 'rvm/capistrano/base'


rvm_with_capistrano do rvm_with_capistrano do
on :load do deffered_load do


# conflicts with rvm/capistrano/selector_mixed # conflicts with rvm/capistrano/selector_mixed
unless fetch(:rvm_require_role,nil).nil? unless fetch(:rvm_require_role,nil).nil?
Expand Down
2 changes: 1 addition & 1 deletion lib/rvm/capistrano/version.rb
@@ -1,5 +1,5 @@
module RVM module RVM
class Capistrano class Capistrano
VERSION="1.4.0.rc2" VERSION="1.4.0.rc3"
end end
end end

0 comments on commit 217b410

Please sign in to comment.