Class: Jasmine::Configuration
- Inherits:
-
Object
- Object
- Jasmine::Configuration
- Defined in:
- lib/jasmine/configuration.rb
Instance Attribute Summary collapse
-
#boot_dir ⇒ Object
Returns the value of attribute boot_dir.
-
#boot_files ⇒ Object
writeonly
Sets the attribute boot_files.
-
#boot_path ⇒ Object
Returns the value of attribute boot_path.
-
#chrome_binary ⇒ Object
Returns the value of attribute chrome_binary.
-
#chrome_cli_options ⇒ Object
Returns the value of attribute chrome_cli_options.
-
#chrome_startup_timeout ⇒ Object
Returns the value of attribute chrome_startup_timeout.
-
#color ⇒ Object
Returns the value of attribute color.
- #css_files ⇒ Object
-
#formatters ⇒ Object
Returns the value of attribute formatters.
-
#helper_files ⇒ Object
Returns the value of attribute helper_files.
-
#host ⇒ Object
Returns the value of attribute host.
-
#image_path ⇒ Object
Returns the value of attribute image_path.
-
#images_dir ⇒ Object
Returns the value of attribute images_dir.
-
#jasmine_css_files ⇒ Object
writeonly
Sets the attribute jasmine_css_files.
-
#jasmine_dir ⇒ Object
Returns the value of attribute jasmine_dir.
-
#jasmine_files ⇒ Object
writeonly
Sets the attribute jasmine_files.
-
#jasmine_path ⇒ Object
Returns the value of attribute jasmine_path.
-
#phantom_cli_options ⇒ Object
Returns the value of attribute phantom_cli_options.
-
#phantom_config_script ⇒ Object
Returns the value of attribute phantom_config_script.
-
#prevent_phantom_js_auto_install ⇒ Object
Returns the value of attribute prevent_phantom_js_auto_install.
-
#rack_apps ⇒ Object
readonly
Returns the value of attribute rack_apps.
-
#rack_options ⇒ Object
Returns the value of attribute rack_options.
-
#random ⇒ Object
Returns the value of attribute random.
-
#runner ⇒ Object
Returns the value of attribute runner.
-
#runner_boot_dir ⇒ Object
Returns the value of attribute runner_boot_dir.
-
#runner_boot_files ⇒ Object
writeonly
Sets the attribute runner_boot_files.
-
#runner_boot_path ⇒ Object
Returns the value of attribute runner_boot_path.
-
#runner_browser ⇒ Object
Returns the value of attribute runner_browser.
-
#show_console_log ⇒ Object
Returns the value of attribute show_console_log.
-
#show_full_stack_trace ⇒ Object
Returns the value of attribute show_full_stack_trace.
-
#spec_dir ⇒ Object
Returns the value of attribute spec_dir.
-
#spec_files ⇒ Object
Returns the value of attribute spec_files.
-
#spec_format ⇒ Object
Returns the value of attribute spec_format.
-
#spec_path ⇒ Object
Returns the value of attribute spec_path.
-
#src_dir ⇒ Object
Returns the value of attribute src_dir.
-
#src_files ⇒ Object
writeonly
Sets the attribute src_files.
-
#src_path ⇒ Object
Returns the value of attribute src_path.
-
#stop_on_spec_failure ⇒ Object
Returns the value of attribute stop_on_spec_failure.
-
#stop_spec_on_expectation_failure ⇒ Object
Returns the value of attribute stop_spec_on_expectation_failure.
Instance Method Summary collapse
- #add_path_mapper(mapper) ⇒ Object
- #add_rack_app(app, *args, &block) ⇒ Object
- #add_rack_path(path, rack_app_lambda) ⇒ Object
- #ci_port=(port) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #js_files ⇒ Object
- #port(server_type) ⇒ Object
- #rack_path_map ⇒ Object
- #server_port=(port) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/jasmine/configuration.rb', line 28 def initialize() @rack_paths = {} @rack_apps = [] @path_mappers = [] @jasmine_css_files = lambda { [] } @css_files = lambda { [] } @jasmine_files = lambda { [] } @boot_files = lambda { [] } @runner_boot_files = lambda { [] } @src_files = lambda { [] } @helper_files = lambda { [] } @spec_files = lambda { [] } @testing_files = lambda { helper_files.call + spec_files.call} @runner = lambda { |config| } @rack_options = {} @show_console_log = false @stop_spec_on_expectation_failure = false @stop_on_spec_failure = false @random = true @phantom_config_script = nil @phantom_cli_options = {} @chrome_cli_options = {"no-sandbox" => nil, "headless" => nil, "remote-debugging-port" => 9222} @chrome_startup_timeout = 3 @chrome_binary = nil @runner_browser = :phantomjs @formatters = [Jasmine::Formatters::Console] @color = true @server_port = 8888 end |
Instance Attribute Details
#boot_dir ⇒ Object
Returns the value of attribute boot_dir.
7 8 9 |
# File 'lib/jasmine/configuration.rb', line 7 def boot_dir @boot_dir end |
#boot_files=(value) ⇒ Object (writeonly)
Sets the attribute boot_files
4 5 6 |
# File 'lib/jasmine/configuration.rb', line 4 def boot_files=(value) @boot_files = value end |
#boot_path ⇒ Object
Returns the value of attribute boot_path.
6 7 8 |
# File 'lib/jasmine/configuration.rb', line 6 def boot_path @boot_path end |
#chrome_binary ⇒ Object
Returns the value of attribute chrome_binary.
23 24 25 |
# File 'lib/jasmine/configuration.rb', line 23 def chrome_binary @chrome_binary end |
#chrome_cli_options ⇒ Object
Returns the value of attribute chrome_cli_options.
21 22 23 |
# File 'lib/jasmine/configuration.rb', line 21 def @chrome_cli_options end |
#chrome_startup_timeout ⇒ Object
Returns the value of attribute chrome_startup_timeout.
22 23 24 |
# File 'lib/jasmine/configuration.rb', line 22 def chrome_startup_timeout @chrome_startup_timeout end |
#color ⇒ Object
Returns the value of attribute color.
9 10 11 |
# File 'lib/jasmine/configuration.rb', line 9 def color @color end |
#css_files ⇒ Object
60 61 62 63 |
# File 'lib/jasmine/configuration.rb', line 60 def css_files map(@jasmine_css_files, :jasmine) + map(@css_files, :src) end |
#formatters ⇒ Object
Returns the value of attribute formatters.
8 9 10 |
# File 'lib/jasmine/configuration.rb', line 8 def formatters @formatters end |
#helper_files ⇒ Object
Returns the value of attribute helper_files.
5 6 7 |
# File 'lib/jasmine/configuration.rb', line 5 def helper_files @helper_files end |
#host ⇒ Object
Returns the value of attribute host.
10 11 12 |
# File 'lib/jasmine/configuration.rb', line 10 def host @host end |
#image_path ⇒ Object
Returns the value of attribute image_path.
6 7 8 |
# File 'lib/jasmine/configuration.rb', line 6 def image_path @image_path end |
#images_dir ⇒ Object
Returns the value of attribute images_dir.
7 8 9 |
# File 'lib/jasmine/configuration.rb', line 7 def images_dir @images_dir end |
#jasmine_css_files=(value) ⇒ Object (writeonly)
Sets the attribute jasmine_css_files
3 4 5 |
# File 'lib/jasmine/configuration.rb', line 3 def jasmine_css_files=(value) @jasmine_css_files = value end |
#jasmine_dir ⇒ Object
Returns the value of attribute jasmine_dir.
7 8 9 |
# File 'lib/jasmine/configuration.rb', line 7 def jasmine_dir @jasmine_dir end |
#jasmine_files=(value) ⇒ Object (writeonly)
Sets the attribute jasmine_files
4 5 6 |
# File 'lib/jasmine/configuration.rb', line 4 def jasmine_files=(value) @jasmine_files = value end |
#jasmine_path ⇒ Object
Returns the value of attribute jasmine_path.
6 7 8 |
# File 'lib/jasmine/configuration.rb', line 6 def jasmine_path @jasmine_path end |
#phantom_cli_options ⇒ Object
Returns the value of attribute phantom_cli_options.
20 21 22 |
# File 'lib/jasmine/configuration.rb', line 20 def @phantom_cli_options end |
#phantom_config_script ⇒ Object
Returns the value of attribute phantom_config_script.
19 20 21 |
# File 'lib/jasmine/configuration.rb', line 19 def phantom_config_script @phantom_config_script end |
#prevent_phantom_js_auto_install ⇒ Object
Returns the value of attribute prevent_phantom_js_auto_install.
14 15 16 |
# File 'lib/jasmine/configuration.rb', line 14 def prevent_phantom_js_auto_install @prevent_phantom_js_auto_install end |
#rack_apps ⇒ Object (readonly)
Returns the value of attribute rack_apps.
26 27 28 |
# File 'lib/jasmine/configuration.rb', line 26 def rack_apps @rack_apps end |
#rack_options ⇒ Object
Returns the value of attribute rack_options.
13 14 15 |
# File 'lib/jasmine/configuration.rb', line 13 def @rack_options end |
#random ⇒ Object
Returns the value of attribute random.
18 19 20 |
# File 'lib/jasmine/configuration.rb', line 18 def random @random end |
#runner ⇒ Object
Returns the value of attribute runner.
12 13 14 |
# File 'lib/jasmine/configuration.rb', line 12 def runner @runner end |
#runner_boot_dir ⇒ Object
Returns the value of attribute runner_boot_dir.
7 8 9 |
# File 'lib/jasmine/configuration.rb', line 7 def runner_boot_dir @runner_boot_dir end |
#runner_boot_files=(value) ⇒ Object (writeonly)
Sets the attribute runner_boot_files
4 5 6 |
# File 'lib/jasmine/configuration.rb', line 4 def runner_boot_files=(value) @runner_boot_files = value end |
#runner_boot_path ⇒ Object
Returns the value of attribute runner_boot_path.
6 7 8 |
# File 'lib/jasmine/configuration.rb', line 6 def runner_boot_path @runner_boot_path end |
#runner_browser ⇒ Object
Returns the value of attribute runner_browser.
25 26 27 |
# File 'lib/jasmine/configuration.rb', line 25 def runner_browser @runner_browser end |
#show_console_log ⇒ Object
Returns the value of attribute show_console_log.
15 16 17 |
# File 'lib/jasmine/configuration.rb', line 15 def show_console_log @show_console_log end |
#show_full_stack_trace ⇒ Object
Returns the value of attribute show_full_stack_trace.
24 25 26 |
# File 'lib/jasmine/configuration.rb', line 24 def show_full_stack_trace @show_full_stack_trace end |
#spec_dir ⇒ Object
Returns the value of attribute spec_dir.
7 8 9 |
# File 'lib/jasmine/configuration.rb', line 7 def spec_dir @spec_dir end |
#spec_files ⇒ Object
Returns the value of attribute spec_files.
5 6 7 |
# File 'lib/jasmine/configuration.rb', line 5 def spec_files @spec_files end |
#spec_format ⇒ Object
Returns the value of attribute spec_format.
11 12 13 |
# File 'lib/jasmine/configuration.rb', line 11 def spec_format @spec_format end |
#spec_path ⇒ Object
Returns the value of attribute spec_path.
6 7 8 |
# File 'lib/jasmine/configuration.rb', line 6 def spec_path @spec_path end |
#src_dir ⇒ Object
Returns the value of attribute src_dir.
7 8 9 |
# File 'lib/jasmine/configuration.rb', line 7 def src_dir @src_dir end |
#src_files=(value) ⇒ Object (writeonly)
Sets the attribute src_files
4 5 6 |
# File 'lib/jasmine/configuration.rb', line 4 def src_files=(value) @src_files = value end |
#src_path ⇒ Object
Returns the value of attribute src_path.
6 7 8 |
# File 'lib/jasmine/configuration.rb', line 6 def src_path @src_path end |
#stop_on_spec_failure ⇒ Object
Returns the value of attribute stop_on_spec_failure.
17 18 19 |
# File 'lib/jasmine/configuration.rb', line 17 def stop_on_spec_failure @stop_on_spec_failure end |
#stop_spec_on_expectation_failure ⇒ Object
Returns the value of attribute stop_spec_on_expectation_failure.
16 17 18 |
# File 'lib/jasmine/configuration.rb', line 16 def stop_spec_on_expectation_failure @stop_spec_on_expectation_failure end |
Instance Method Details
#add_path_mapper(mapper) ⇒ Object
89 90 91 |
# File 'lib/jasmine/configuration.rb', line 89 def add_path_mapper(mapper) @path_mappers << mapper.call(self) end |
#add_rack_app(app, *args, &block) ⇒ Object
81 82 83 84 85 86 87 |
# File 'lib/jasmine/configuration.rb', line 81 def add_rack_app(app, *args, &block) @rack_apps << { :app => app, :args => args, :block => block } end |
#add_rack_path(path, rack_app_lambda) ⇒ Object
77 78 79 |
# File 'lib/jasmine/configuration.rb', line 77 def add_rack_path(path, rack_app_lambda) @rack_paths[path] = rack_app_lambda end |
#ci_port=(port) ⇒ Object
97 98 99 |
# File 'lib/jasmine/configuration.rb', line 97 def ci_port=(port) @ci_port = port end |
#js_files ⇒ Object
65 66 67 68 69 70 71 |
# File 'lib/jasmine/configuration.rb', line 65 def js_files map(@jasmine_files, :jasmine) + map(@boot_files, :boot) + map(@runner_boot_files, :runner_boot) + map(@src_files, :src) + map(@testing_files, :spec) end |
#port(server_type) ⇒ Object
101 102 103 104 105 106 107 |
# File 'lib/jasmine/configuration.rb', line 101 def port(server_type) if server_type == :server @server_port else @ci_port ||= Jasmine.find_unused_port end end |
#rack_path_map ⇒ Object
73 74 75 |
# File 'lib/jasmine/configuration.rb', line 73 def rack_path_map {}.merge(@rack_paths) end |
#server_port=(port) ⇒ Object
93 94 95 |
# File 'lib/jasmine/configuration.rb', line 93 def server_port=(port) @server_port = port end |