Class: Jasmine::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



10
11
12
13
14
15
16
17
18
19
20
# 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

Instance Attribute Details

#boot_dirObject

Returns the value of attribute boot_dir.



6
7
8
# File 'lib/jasmine/configuration.rb', line 6

def boot_dir
  @boot_dir
end

#boot_files=(value) ⇒ Object (writeonly)

Sets the attribute boot_files

Parameters:

  • value

    the value to set the attribute boot_files to.



4
5
6
# File 'lib/jasmine/configuration.rb', line 4

def boot_files=(value)
  @boot_files = value
end

#boot_pathObject

Returns the value of attribute boot_path.



5
6
7
# File 'lib/jasmine/configuration.rb', line 5

def boot_path
  @boot_path
end

#browserObject

TODO: these are largely client concerns, move them.



8
9
10
# File 'lib/jasmine/configuration.rb', line 8

def browser
  @browser
end

#css_filesObject



22
23
24
25
# File 'lib/jasmine/configuration.rb', line 22

def css_files
  map(@jasmine_css_files, :jasmine) +
    map(@css_files, :src)
end

#hostObject

TODO: these are largely client concerns, move them.



8
9
10
# File 'lib/jasmine/configuration.rb', line 8

def host
  @host
end

#jasmine_css_files=(value) ⇒ Object (writeonly)

Sets the attribute jasmine_css_files

Parameters:

  • value

    the value to set the attribute jasmine_css_files to.



3
4
5
# File 'lib/jasmine/configuration.rb', line 3

def jasmine_css_files=(value)
  @jasmine_css_files = value
end

#jasmine_dirObject

Returns the value of attribute jasmine_dir.



6
7
8
# File 'lib/jasmine/configuration.rb', line 6

def jasmine_dir
  @jasmine_dir
end

#jasmine_files=(value) ⇒ Object (writeonly)

Sets the attribute jasmine_files

Parameters:

  • value

    the value to set the attribute jasmine_files to.



4
5
6
# File 'lib/jasmine/configuration.rb', line 4

def jasmine_files=(value)
  @jasmine_files = value
end

#jasmine_pathObject

Returns the value of attribute jasmine_path.



5
6
7
# File 'lib/jasmine/configuration.rb', line 5

def jasmine_path
  @jasmine_path
end

#portObject

TODO: these are largely client concerns, move them.



8
9
10
# File 'lib/jasmine/configuration.rb', line 8

def port
  @port
end

#result_batch_sizeObject

TODO: these are largely client concerns, move them.



8
9
10
# File 'lib/jasmine/configuration.rb', line 8

def result_batch_size
  @result_batch_size
end

#spec_dirObject

Returns the value of attribute spec_dir.



6
7
8
# File 'lib/jasmine/configuration.rb', line 6

def spec_dir
  @spec_dir
end

#spec_files=(value) ⇒ Object (writeonly)

Sets the attribute spec_files

Parameters:

  • value

    the value to set the attribute spec_files to.



4
5
6
# File 'lib/jasmine/configuration.rb', line 4

def spec_files=(value)
  @spec_files = value
end

#spec_pathObject

Returns the value of attribute spec_path.



5
6
7
# File 'lib/jasmine/configuration.rb', line 5

def spec_path
  @spec_path
end

#src_dirObject

Returns the value of attribute src_dir.



6
7
8
# File 'lib/jasmine/configuration.rb', line 6

def src_dir
  @src_dir
end

#src_files=(value) ⇒ Object (writeonly)

Sets the attribute src_files

Parameters:

  • value

    the value to set the attribute src_files to.



4
5
6
# File 'lib/jasmine/configuration.rb', line 4

def src_files=(value)
  @src_files = value
end

#src_pathObject

Returns the value of attribute src_path.



5
6
7
# File 'lib/jasmine/configuration.rb', line 5

def src_path
  @src_path
end

Instance Method Details

#add_path_mapper(mapper) ⇒ Object



50
51
52
# File 'lib/jasmine/configuration.rb', line 50

def add_path_mapper(mapper)
  @path_mappers << mapper.call(self)
end

#add_rack_app(app, &block) ⇒ Object



46
47
48
# File 'lib/jasmine/configuration.rb', line 46

def add_rack_app(app, &block)
  @apps << [app, block]
end

#add_rack_path(path, rack_app_lambda) ⇒ Object



38
39
40
# File 'lib/jasmine/configuration.rb', line 38

def add_rack_path(path, rack_app_lambda)
  @rack_paths[path] = rack_app_lambda
end

#js_filesObject



27
28
29
30
31
32
# 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_appsObject



42
43
44
# File 'lib/jasmine/configuration.rb', line 42

def rack_apps
  [] + @apps
end

#rack_path_mapObject



34
35
36
# File 'lib/jasmine/configuration.rb', line 34

def rack_path_map
  {}.merge(@rack_paths)
end