Class: S3Deployer::Config
- Inherits:
-
Object
- Object
- S3Deployer::Config
- Defined in:
- lib/s3_deployer/config.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #apply_environment_settings! ⇒ Object
- #environment(name, &block) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
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
#env ⇒ Object (readonly)
Returns the value of attribute env.
3 4 5 |
# File 'lib/s3_deployer/config.rb', line 3 def env @env end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
3 4 5 |
# File 'lib/s3_deployer/config.rb', line 3 def revision @revision end |
#version ⇒ Object (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 |