Class: Deploy::S3::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/deploy/s3/configuration.rb

Instance Method Summary collapse

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

#appsObject



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_foldersObject



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