Sha256: bd5eaff22bf32836102645e13c90a4c487392660baa19661bb3d736f10940e20

Contents?: true

Size: 824 Bytes

Versions: 65

Compression:

Stored size: 824 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_runner_boot_paths(paths)
      map(paths, @config.runner_boot_dir, @config.runner_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 do |path|
        if path[0..3] == 'http'
          path
        else
          File.join(add_path, (path.sub(remove_path, '')))
        end
      end
    end
  end
end

Version data entries

65 entries across 50 versions & 2 rubygems

Version Path
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/jasmine-2.99.0/lib/jasmine/path_mapper.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/jasmine-2.99.0/lib/jasmine/path_mapper.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/jasmine-2.99.0/lib/jasmine/path_mapper.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/jasmine-2.99.0/lib/jasmine/path_mapper.rb
jasmine-3.99.0 lib/jasmine/path_mapper.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/jasmine-2.99.0/lib/jasmine/path_mapper.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/jasmine-2.99.0/lib/jasmine/path_mapper.rb
jasmine-3.10.0 lib/jasmine/path_mapper.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/jasmine-2.99.0/lib/jasmine/path_mapper.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/jasmine-2.99.0/lib/jasmine/path_mapper.rb
jasmine-3.9.2 lib/jasmine/path_mapper.rb
jasmine-3.9.1 lib/jasmine/path_mapper.rb
jasmine-3.9.0 lib/jasmine/path_mapper.rb
jasmine-3.8.1 lib/jasmine/path_mapper.rb
jasmine-3.8.0 lib/jasmine/path_mapper.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/jasmine-2.99.0/lib/jasmine/path_mapper.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/jasmine-2.99.0/lib/jasmine/path_mapper.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/jasmine-2.99.0/lib/jasmine/path_mapper.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/jasmine-2.99.0/lib/jasmine/path_mapper.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/jasmine-2.99.0/lib/jasmine/path_mapper.rb