Class: Simmer::Configuration
- Inherits:
-
Object
- Object
- Simmer::Configuration
- Extended by:
- Forwardable
- Defined in:
- lib/simmer/configuration.rb,
lib/simmer/configuration/callback_dsl.rb
Overview
Reads in the Simmer configuration file and options and provides it to the rest of the Simmer implementation.
Defined Under Namespace
Classes: CallbackDsl
Constant Summary collapse
- LOCAL_FILE_SYSTEM_KEY =
:local_file_system
- TIMEOUT_RETRY_KEY =
:timeout_failure_retry_count
- RESULTS =
'results'
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #aws_file_system? ⇒ Boolean
- #aws_file_system_config ⇒ Object
- #files_dir ⇒ Object
- #fixtures_dir ⇒ Object
-
#initialize(config, simmer_dir, resolver: Objectable.resolver, callbacks: nil) ⇒ Configuration
constructor
A new instance of Configuration.
- #local_file_system? ⇒ Boolean
- #local_file_system_config ⇒ Object
- #mysql_database_config ⇒ Object
- #results_dir ⇒ Object
- #spoon_client_config ⇒ Object
- #tests_dir ⇒ Object
- #timeout_failure_retry_count ⇒ Object
Constructor Details
#initialize(config, simmer_dir, resolver: Objectable.resolver, callbacks: nil) ⇒ Configuration
Returns a new instance of Configuration.
43 44 45 46 47 48 49 50 |
# File 'lib/simmer/configuration.rb', line 43 def initialize(config, simmer_dir, resolver: Objectable.resolver, callbacks: nil) @config = config || {} @resolver = resolver @simmer_dir = simmer_dir @callbacks = callbacks freeze end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
38 39 40 |
# File 'lib/simmer/configuration.rb', line 38 def config @config end |
Instance Method Details
#aws_file_system? ⇒ Boolean
64 65 66 |
# File 'lib/simmer/configuration.rb', line 64 def aws_file_system? config.key?(AWS_FILE_SYSTEM_KEY.to_s) end |
#aws_file_system_config ⇒ Object
56 57 58 |
# File 'lib/simmer/configuration.rb', line 56 def aws_file_system_config get(AWS_FILE_SYSTEM_KEY) || {} end |
#files_dir ⇒ Object
88 89 90 |
# File 'lib/simmer/configuration.rb', line 88 def files_dir File.join(simmer_dir, FILES) end |
#fixtures_dir ⇒ Object
84 85 86 |
# File 'lib/simmer/configuration.rb', line 84 def fixtures_dir File.join(simmer_dir, FIXTURES) end |
#local_file_system? ⇒ Boolean
68 69 70 |
# File 'lib/simmer/configuration.rb', line 68 def local_file_system? config.key?(LOCAL_FILE_SYSTEM_KEY.to_s) end |
#local_file_system_config ⇒ Object
60 61 62 |
# File 'lib/simmer/configuration.rb', line 60 def local_file_system_config get(LOCAL_FILE_SYSTEM_KEY) || {} end |
#mysql_database_config ⇒ Object
52 53 54 |
# File 'lib/simmer/configuration.rb', line 52 def mysql_database_config get(MYSQL_DATABASE_KEY) || {} end |
#results_dir ⇒ Object
92 93 94 |
# File 'lib/simmer/configuration.rb', line 92 def results_dir File.join(simmer_dir, RESULTS) end |
#spoon_client_config ⇒ Object
76 77 78 |
# File 'lib/simmer/configuration.rb', line 76 def spoon_client_config get(SPOON_CLIENT_KEY) || {} end |
#tests_dir ⇒ Object
80 81 82 |
# File 'lib/simmer/configuration.rb', line 80 def tests_dir File.join(simmer_dir, TESTS) end |
#timeout_failure_retry_count ⇒ Object
72 73 74 |
# File 'lib/simmer/configuration.rb', line 72 def timeout_failure_retry_count get(TIMEOUT_RETRY_KEY) || 0 end |