2018-11-02 19:07:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-11-11 03:57:45 -05:00
|
|
|
require_relative "endpoint"
|
2018-11-02 19:07:56 -04:00
|
|
|
|
|
|
|
Artifice.deactivate
|
|
|
|
|
|
|
|
class EndpointExtra < Endpoint
|
|
|
|
get "/extra/api/v1/dependencies" do
|
|
|
|
halt 404
|
|
|
|
end
|
|
|
|
|
|
|
|
get "/extra/specs.4.8.gz" do
|
2020-05-08 01:19:04 -04:00
|
|
|
File.binread("#{gem_repo2}/specs.4.8.gz")
|
2018-11-02 19:07:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
get "/extra/prerelease_specs.4.8.gz" do
|
2020-05-08 01:19:04 -04:00
|
|
|
File.binread("#{gem_repo2}/prerelease_specs.4.8.gz")
|
2018-11-02 19:07:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
get "/extra/quick/Marshal.4.8/:id" do
|
|
|
|
redirect "/extra/fetch/actual/gem/#{params[:id]}"
|
|
|
|
end
|
|
|
|
|
|
|
|
get "/extra/fetch/actual/gem/:id" do
|
2020-05-08 01:19:04 -04:00
|
|
|
File.binread("#{gem_repo2}/quick/Marshal.4.8/#{params[:id]}")
|
2018-11-02 19:07:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
get "/extra/gems/:id" do
|
2020-05-08 01:19:04 -04:00
|
|
|
File.binread("#{gem_repo2}/gems/#{params[:id]}")
|
2018-11-02 19:07:56 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Artifice.activate_with(EndpointExtra)
|