aboutsummaryrefslogtreecommitdiffstats
path: root/spec/bundler/support/artifice/compact_index_host_redirect.rb
blob: 6c1ab2def6aca762ca8683a48e490fc56ea025fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true
require File.expand_path("../compact_index", __FILE__)

Artifice.deactivate

class CompactIndexHostRedirect < CompactIndexAPI
  get "/fetch/actual/gem/:id", :host_name => "localgemserver.test" do
    redirect "http://bundler.localgemserver.test#{request.path_info}"
  end

  get "/versions" do
    status 404
  end

  get "/api/v1/dependencies" do
    status 404
  end
end

Artifice.activate_with(CompactIndexHostRedirect)