module Sunzi::Cli::Capistrano
Attributes
env[RW]
Public Instance Methods
fetch(key, value = nil)
click to toggle source
# File lib/sunzi/cli/capistrano.rb, line 20 def fetch(key, value = nil) if @env.has_key?(key) @env[key] else @env[key] = value end end
load_env(stage)
click to toggle source
# File lib/sunzi/cli/capistrano.rb, line 8 def load_env(stage) deploy_path = File.expand_path('config/deploy.rb') stage_path = File.expand_path("config/deploy/#{stage}.rb") instance_eval(File.read(deploy_path), deploy_path) instance_eval(File.read(stage_path), stage_path) @env = HashWithIndifferentAccess.new(@env) end
method_missing(name, *args, &block)
click to toggle source
Calls superclass method
# File lib/sunzi/cli/capistrano.rb, line 28 def method_missing(name, *args, &block) if caller.join.include? 'load_env' # do nothing else super end end
set(key, value)
click to toggle source
# File lib/sunzi/cli/capistrano.rb, line 16 def set(key, value) @env[key] = value end