Class: Deploy::S3::Configuration
- Inherits:
-
Object
- Object
- Deploy::S3::Configuration
- Defined in:
- lib/deploy/s3/configuration.rb
Instance Method Summary collapse
- #apps ⇒ Object
- #config_bucket_for(name) ⇒ Object
- #created_folders ⇒ Object
-
#initialize(config_bucket_name) ⇒ Configuration
constructor
A new instance of Configuration.
- #verify! ⇒ Object
Constructor Details
#initialize(config_bucket_name) ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 |
# File 'lib/deploy/s3/configuration.rb', line 5 def initialize(config_bucket_name) @config_bucket_name = config_bucket_name end |
Instance Method Details
#apps ⇒ Object
17 18 19 20 |
# File 'lib/deploy/s3/configuration.rb', line 17 def apps fail "Asked for app list without verifying. It will be wrong." if !@verified @apps ||= app_names end |
#config_bucket_for(name) ⇒ Object
26 27 28 |
# File 'lib/deploy/s3/configuration.rb', line 26 def config_bucket_for(name) app_buckets.detect { |app| app.key == name + '/' } end |
#created_folders ⇒ Object
22 23 24 |
# File 'lib/deploy/s3/configuration.rb', line 22 def created_folders @created_folders ||= [] end |
#verify! ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/deploy/s3/configuration.rb', line 9 def verify! unless config_bucket.exists? && objects.count > 0 fail "Configuration bucket #{@config_bucket_name} not found or empty." end enforce_valid_app_paths! @verified = true end |