[rubygems/rubygems] Introduce Spec::Path.sinatra_dependency_paths for sinatra mock server

https://github.com/rubygems/rubygems/commit/0a168156d5
This commit is contained in:
Hiroshi SHIBATA 2025-01-16 13:45:07 +09:00
parent e7de621b5a
commit 253329343c
4 changed files with 16 additions and 3 deletions

View File

@ -2,7 +2,7 @@
require_relative "../path"
$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gem_path.join("gems/{mustermann,rack,tilt,sinatra,ruby2_keywords,base64,logger}-*/lib")].map(&:to_s))
$LOAD_PATH.unshift(*Spec::Path.sinatra_dependency_paths)
require "sinatra/base"

View File

@ -2,7 +2,7 @@
require_relative "../../path"
$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gem_path.join("gems/{mustermann,rack,tilt,sinatra,ruby2_keywords,base64,logger}-*/lib")].map(&:to_s))
$LOAD_PATH.unshift(*Spec::Path.sinatra_dependency_paths)
require "sinatra/base"

View File

@ -2,7 +2,7 @@
require_relative "../path"
$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gem_path.join("gems/{mustermann,rack,tilt,sinatra,ruby2_keywords,base64,logger}-*/lib")].map(&:to_s))
$LOAD_PATH.unshift(*Spec::Path.sinatra_dependency_paths)
require "sinatra/base"

View File

@ -280,6 +280,19 @@ module Spec
Dir["#{base_system_gems}/#{Bundler.ruby_scope}/**/rake*.gem"].first
end
def sinatra_dependency_paths
deps = %w[
mustermann
rack
tilt
sinatra
ruby2_keywords
base64
logger
]
Dir[base_system_gem_path.join("gems/{#{deps.join(",")}}-*/lib")].map(&:to_s)
end
private
def git_ls_files(glob)