class ShootsDeploy::Configuration
Constants
- CONFIG_FILE
Attributes
access_key[RW]
main_bucket_name[RW]
region[RW]
root_domain[RW]
secondary_bucket_name[RW]
secret_key[RW]
subdomain[RW]
subdomain_url[RW]
Public Class Methods
initialize_from_file()
click to toggle source
# File lib/shoots_deploy/configuration.rb, line 15 def self.initialize_from_file configs = YAML.load_file(CONFIG_FILE) new({ main_bucket_name: configs['bucket_name'], region: configs['bucket_region'], secret_key: configs['secret_key'], access_key: configs['access_key'] }) end
new(options = {})
click to toggle source
# File lib/shoots_deploy/configuration.rb, line 8 def initialize(options = {}) @main_bucket_name = options[:main_bucket_name] @region = options[:region] @secret_key = options[:secret_key] @access_key = options[:access_key] end
Public Instance Methods
create_config_file()
click to toggle source
# File lib/shoots_deploy/configuration.rb, line 25 def create_config_file config_file = File.new(CONFIG_FILE, "w") config_file.puts("bucket_name: '#{main_bucket_name}'\nbucket_region: '#{region}'\naccess_key: '#{access_key}'\nsecret_key: '#{secret_key}'\n") end
s3_website_endpoint()
click to toggle source
# File lib/shoots_deploy/configuration.rb, line 30 def s3_website_endpoint "#{main_bucket_name}.s3-website-#{region}.amazonaws.com" end