prebundler 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75422e084b72865d0f97cb99580c87cdf50ce263556add99479b77d8e095b477
4
- data.tar.gz: 91188f02b6a86aa26060ca26344123b048284de767517ed946649dd2c3e1c92a
3
+ metadata.gz: c0fa034ffbb98e0cc6d86acf0f364e18524ad9fccb58531d8ce9a6c17eb0cada
4
+ data.tar.gz: 05ed655f3564bb17000ae9513d224800431670115357f3b379b5c9031853a8b5
5
5
  SHA512:
6
- metadata.gz: 80a342250f5250cd36e1c12d55e2e1d3c4e4f4505b2c474e91d9003d091703c4c0bb182f5a2dcb3ce2a00c1ba296017e029d2b8905cbb86bd07857c559cf1250
7
- data.tar.gz: ac8d04188d17021d38e6b1c9dc0a217b43c8902e7c6d568efe1a4d9ed0adbcc6e964d1c383b21b6825fac3c4623670353b72e12a6ad5c2a1c3676ef2159b3f3b
6
+ metadata.gz: aae6ace1ae931abd77108a31fff2df2a5d3a896922ae916c40cb89ef9043a8bb789460c51f87f4868381deef46eb5df8676c01b912fe43c4ff15946de7ab94a8
7
+ data.tar.gz: 7e198a678b46e2d303ad5b6cce696f9526211d9f765dcff49765947b9af5d52c3dd7839a72ab6c43d71dc5f320425b44f57fd4ba19cb7b03449df37efd046833
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.15.2
2
+ * Fix issue causing prebundler to store empty archives for some gems with native extensions.
3
+ - `Bundler.local_platform` reports "aarch64-linux" in my Docker container, but eg. nokogiri's platform is "aarch64-linux-gnu." Using Bundler's local platform to identify the gem's installation directory silently fails because we're missing the "-gnu" part, so no files are included in the archive.
4
+
5
+ ## 0.15.1
6
+ * Specify file path when evaling other gemfiles.
7
+ - `instance_eval` takes two additional arguments, the first of which populates the value of the `__FILE__` constant. This argument was not being passed in several cases, which led to an unexpected working directory when calling `eval_gemfile` with relative paths.
8
+
1
9
  ## 0.15.0
2
10
  * Add the `prebundle lock` command, which simply invokes `bundle lock`.
3
11
 
data/Gemfile CHANGED
@@ -5,6 +5,7 @@ gemspec
5
5
  group :development, :test do
6
6
  gem 'pry-byebug'
7
7
  gem 'rake'
8
+ gem 'rexml'
8
9
  end
9
10
 
10
11
  group :test do
@@ -117,9 +117,13 @@ module Prebundler
117
117
  end
118
118
 
119
119
  def store_gem(gem_ref, dest_file)
120
- out.puts "Storing #{gem_ref.id}"
121
- gem_ref.add_to_tar(dest_file)
122
- config.storage_backend.store_file(dest_file, gem_ref.tar_file)
120
+ if File.exist?(gem_ref.install_dir)
121
+ out.puts "Storing #{gem_ref.id}"
122
+ gem_ref.add_to_tar(dest_file)
123
+ config.storage_backend.store_file(dest_file, gem_ref.tar_file)
124
+ else
125
+ out.puts "Could not determine install dir for #{gem_ref.id}, skipping storage"
126
+ end
123
127
  end
124
128
 
125
129
  def update_bundle_config
@@ -188,7 +188,12 @@ module Prebundler
188
188
  end
189
189
 
190
190
  def find_platform_dir(base)
191
- platform = Bundler.local_platform.to_a
191
+ platform = case spec.platform
192
+ when String
193
+ [spec.platform]
194
+ else
195
+ spec.platform.to_a
196
+ end
192
197
 
193
198
  platform.size.downto(0) do |i|
194
199
  dir = [base, *platform[0...i]].join('-')
@@ -14,14 +14,18 @@ module Prebundler
14
14
  @gemfile_path = gemfile_path
15
15
  @bundle_path = bundle_path
16
16
  @prefix = options[:prefix]
17
- instance_eval(File.read(gemfile_path))
17
+ gemfile_path = File.expand_path(gemfile_path)
18
+ instance_eval(File.read(gemfile_path), gemfile_path, 0)
18
19
 
19
20
  lockfile = Bundler::LockfileParser.new(File.read("#{gemfile_path}.lock"))
21
+ local_platform = Bundler.local_platform
20
22
 
21
23
  lockfile.specs.each do |spec|
22
- gems[spec.name] ||= GemRef.create(spec.name, bundle_path, options)
23
- gems[spec.name].spec = spec
24
- gems[spec.name].dependencies = spec.dependencies.map(&:name)
24
+ if spec.match_platform(local_platform)
25
+ gems[spec.name] ||= GemRef.create(spec.name, bundle_path, options)
26
+ gems[spec.name].spec = spec
27
+ gems[spec.name].dependencies = spec.dependencies.map(&:name)
28
+ end
25
29
  end
26
30
 
27
31
  # Get rid of gems without a spec, as they are likely not supposed
@@ -75,7 +79,8 @@ module Prebundler
75
79
  end
76
80
 
77
81
  def eval_gemfile(path)
78
- instance_eval(File.read(path))
82
+ path = File.expand_path(path)
83
+ instance_eval(File.read(path), path, 0)
79
84
  end
80
85
  end
81
86
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Prebundler
4
- VERSION = '0.15.0'
4
+ VERSION = '0.15.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prebundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2022-02-07 00:00:00.000000000 Z
10
+ date: 2025-03-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -115,7 +114,6 @@ files:
115
114
  homepage: http://github.com/camertron
116
115
  licenses: []
117
116
  metadata: {}
118
- post_install_message:
119
117
  rdoc_options: []
120
118
  require_paths:
121
119
  - lib
@@ -130,8 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
128
  - !ruby/object:Gem::Version
131
129
  version: '0'
132
130
  requirements: []
133
- rubygems_version: 3.3.3
134
- signing_key:
131
+ rubygems_version: 3.6.2
135
132
  specification_version: 4
136
133
  summary: Gem dependency prebuilder
137
134
  test_files: []