class Jasmine::Configuration
Attributes
boot_dir[RW]
boot_files[W]
boot_path[RW]
browser[RW]
TODO: these are largely client concerns, move them.
css_files[W]
host[RW]
TODO: these are largely client concerns, move them.
jasmine_css_files[W]
jasmine_dir[RW]
jasmine_files[W]
jasmine_path[RW]
port[RW]
TODO: these are largely client concerns, move them.
result_batch_size[RW]
TODO: these are largely client concerns, move them.
spec_dir[RW]
spec_files[W]
spec_path[RW]
src_dir[RW]
src_files[W]
src_path[RW]
Public Class Methods
new()
click to toggle source
# File lib/jasmine/configuration.rb, line 10 def initialize() @rack_paths = {} @apps = [] @path_mappers = [] @jasmine_css_files = lambda { [] } @css_files = lambda { [] } @jasmine_files = lambda { [] } @boot_files = lambda { [] } @src_files = lambda { [] } @spec_files = lambda { [] } end
Public Instance Methods
add_path_mapper(mapper)
click to toggle source
# File lib/jasmine/configuration.rb, line 50 def add_path_mapper(mapper) @path_mappers << mapper.call(self) end
add_rack_app(app, &block)
click to toggle source
# File lib/jasmine/configuration.rb, line 46 def add_rack_app(app, &block) @apps << [app, block] end
add_rack_path(path, rack_app_lambda)
click to toggle source
# File lib/jasmine/configuration.rb, line 38 def add_rack_path(path, rack_app_lambda) @rack_paths[path] = rack_app_lambda end
css_files()
click to toggle source
# File lib/jasmine/configuration.rb, line 22 def css_files map(@jasmine_css_files, :jasmine) + map(@css_files, :src) end
js_files()
click to toggle source
# File lib/jasmine/configuration.rb, line 27 def js_files map(@jasmine_files, :jasmine) + map(@src_files, :src) + map(@spec_files, :spec) + map(@boot_files, :boot) end
rack_apps()
click to toggle source
# File lib/jasmine/configuration.rb, line 42 def rack_apps [] + @apps end
rack_path_map()
click to toggle source
# File lib/jasmine/configuration.rb, line 34 def rack_path_map {}.merge(@rack_paths) end
Private Instance Methods
map(paths, type)
click to toggle source
# File lib/jasmine/configuration.rb, line 72 def map(paths, type) @path_mappers.inject(paths.call) do |paths, mapper| if mapper.respond_to?("map_#{type}_paths") mapper.send("map_#{type}_paths", paths) else paths end end end