Skip to content

Commit

Permalink
[rubygems/rubygems] Introduce Spec::Path.sinatra_dependency_paths for…
Browse files Browse the repository at this point in the history
… sinatra mock server

rubygems/rubygems@0a168156d5
  • Loading branch information
hsbt committed Jan 16, 2025
1 parent e7de621 commit 2533293
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/bundler/support/artifice/endpoint_500.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/support/artifice/helpers/endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/support/artifice/windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
13 changes: 13 additions & 0 deletions spec/bundler/support/path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,19 @@ def rake_path
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)
Expand Down

0 comments on commit 2533293

Please sign in to comment.