rubygems-await 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f040bdde5711373824dfc778356f15195f961c3e8927e6aeec2b4e30ac25798e
4
- data.tar.gz: f63d4321dfb30d38ef3bf3eea88b883ad5b4cb6214ba32174f36d98d8554fd4c
3
+ metadata.gz: 10e1a7c6f2fd38db7465b38a3c588f9220d074bcef67c3891612d0e79673fc9a
4
+ data.tar.gz: 1a19045734c1a922f4f4b93f051ade46155a45d501bd0e6509ae1eb695f35beb
5
5
  SHA512:
6
- metadata.gz: 835768f38eaa5ca44fa3b74ccd07ee6b2ef31419ebabd1b6c729ff90d93070bc74defda1d86845468e4e4fdbff3d2f2aead814cb86008344b49e42cdcbca9bc5
7
- data.tar.gz: 1f0a4d3c71f50adc95abec57d4cb410bef2d73c9833d76432cd37b2e9a38f178d6659ab1f2f8d8d76f1bdce5424b50933c053aa5b7ecb61d389961879325cc47
6
+ metadata.gz: df5ae29e5019fc2ed1941199f3cab44e8c60bb71a07bac9553c5949bdf0b7efc8048d5e05dfb2bac4ea799837b5cddf39317c0e877f13d37e514b7f7df623eb6
7
+ data.tar.gz: 62be45546fd49b042ec3e1aa5655c4a68039aa664e5816246c5a8c9d1d8792cb2bb33dacb8eabf94b534a4d21a02e30592f381bb9ed5c102633997dccd33bdba
data/CHANGELOG.md CHANGED
@@ -1,4 +1,6 @@
1
- ## [Unreleased]
1
+ ## [0.5.0] - 2024-01-05
2
+
3
+ - Add support for Ruby 3.3 / Bundler 2.5 / RubyGems 3.5
2
4
 
3
5
  ## [0.1.0] - 2023-10-02
4
6
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rubygems
4
4
  module Await
5
- VERSION = "0.4.1"
5
+ VERSION = "0.5.0"
6
6
  end
7
7
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "await/version"
4
+ require "rubygems/remote_fetcher"
4
5
 
5
6
  module Rubygems
6
7
  module Await
@@ -54,7 +55,7 @@ module Rubygems
54
55
  log { "#{Bundler.ui.add_color("missing", :yellow)}: #{format_element(missing)}" }
55
56
  process_collection(missing)
56
57
  rescue StandardError => e
57
- log_error(e)
58
+ log_error(e) { e.full_message(highlight: false) }
58
59
  ensure
59
60
  iteration += 1
60
61
  log(level: "debug") { "##{iteration} #{Time.now.-(start).round(2)}s" } if start
@@ -119,17 +120,38 @@ module Rubygems
119
120
  def compact_index_client
120
121
  remote = Bundler::Source::Rubygems::Remote.new URI(source)
121
122
  fetcher = Bundler::Fetcher.new(remote)
122
- client = Bundler::Fetcher::CompactIndex.new(fetcher.send(:downloader), remote,
123
- fetcher.uri).send(:compact_index_client)
123
+ client =
124
+ if Bundler::VERSION < "2.5.0"
125
+ Bundler::Fetcher::CompactIndex.new(fetcher.send(:downloader), remote, fetcher.uri)
126
+ else
127
+ Bundler::Fetcher::CompactIndex.new(fetcher.send(:downloader), remote, fetcher.uri,
128
+ fetcher.gem_remote_fetcher)
129
+ end.send(:compact_index_client)
124
130
  # ensure that updating info always hits the network
125
131
  client.instance_variable_set(:@info_checksums_by_name, Hash.new { "" })
126
132
  client
127
133
  end
128
134
 
135
+ def gem_remote_fetcher
136
+ if Bundler.rubygems.respond_to?(:gem_remote_fetcher)
137
+ Bundler.rubygems.gem_remote_fetcher
138
+ else
139
+ remote = Bundler::Source::Rubygems::Remote.new URI(source)
140
+ fetcher = Bundler::Fetcher.new(remote)
141
+ raise "unsupported bundler version" unless fetcher.respond_to?(:gem_remote_fetcher)
142
+
143
+ fetcher.gem_remote_fetcher
144
+ end
145
+ end
146
+
129
147
  def index_fetcher
130
148
  remote = Bundler::Source::Rubygems::Remote.new URI(source)
131
149
  fetcher = Bundler::Fetcher.new(remote)
132
- Bundler::Fetcher::Index.new(fetcher.send(:downloader), remote, fetcher.uri)
150
+ if Bundler::VERSION < "2.5.0"
151
+ Bundler::Fetcher::Index.new(fetcher.send(:downloader), remote, fetcher.uri)
152
+ else
153
+ Bundler::Fetcher::Index.new(fetcher.send(:downloader), remote, fetcher.uri, fetcher.gem_remote_fetcher)
154
+ end
133
155
  end
134
156
 
135
157
  def self.awaiter_name
@@ -275,9 +297,8 @@ module Rubygems
275
297
 
276
298
  remote_gem_path = source_uri + "gems/#{gem_file_name}"
277
299
 
278
- fetcher = Bundler.rubygems.gem_remote_fetcher
279
300
  Bundler::SharedHelpers.filesystem_access(local_gem_path) do
280
- fetcher.cache_update_path remote_gem_path, local_gem_path
301
+ gem_remote_fetcher.cache_update_path remote_gem_path, local_gem_path
281
302
  end
282
303
  true
283
304
  rescue Gem::RemoteFetcher::FetchError => e
@@ -296,9 +317,8 @@ module Rubygems
296
317
  end
297
318
 
298
319
  def process_collection(missing)
299
- fetcher = Bundler.rubygems.gem_remote_fetcher
300
320
  path = source_uri + "specs.#{Gem.marshal_version}.gz"
301
- contents = fetcher.fetch_path(path)
321
+ contents = gem_remote_fetcher.fetch_path(path)
302
322
  idx = safe_load_marshal(contents)
303
323
 
304
324
  idx.each do |found|
@@ -318,9 +338,8 @@ module Rubygems
318
338
  end
319
339
 
320
340
  def process_collection(missing)
321
- fetcher = Bundler.rubygems.gem_remote_fetcher
322
341
  path = source_uri + "prerelease_specs.#{Gem.marshal_version}.gz"
323
- contents = fetcher.fetch_path(path)
342
+ contents = gem_remote_fetcher.fetch_path(path)
324
343
  idx = safe_load_marshal(contents)
325
344
 
326
345
  idx.each do |found|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-await
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Giddins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-14 00:00:00.000000000 Z
11
+ date: 2024-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  - !ruby/object:Gem::Version
69
69
  version: '3.2'
70
70
  requirements: []
71
- rubygems_version: 3.4.10
71
+ rubygems_version: 3.5.3
72
72
  signing_key:
73
73
  specification_version: 4
74
74
  summary: A RubyGems plugin with a command to wait until gems are available.