Sha256: b25e68f95440615de02ef2870370ddc7ec952c17139c1a00998a9aa2da666c7b
Contents?: true
Size: 859 Bytes
Versions: 13
Compression:
Stored size: 859 Bytes
Contents
module Sunzi module Cli::Capistrano extend self attr_accessor :env @env = {} 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 def set(key, value) @env[key] = value end def fetch(key, value = nil) if @env.has_key?(key) @env[key] else @env[key] = value end end def server(name, properties = {}) @env[:server] = {name: name}.merge(properties) end def method_missing(name, *args, &block) if caller.join.include? 'load_env' # do nothing else super end end end end
Version data entries
13 entries across 13 versions & 1 rubygems