Class: Exhaust::Configuration
- Inherits:
-
Object
- Object
- Exhaust::Configuration
- Defined in:
- lib/exhaust/configuration.rb
Defined Under Namespace
Classes: FileNotFound
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Instance Method Summary collapse
- #assert_file(file_name) {|file_name| ... } ⇒ Object
- #ember_path ⇒ Object
- #ember_port ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #rails_path ⇒ Object
- #rails_port ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 |
# File 'lib/exhaust/configuration.rb', line 8 def initialize assert_file(".exhaust.yml") do |file_name| @configuration = YAML.load_file(file_name) end end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
7 8 9 |
# File 'lib/exhaust/configuration.rb', line 7 def configuration @configuration end |
Instance Method Details
#assert_file(file_name) {|file_name| ... } ⇒ Object
14 15 16 17 |
# File 'lib/exhaust/configuration.rb', line 14 def assert_file(file_name) raise FileNotFound.new("#{file_name} was not found") unless File.exists?(file_name) yield(file_name) end |
#ember_path ⇒ Object
23 24 25 |
# File 'lib/exhaust/configuration.rb', line 23 def ember_path configuration["ember"]["path"] end |
#ember_port ⇒ Object
19 20 21 |
# File 'lib/exhaust/configuration.rb', line 19 def ember_port configuration["ember"]["port"] end |
#rails_path ⇒ Object
31 32 33 |
# File 'lib/exhaust/configuration.rb', line 31 def rails_path configuration["rails"]["path"] end |
#rails_port ⇒ Object
27 28 29 |
# File 'lib/exhaust/configuration.rb', line 27 def rails_port configuration["rails"]["port"] end |