class Jasmine::YamlConfigParser

Public Class Methods

new(path, pwd, path_expander = lambda {}, yaml_loader = lambda {}) click to toggle source
# 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

Public Instance Methods

css_files() click to toggle source
# File lib/jasmine/yaml_config_parser.rb, line 45
def css_files
  @path_expander.call(src_dir, loaded_yaml['stylesheets'] || [])
end
helpers() click to toggle source
# File lib/jasmine/yaml_config_parser.rb, line 41
def helpers
  @path_expander.call(spec_dir, loaded_yaml['helpers'] || [])
end
jasmine_css_files() click to toggle source
# 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_dir() click to toggle source
# 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_files() click to toggle source
# File lib/jasmine/yaml_config_parser.rb, line 29
def jasmine_files
  @path_expander.call(jasmine_dir, loaded_yaml['jasmine_files'] || [])
end
spec_dir() click to toggle source
# 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_files() click to toggle source
# File lib/jasmine/yaml_config_parser.rb, line 37
def spec_files
  @path_expander.call(spec_dir, loaded_yaml['spec_files'] || [])
end
spec_helper() click to toggle source
# 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_dir() click to toggle source
# 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_files() click to toggle source
# File lib/jasmine/yaml_config_parser.rb, line 25
def src_files
  @path_expander.call(src_dir, loaded_yaml['src_files'] || [])
end

Private Instance Methods

loaded_yaml() click to toggle source
# File lib/jasmine/yaml_config_parser.rb, line 54
def loaded_yaml
  @yaml_loader.call(@path)
end