Class: JasmineNodeConfig
- Inherits:
-
Object
- Object
- JasmineNodeConfig
- Defined in:
- lib/tasks/jasmine_node/jasmine_node_config.rb
Instance Method Summary collapse
- #config_path ⇒ Object
-
#initialize(dir, json, file) ⇒ JasmineNodeConfig
constructor
A new instance of JasmineNodeConfig.
- #reload ⇒ Object
- #requires ⇒ Object
- #source_dir ⇒ Object
- #spec_dir ⇒ Object
Constructor Details
#initialize(dir, json, file) ⇒ JasmineNodeConfig
Returns a new instance of JasmineNodeConfig.
3 4 5 6 7 |
# File 'lib/tasks/jasmine_node/jasmine_node_config.rb', line 3 def initialize(dir, json, file) @config_path = dir + '/jasmine.conf' @json = json @file = file end |
Instance Method Details
#config_path ⇒ Object
9 10 11 |
# File 'lib/tasks/jasmine_node/jasmine_node_config.rb', line 9 def config_path return @config_path end |
#reload ⇒ Object
13 14 15 16 |
# File 'lib/tasks/jasmine_node/jasmine_node_config.rb', line 13 def reload contents = File.open(@config_path, 'r') { |f| f.read } @config = @json.parse contents end |
#requires ⇒ Object
26 27 28 |
# File 'lib/tasks/jasmine_node/jasmine_node_config.rb', line 26 def requires return @config["requires"] end |
#source_dir ⇒ Object
18 19 20 |
# File 'lib/tasks/jasmine_node/jasmine_node_config.rb', line 18 def source_dir return @config["sourceDirectory"] end |
#spec_dir ⇒ Object
22 23 24 |
# File 'lib/tasks/jasmine_node/jasmine_node_config.rb', line 22 def spec_dir return @config["specDirectory"] end |