Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix relativizing directory on remotes that do not represent a path #205

Merged
merged 1 commit into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/appraisal/appraisal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ def relativize
lockfile_content = File.read(lockfile_path)

File.open(lockfile_path, 'w') do |file|
file.write lockfile_content.gsub(/#{current_directory}/, relative_path.to_s)
file.write lockfile_content.gsub(
/ #{current_directory}/,
" #{relative_path}",
)
end
end

Expand Down
20 changes: 20 additions & 0 deletions spec/acceptance/cli/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,26 @@
not_to include(current_directory)
end

it "does not relativize directory of uris in gemfile.lock" do
build_gemspec
add_gemspec_to_gemfile

build_git_gem("uri_dummy")
uri_dummy_path = "#{current_directory}/uri_dummy"
FileUtils.symlink(File.absolute_path("tmp/gems/uri_dummy"), uri_dummy_path)

build_appraisal_file <<-APPRAISAL
appraise '1.0.0' do
gem 'uri_dummy', git: 'file://#{uri_dummy_path}'
end
APPRAISAL

run "appraisal install"

expect(content_of("gemfiles/1.0.0.gemfile.lock")).
to include("file://#{uri_dummy_path}")
end

context 'with job size', :parallel => true do
before do
build_appraisal_file <<-Appraisal
Expand Down