prebundler 0.11.1 → 0.11.6

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: a908fd14a0e3c7ce0342d02e4bcb8342071215b1b8f168d04ae84fadd09bfd70
4
- data.tar.gz: db4b8827c8234bc052d7876c4282e211e7ca8b4291c21c641213143c8d403e9b
3
+ metadata.gz: fdf192e38f6f57692d64316b8b3d2ae645ee28a482c47e6e2bf1f14adfa283bc
4
+ data.tar.gz: 66c8f18686a990bcc1b222e4c76c6c7069793a92cd2f4bc1f102bcd2ed978b7c
5
5
  SHA512:
6
- metadata.gz: 1c84b849e59d79d167b3f182369be1f387ad32b9df5c0c3b877d988db5be44e3377fbe77597965ba94b4195f7343f57d17a2201e20373b325dd3b854af57b4b9
7
- data.tar.gz: 5ed4dda5f56215f0d073e7bcf3741b8c8511a49c425c699799fcbb3ed77e5603e7179e90af57bc599a2888ec3c4b680dea426571ef978940e6f8aafb88b6911d
6
+ metadata.gz: 446f73025c6af47a142eba416e109805977fba9486a1120c6b726c20b3edddfd747ac459206b7780b75218a9abf6507ee502d50d6a4040b6de40769259af7f0b
7
+ data.tar.gz: 72e86b825eae349a11a6b606faba2cc6280a3b125415bcf1dd2df28f80dbc3312dfeb56de4fceafc4bbe0d017528aab45710857f912c5934f7c228e4f4e049da
@@ -1,3 +1,27 @@
1
+ 0.11.6
2
+ ===
3
+ - Fix bug causing native extension compile errors.
4
+ - Fix bug causing executables to not be included in tarballs.
5
+ - Fix bug (maybe introduced by bundler 2?) causing incorrect directory to be tarred. Directory can now include platform apparently.
6
+
7
+ 0.11.5
8
+ ===
9
+ - Add `--retry` flag to CLI (currently does nothing).
10
+
11
+ 0.11.4
12
+ ===
13
+ - Ensure .bundle/config directory exists before writing to it.
14
+
15
+ 0.11.3
16
+ ===
17
+ - Support (well, add stubs for) `ruby` and `git_source` methods in Gemfiles.
18
+ - Don't attempt to install gems we can't get a spec for.
19
+
20
+ 0.11.2
21
+ ===
22
+ - Always run `bundle install` just in case.
23
+ - Make sure `bundle check` is the _last_ thing that runs.
24
+
1
25
  0.11.1
2
26
  ===
3
27
  - Exit with nonzero status code if fallback `bundle install` fails.
@@ -51,6 +51,10 @@ command :install do |c|
51
51
  c.default_value true
52
52
  c.switch :binstubs
53
53
 
54
+ c.desc 'Retry failed network requests n times (currently not implemented).'
55
+ c.default_value 1
56
+ c.flag [:retry], type: Integer
57
+
54
58
  c.action do |global_options, options, args|
55
59
  raise 'Must specify a non-zero number of jobs' if options[:jobs] < 1
56
60
  Prebundler::Cli::Install.run($out, global_options, options, args)
@@ -21,7 +21,8 @@ module Prebundler
21
21
  install
22
22
  update_bundle_config
23
23
  generate_binstubs
24
- check
24
+ # always run `bundle install` just in case
25
+ bundle_install
25
26
  rescue BundleFailedError => e
26
27
  out.puts e.message
27
28
  exit e.exitstatus
@@ -117,6 +118,7 @@ module Prebundler
117
118
  config = File.exist?(file) ? YAML.load_file(file) : {}
118
119
  config['BUNDLE_WITH'] = with_groups.join(':') unless with_groups.empty?
119
120
  config['BUNDLE_WITHOUT'] = without_groups.join(':') unless without_groups.empty?
121
+ FileUtils.mkdir_p(File.dirname(file))
120
122
  File.write(file, YAML.dump(config))
121
123
  end
122
124
 
@@ -136,18 +138,19 @@ module Prebundler
136
138
  out.puts 'Done generating binstubs'
137
139
  end
138
140
 
139
- def check
140
- system "bundle check --gemfile #{gemfile_path}"
141
+ def bundle_install
142
+ system "bundle install #{bundle_install_args}"
141
143
 
142
144
  if $?.exitstatus != 0
143
- out.puts 'Bundle not satisfied, falling back to `bundle install`'
144
- system "bundle install #{bundle_install_args}"
145
+ raise BundleFailedError.new(
146
+ "bundler exited with status code #{$?.exitstatus}", $?.exitstatus
147
+ )
148
+ end
145
149
 
146
- if $?.exitstatus != 0
147
- raise BundleFailedError.new(
148
- "bundler exited with status code #{$?.exitstatus}", $?.exitstatus
149
- )
150
- end
150
+ system "bundle check --gemfile #{gemfile_path}"
151
+
152
+ if $?.exitstatus != 0
153
+ raise BundleFailedError.new('bundle could not be satisfied', $?.exitstatus)
151
154
  end
152
155
  end
153
156
 
@@ -48,7 +48,10 @@ module Prebundler
48
48
  end
49
49
 
50
50
  def install
51
- system({ "GEM_HOME" => bundle_path }, "gem install -N --ignore-dependencies --source #{source} #{name} -v #{version}")
51
+ Bundler.with_unbundled_env do
52
+ system({ "GEM_HOME" => bundle_path }, "gem install -N --ignore-dependencies --source #{source} #{name} -v #{version}")
53
+ end
54
+
52
55
  $?.exitstatus
53
56
  end
54
57
 
@@ -71,7 +74,7 @@ module Prebundler
71
74
  end
72
75
 
73
76
  executables.each do |executable|
74
- system "tar -C #{bundle_path} -rf #{tar_file} #{File.join('bin', executable)}"
77
+ system "tar -C #{bundle_path} -rf #{tar_file} #{File.join(relative_gem_dir, 'bin', executable)}"
75
78
  end
76
79
  end
77
80
 
@@ -114,7 +117,17 @@ module Prebundler
114
117
  end
115
118
 
116
119
  def relative_gem_dir
117
- File.join('gems', id)
120
+ @relative_gem_dir ||= begin
121
+ base = File.join('gems', id)
122
+ platform = Bundler.local_platform.to_a
123
+
124
+ platform.size.downto(0) do |i|
125
+ dir = [base, *platform[0...i]].join('-')
126
+ return dir if File.directory?(File.join(bundle_path, dir))
127
+ end
128
+
129
+ base
130
+ end
118
131
  end
119
132
 
120
133
  def relative_gemspec_files
@@ -23,6 +23,12 @@ module Prebundler
23
23
  gems[spec.name].spec = spec
24
24
  gems[spec.name].dependencies = spec.dependencies.map(&:name)
25
25
  end
26
+
27
+ # Get rid of gems without a spec, as they are likely not supposed
28
+ # to be installed. This happens for gems like tzinfo-data which are
29
+ # listed in the standard rails Gemfile but only installed on
30
+ # certain platforms.
31
+ gems.reject! { |_, g| g.spec.nil? }
26
32
  end
27
33
 
28
34
  def current_context
@@ -34,6 +40,13 @@ module Prebundler
34
40
  }
35
41
  end
36
42
 
43
+ def ruby(*args)
44
+ end
45
+
46
+ # this is probably the wrong thing to do
47
+ def git_source(*args)
48
+ end
49
+
37
50
  def gem(name, *args)
38
51
  options = args.find { |a| a.is_a?(Hash) } || {}
39
52
  gems[name] = GemRef.create(name, bundle_path, current_context.merge(options))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Prebundler
4
- VERSION = '0.11.1'
4
+ VERSION = '0.11.6'
5
5
  end
@@ -9,9 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.homepage = 'http://github.com/camertron'
10
10
 
11
11
  s.description = s.summary = 'Gem dependency prebuilder'
12
-
13
12
  s.platform = Gem::Platform::RUBY
14
- s.has_rdoc = true
15
13
 
16
14
  s.add_dependency 'bundler'
17
15
  s.add_dependency 'parallel', '~> 1.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prebundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-28 00:00:00.000000000 Z
11
+ date: 2020-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -114,7 +114,7 @@ files:
114
114
  homepage: http://github.com/camertron
115
115
  licenses: []
116
116
  metadata: {}
117
- post_install_message:
117
+ post_install_message:
118
118
  rdoc_options: []
119
119
  require_paths:
120
120
  - lib
@@ -129,9 +129,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  requirements: []
132
- rubyforge_project:
133
- rubygems_version: 2.7.6.2
134
- signing_key:
132
+ rubygems_version: 3.1.4
133
+ signing_key:
135
134
  specification_version: 4
136
135
  summary: Gem dependency prebuilder
137
136
  test_files: []