Class: Jasmine::YamlConfigParser
- Inherits:
-
Object
- Object
- Jasmine::YamlConfigParser
- Defined in:
- lib/jasmine/yaml_config_parser.rb
Instance Method Summary collapse
- #boot_dir ⇒ Object
- #boot_files ⇒ Object
- #css_files ⇒ Object
- #helpers ⇒ Object
-
#initialize(path, pwd, path_expander = lambda {}, yaml_loader = lambda {}) ⇒ YamlConfigParser
constructor
A new instance of YamlConfigParser.
- #jasmine_css_files ⇒ Object
- #jasmine_dir ⇒ Object
- #jasmine_files ⇒ Object
- #phantom_cli_options ⇒ Object
- #phantom_config_script ⇒ Object
- #rack_options ⇒ Object
- #random ⇒ Object
- #show_console_log ⇒ Object
- #spec_dir ⇒ Object
- #spec_files ⇒ Object
- #spec_helper ⇒ Object
- #src_dir ⇒ Object
- #src_files ⇒ Object
- #stop_on_spec_failure ⇒ Object
- #stop_spec_on_expectation_failure ⇒ Object
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, = lambda {}, yaml_loader = lambda {}) @path = path @path_expander = @pwd = pwd @yaml_loader = yaml_loader end |
Instance Method Details
#boot_dir ⇒ Object
25 26 27 28 |
# File 'lib/jasmine/yaml_config_parser.rb', line 25 def boot_dir return nil unless loaded_yaml['boot_dir'] File.join(@pwd, loaded_yaml['boot_dir']) end |
#boot_files ⇒ Object
38 39 40 |
# File 'lib/jasmine/yaml_config_parser.rb', line 38 def boot_files @path_expander.call(boot_dir, loaded_yaml['boot_files'] || []) end |
#css_files ⇒ Object
54 55 56 |
# File 'lib/jasmine/yaml_config_parser.rb', line 54 def css_files @path_expander.call(src_dir, loaded_yaml['stylesheets'] || []) end |
#helpers ⇒ Object
50 51 52 |
# File 'lib/jasmine/yaml_config_parser.rb', line 50 def helpers @path_expander.call(spec_dir, loaded_yaml['helpers'] || []) end |
#jasmine_css_files ⇒ Object
42 43 44 |
# File 'lib/jasmine/yaml_config_parser.rb', line 42 def jasmine_css_files @path_expander.call(jasmine_dir, loaded_yaml['jasmine_css_files'] || []) end |
#jasmine_dir ⇒ Object
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_files ⇒ Object
34 35 36 |
# File 'lib/jasmine/yaml_config_parser.rb', line 34 def jasmine_files @path_expander.call(jasmine_dir, loaded_yaml['jasmine_files'] || []) end |
#phantom_cli_options ⇒ Object
87 88 89 |
# File 'lib/jasmine/yaml_config_parser.rb', line 87 def loaded_yaml['phantom_cli_options'] || {} end |
#phantom_config_script ⇒ Object
82 83 84 85 |
# File 'lib/jasmine/yaml_config_parser.rb', line 82 def phantom_config_script return nil unless loaded_yaml['phantom_config_script'] File.join @pwd, loaded_yaml['phantom_config_script'] end |
#rack_options ⇒ Object
91 92 93 94 95 96 |
# File 'lib/jasmine/yaml_config_parser.rb', line 91 def loaded_yaml.fetch('rack_options', {}).inject({}) do |memo, (key, value)| memo[key.to_sym] = value memo end end |
#random ⇒ Object
74 75 76 77 78 79 80 |
# File 'lib/jasmine/yaml_config_parser.rb', line 74 def random if loaded_yaml['random'].nil? true else loaded_yaml['random'] end end |
#show_console_log ⇒ Object
62 63 64 |
# File 'lib/jasmine/yaml_config_parser.rb', line 62 def show_console_log loaded_yaml['show_console_log'] || false end |
#spec_dir ⇒ Object
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_files ⇒ Object
46 47 48 |
# File 'lib/jasmine/yaml_config_parser.rb', line 46 def spec_files @path_expander.call(spec_dir, loaded_yaml['spec_files'] || []) end |
#spec_helper ⇒ Object
58 59 60 |
# File 'lib/jasmine/yaml_config_parser.rb', line 58 def spec_helper File.join(@pwd, loaded_yaml['spec_helper'] || File.join('spec', 'javascripts', 'support', 'jasmine_helper.rb')) end |
#src_dir ⇒ Object
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_files ⇒ Object
30 31 32 |
# File 'lib/jasmine/yaml_config_parser.rb', line 30 def src_files @path_expander.call(src_dir, loaded_yaml['src_files'] || []) end |
#stop_on_spec_failure ⇒ Object
70 71 72 |
# File 'lib/jasmine/yaml_config_parser.rb', line 70 def stop_on_spec_failure loaded_yaml['stop_on_spec_failure'] || false end |
#stop_spec_on_expectation_failure ⇒ Object
66 67 68 |
# File 'lib/jasmine/yaml_config_parser.rb', line 66 def stop_spec_on_expectation_failure loaded_yaml['stop_spec_on_expectation_failure'] || false end |