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

Use build-uri instead of fustigit #839

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This project adheres to [Semantic Versioning](https://semver.org).
This changelog adheres to [Keep a CHANGELOG](https://keepachangelog.com).

## [Unreleased]
### Added
- (maint) Use build-uri instead of fustigit to support Ruby 3 without monkey-patching

## [0.45.0] - 2024-02-16
### Added
Expand Down
1 change: 0 additions & 1 deletion lib/vanagon/component/source.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'fustigit'
require 'vanagon/logger'
require 'vanagon/component/source/http'
require 'vanagon/component/source/git'
Expand Down
4 changes: 2 additions & 2 deletions lib/vanagon/component/source/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This stupid library requires a capital 'E' in its name
# but it provides a wealth of useful constants
require 'English'
require 'fustigit'
require 'build/uri'
require 'git/basic_submodules'
require 'logger'
require 'timeout'
Expand Down Expand Up @@ -98,7 +98,7 @@ def initialize(url, workdir:, **options) # rubocop:disable Metrics/AbcSize
opts = default_options.merge(options.reject { |k, v| v.nil? })

# Ensure that #url returns a URI object
@url = URI.parse(url.to_s)
@url = Build::URI.parse(url.to_s)
@log_url = @url.host + @url.path unless @url.host.nil? || @url.path.nil?
@ref = opts[:ref]
@dirname = opts[:dirname]
Expand Down
3 changes: 2 additions & 1 deletion lib/vanagon/component/source/rewrite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ def parse_and_rewrite(uri)
return uri if rewrite_rules.empty?
if !!uri.match(/^git:http/)
VanagonLogger.info <<-HERE.undent
`fustigit` parsing doesn't get along with how we specify the source
`build-uri` parsing doesn't get along with how we specify the source
type by prefixing `git`. As `rewrite_rules` are deprecated, we'll
replace `git:http` with `http` in your uri. At some point this will
break.
HERE
# both fustigit and build-uri don't support git:http://host/path
uri.sub!(/^git:http/, 'http')
end
url = URI.parse(uri)
Expand Down
4 changes: 2 additions & 2 deletions vanagon.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Gem::Specification.new do |gem|
# - MIT licensed: https://rubygems.org/gems/git
gem.add_runtime_dependency('git', '~> 1.13.0')
# Parse scp-style triplets like URIs; used for Git source handling.
# - MIT licensed: https://rubygems.org/gems/fustigit
gem.add_runtime_dependency('fustigit', '~> 0.3.0')
# - MIT licensed: https://rubygems.org/gems/build-uri
gem.add_runtime_dependency('build-uri', '~> 1.0')
# Handle locking hardware resources
# - ASL v2 licensed: https://rubygems.org/gems/lock_manager
gem.add_runtime_dependency('lock_manager', '>= 0')
Expand Down
Loading