class Jasmine::PathMapper

Public Class Methods

new(config) click to toggle source
# File lib/jasmine/path_mapper.rb, line 3
def initialize(config)
  @config = config
end

Public Instance Methods

map_boot_paths(paths) click to toggle source
# File lib/jasmine/path_mapper.rb, line 15
def map_boot_paths(paths)
  map(paths, @config.boot_dir, @config.boot_path)
end
map_jasmine_paths(paths) click to toggle source
# File lib/jasmine/path_mapper.rb, line 23
def map_jasmine_paths(paths)
  map(paths, @config.jasmine_dir, @config.jasmine_path)
end
map_runner_boot_paths(paths) click to toggle source
# File lib/jasmine/path_mapper.rb, line 19
def map_runner_boot_paths(paths)
  map(paths, @config.runner_boot_dir, @config.runner_boot_path)
end
map_spec_paths(paths) click to toggle source
# File lib/jasmine/path_mapper.rb, line 11
def map_spec_paths(paths)
  map(paths, @config.spec_dir, @config.spec_path)
end
map_src_paths(paths) click to toggle source
# File lib/jasmine/path_mapper.rb, line 7
def map_src_paths(paths)
  map(paths, @config.src_dir, @config.src_path)
end

Private Instance Methods

map(paths, remove_path, add_path) click to toggle source
# File lib/jasmine/path_mapper.rb, line 28
def map(paths, remove_path, add_path)
  paths.map do |path|
    if path[0..3] == 'http'
      path
    else
      File.join(add_path, (path.sub(remove_path, '')))
    end
  end
end