Class: S3Deployer::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/s3_deployer/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/s3_deployer/config.rb', line 5

def initialize
  @version = ENV["VERSION"] || ""
  @revision = ENV["REVISION"]
  @access_key_id = ENV["AWS_ACCESS_KEY_ID"]
  @secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"]
  
  @env = ENV["ENV"] || "production"
  @env_settings = {}
  colorize true
  time_zone "GMT"
  current_path "current"
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



3
4
5
# File 'lib/s3_deployer/config.rb', line 3

def env
  @env
end

#revisionObject (readonly)

Returns the value of attribute revision.



3
4
5
# File 'lib/s3_deployer/config.rb', line 3

def revision
  @revision
end

#versionObject (readonly)

Returns the value of attribute version.



3
4
5
# File 'lib/s3_deployer/config.rb', line 3

def version
  @version
end

Instance Method Details

#apply_environment_settings!Object



33
34
35
36
37
# File 'lib/s3_deployer/config.rb', line 33

def apply_environment_settings!
  if @env_settings[@env.to_s]
    instance_eval(&@env_settings[@env.to_s])
  end
end

#environment(name, &block) ⇒ Object



29
30
31
# File 'lib/s3_deployer/config.rb', line 29

def environment(name, &block)
  @env_settings[name.to_s] = block
end