Class: JasmineNodeConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/tasks/jasmine_node/jasmine_node_config.rb

Instance Method Summary collapse

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_pathObject



9
10
11
# File 'lib/tasks/jasmine_node/jasmine_node_config.rb', line 9

def config_path
  return @config_path
end

#reloadObject



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

#requiresObject



26
27
28
# File 'lib/tasks/jasmine_node/jasmine_node_config.rb', line 26

def requires
  return @config["requires"]
end

#source_dirObject



18
19
20
# File 'lib/tasks/jasmine_node/jasmine_node_config.rb', line 18

def source_dir
  return @config["sourceDirectory"]
end

#spec_dirObject



22
23
24
# File 'lib/tasks/jasmine_node/jasmine_node_config.rb', line 22

def spec_dir
  return @config["specDirectory"]
end