prebundler 0.11.0 → 0.11.5

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: cdbc2df59f7a6b2a3cd74528a7d7616e66f77f3db95b33c0e8711a9f02e76fca
4
- data.tar.gz: 3567b92be6e9e2758eb355793afcbeb29b610d075f10a2c9b854ea2549e4b4a2
3
+ metadata.gz: 23e5c0e7fe7ae30eebcbcf95a220f33f5266c5afafdb2264dcd993822a9242bd
4
+ data.tar.gz: 4828d877ee9720d864381c47fb3e66dfb7690350194941f0be7c4f0220b8c8db
5
5
  SHA512:
6
- metadata.gz: 4d363752272279c388473875acaeae4d87d6cdb88d0effc192f685c7391f43ff5d6bb8c9278df2a92227d8fcf2534ce4b6289c7e9236607e91501a2d8ee0754e
7
- data.tar.gz: f3e839f0e5cf217638741833400bb47005d5ef6b86045513871ea779c00c03bd209efc80c2e6dd3cb61d8eca66aea49d1539ba2d5418e6cdbe4baf078487851d
6
+ metadata.gz: 578be20b017a8132b04685b52d87737cb2b97a7549f4e02f4051b781a6e732399895d333f5696acb38019b0883957bb324c61cf05d988b7eb00be8dd4178f194
7
+ data.tar.gz: 670fc343ab7c1287a1a8c44fdd891025dbe8fc937566550b6a1aa79a2d7ff10f986665b36a833014523ca7d0d7dad868227244e4f587243b9f8474b6128a3576
@@ -1,3 +1,25 @@
1
+ 0.11.5
2
+ ===
3
+ - Add `--retry` flag to CLI (currently does nothing).
4
+
5
+ 0.11.4
6
+ ===
7
+ - Ensure .bundle/config directory exists before writing to it.
8
+
9
+ 0.11.3
10
+ ===
11
+ - Support (well, add stubs for) `ruby` and `git_source` methods in Gemfiles.
12
+ - Don't attempt to install gems we can't get a spec for.
13
+
14
+ 0.11.2
15
+ ===
16
+ - Always run `bundle install` just in case.
17
+ - Make sure `bundle check` is the _last_ thing that runs.
18
+
19
+ 0.11.1
20
+ ===
21
+ - Exit with nonzero status code if fallback `bundle install` fails.
22
+
1
23
  0.11.0
2
24
  ===
3
25
  - Allow the caller to pass in a s3 client for non-standard setups
@@ -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)
@@ -6,13 +6,26 @@ require 'yaml'
6
6
 
7
7
  module Prebundler
8
8
  module Cli
9
+ class BundleFailedError < StandardError
10
+ attr_reader :exitstatus
11
+
12
+ def initialize(message, exitstatus)
13
+ super(message)
14
+ @exitstatus = exitstatus
15
+ end
16
+ end
17
+
9
18
  class Install < Base
10
19
  def run
11
20
  prepare
12
21
  install
13
22
  update_bundle_config
14
23
  generate_binstubs
15
- check
24
+ # always run `bundle install` just in case
25
+ bundle_install
26
+ rescue BundleFailedError => e
27
+ out.puts e.message
28
+ exit e.exitstatus
16
29
  end
17
30
 
18
31
  private
@@ -105,6 +118,7 @@ module Prebundler
105
118
  config = File.exist?(file) ? YAML.load_file(file) : {}
106
119
  config['BUNDLE_WITH'] = with_groups.join(':') unless with_groups.empty?
107
120
  config['BUNDLE_WITHOUT'] = without_groups.join(':') unless without_groups.empty?
121
+ FileUtils.mkdir_p(File.dirname(file))
108
122
  File.write(file, YAML.dump(config))
109
123
  end
110
124
 
@@ -124,12 +138,19 @@ module Prebundler
124
138
  out.puts 'Done generating binstubs'
125
139
  end
126
140
 
127
- def check
141
+ def bundle_install
142
+ system "bundle install #{bundle_install_args}"
143
+
144
+ if $?.exitstatus != 0
145
+ raise BundleFailedError.new(
146
+ "bundler exited with status code #{$?.exitstatus}", $?.exitstatus
147
+ )
148
+ end
149
+
128
150
  system "bundle check --gemfile #{gemfile_path}"
129
151
 
130
152
  if $?.exitstatus != 0
131
- out.puts 'Bundle not satisfied, falling back to `bundle install`'
132
- system "bundle install #{bundle_install_args}"
153
+ raise BundleFailedError.new('bundle could not be satisfied', $?.exitstatus)
133
154
  end
134
155
  end
135
156
 
@@ -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.0'
4
+ VERSION = '0.11.5'
5
5
  end
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.0
4
+ version: 0.11.5
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: 2019-05-06 00:00:00.000000000 Z
11
+ date: 2020-11-12 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
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: []