Sha256: 7da876a46f38a654b4ce7a156bef560ce9ff2dba5d4d5534e88ba3adc5f1f135

Contents?: true

Size: 621 Bytes

Versions: 9

Compression:

Stored size: 621 Bytes

Contents

module Jasmine
  class PathMapper
    def initialize(config)
      @config = config
    end

    def map_src_paths(paths)
      map(paths, @config.src_dir, @config.src_path)
    end

    def map_spec_paths(paths)
      map(paths, @config.spec_dir, @config.spec_path)
    end

    def map_boot_paths(paths)
      map(paths, @config.boot_dir, @config.boot_path)
    end

    def map_jasmine_paths(paths)
      map(paths, @config.jasmine_dir, @config.jasmine_path)
    end

    private
    def map(paths, remove_path, add_path)
      paths.map { |path| File.join(add_path, (path.gsub(remove_path, ''))) }
    end

  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
jasmine-2.0.0 lib/jasmine/path_mapper.rb
jasmine-2.0.0.rc5 lib/jasmine/path_mapper.rb
jasmine-2.0.0.rc4 lib/jasmine/path_mapper.rb
jasmine-2.0.0.rc3 lib/jasmine/path_mapper.rb
jasmine-2.0.0.rc2 lib/jasmine/path_mapper.rb
jasmine-multi_json-1.3.2.1 lib/jasmine/path_mapper.rb
jasmine-1.3.2 lib/jasmine/path_mapper.rb
jasmine-multi_json-1.3.1.1 lib/jasmine/path_mapper.rb
jasmine-1.3.1 lib/jasmine/path_mapper.rb