Class: DerivativeRodeo::Configuration
- Inherits:
-
Object
- Object
- DerivativeRodeo::Configuration
- Defined in:
- lib/derivative_rodeo/configuration.rb
Overview
This class is responsible for the consistent configuration of the “application” that leverages the DerivativeRodeo.
This configuration helps set defaults for storage locations and generators.
Instance Attribute Summary collapse
AWS S3 Configuration collapse
-
#s3 ⇒ String
Various AWS items for StorageLocations::S3Location.
Class Method Summary collapse
-
.aws_config(prefix:, name:, default: nil) ⇒ Object
Allows AWS configuration to be set via environment variables by declairing them in the configuration class as follows:.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize {|_self| ... } ⇒ Configuration
Returns a new instance of Configuration.
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/derivative_rodeo/configuration.rb', line 51 def initialize @logger = if defined?(Rails) Rails.logger else # By default, minimize the chatter of the specs. Add ENV['DEBUG'] to expose the # chatter. Logger.new($stderr, level: Logger::FATAL) end yield self if block_given? end |
Instance Attribute Details
#logger ⇒ Logger
64 65 66 |
# File 'lib/derivative_rodeo/configuration.rb', line 64 def logger @logger end |
Class Method Details
.aws_config(prefix:, name:, default: nil) ⇒ Object
Allows AWS configuration to be set via environment variables by declairing them in the configuration class as follows:
25 26 27 28 |
# File 'lib/derivative_rodeo/configuration.rb', line 25 def self.aws_config(prefix:, name:, default: nil) aws_config_getter(prefix: prefix, name: name, default: default) aws_config_setter(prefix: prefix, name: name) end |
Instance Method Details
#s3 ⇒ String
The order we use is:
-
‘config.aws_s3_<variable_name> = value`
-
‘AWS_S3_<variable_name>`
-
‘AWS_<variable_name>`
-
‘AWS_DEFAULT_<variable_name>`
-
default
Various AWS items for StorageLocations::S3Location. These can be set from the ENV or the configuration block
82 |
# File 'lib/derivative_rodeo/configuration.rb', line 82 aws_config prefix: 's3', name: 'region', default: 'us-east-1' |