Class: Jasmine::YamlConfigParser

Inherits:
Object
  • Object
show all
Defined in:
lib/jasmine/yaml_config_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, pwd, path_expander = lambda {}, yaml_loader = lambda {}) ⇒ YamlConfigParser

Returns a new instance of YamlConfigParser.



3
4
5
6
7
8
# File 'lib/jasmine/yaml_config_parser.rb', line 3

def initialize(path, pwd, path_expander = lambda {}, yaml_loader = lambda {})
  @path = path
  @path_expander = path_expander
  @pwd = pwd
  @yaml_loader = yaml_loader
end

Instance Method Details

#css_filesObject



45
46
47
# File 'lib/jasmine/yaml_config_parser.rb', line 45

def css_files
  @path_expander.call(src_dir, loaded_yaml['stylesheets'] || [])
end

#helpersObject



41
42
43
# File 'lib/jasmine/yaml_config_parser.rb', line 41

def helpers
  @path_expander.call(spec_dir, loaded_yaml['helpers'] || [])
end

#jasmine_css_filesObject



33
34
35
# File 'lib/jasmine/yaml_config_parser.rb', line 33

def jasmine_css_files
  @path_expander.call(jasmine_dir, loaded_yaml['jasmine_css_files'] || [])
end

#jasmine_dirObject



20
21
22
23
# File 'lib/jasmine/yaml_config_parser.rb', line 20

def jasmine_dir
  return nil unless loaded_yaml['jasmine_dir']
  File.join(@pwd, loaded_yaml['jasmine_dir'])
end

#jasmine_filesObject



29
30
31
# File 'lib/jasmine/yaml_config_parser.rb', line 29

def jasmine_files
  @path_expander.call(jasmine_dir, loaded_yaml['jasmine_files'] || [])
end

#spec_dirObject



15
16
17
18
# File 'lib/jasmine/yaml_config_parser.rb', line 15

def spec_dir
  return File.join(@pwd, 'spec', 'javascripts') unless loaded_yaml['spec_dir']
  File.join(@pwd, loaded_yaml['spec_dir'])
end

#spec_filesObject



37
38
39
# File 'lib/jasmine/yaml_config_parser.rb', line 37

def spec_files
  @path_expander.call(spec_dir, loaded_yaml['spec_files'] || [])
end

#spec_helperObject



49
50
51
# File 'lib/jasmine/yaml_config_parser.rb', line 49

def spec_helper
  File.join(@pwd, loaded_yaml['spec_helper'] || File.join('spec', 'javascripts', 'support', 'jasmine_helper.rb'))
end

#src_dirObject



10
11
12
13
# File 'lib/jasmine/yaml_config_parser.rb', line 10

def src_dir
  return @pwd unless loaded_yaml['src_dir']
  File.join(@pwd, loaded_yaml['src_dir'])
end

#src_filesObject



25
26
27
# File 'lib/jasmine/yaml_config_parser.rb', line 25

def src_files
  @path_expander.call(src_dir, loaded_yaml['src_files'] || [])
end