prebundler 0.13.0 → 0.14.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: f1b4617c0c426fe9ac76ca98f6d9a80e849a6f8fb848817f7bfa6a9c5393b238
4
- data.tar.gz: be95fbc3f0f4f39682c2ee929d9a3c8ea27fd8db087f4a0d3d9c2c39f87c4b98
3
+ metadata.gz: 29f176a7f30feafc0288bcef4e1d519d364fe4b109a7dd2590b3c20a013908e2
4
+ data.tar.gz: dc8d72a575713cf2cb0e287af826a521a291c97266864c68e35da94c8c165d85
5
5
  SHA512:
6
- metadata.gz: 244764066b66efdc4feb132dc3f94ed455cf141fdeb14b758d935e6dd1d8b960f3bdef4d2c783709a41fff7e30e6405e4871514d4220f757181af4e0951e72fe
7
- data.tar.gz: 67d0a49d079f337e6522ed6765652f12e3fcd93546744f3ed0efae8e554e9f6604f8957118293c4d826985445048b7b65618cfbeb01a9af7b0a56b64a2cfa118
6
+ metadata.gz: 7cadcbdeef22c371ac69b91c069b5af37733804786f00562afcf5b38be73a016596e89b250b4f8ab06e7a3c8bdacac491aaeb3d4dce75554b377ce45cfa32f20
7
+ data.tar.gz: 351ac7ac53bbf7f60c3a98fa2b98aed366c1c02f6faf817f73511dae7420b232b130241830d183a31619b06e25b9087603befad9d44a70e4630c054632b84751
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.14.0
2
+ * Add `prebundle binstubs` command, which simply invokes `bundle binstubs`.
3
+
1
4
  ## 0.13.0
2
5
  * Support the `eval_gemfile` function in gemfiles.
3
6
  * Avoid shelling out to the `tar` command.
data/bin/prebundle CHANGED
@@ -1,130 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
- require 'gli'
4
- require 'etc'
5
- require 'bundler'
6
- require 'prebundler'
7
- require 'prebundler/version'
8
-
9
- $out = Prebundler::WritePipe.new
10
-
11
- include GLI::App
12
-
13
- program_desc 'Gem dependency prebuilder'
14
-
15
- version Prebundler::VERSION
16
-
17
- subcommand_option_handling :normal
18
- arguments :strict
19
-
20
- desc "Don't log to stdout"
21
- switch [:s, :silent]
22
-
23
- desc 'Path to config file.'
24
- default_value './.prebundle_config'
25
- flag [:c, :config]
26
-
27
- desc 'Install gems from the Gemfile.lock.'
28
- command :install do |c|
29
- c.desc 'Maximum number of parallel gem installs.'
30
- c.default_value Etc.nprocessors
31
- c.flag [:j, :jobs], type: Integer
32
-
33
- c.desc 'Path to the gemfile to install gems from.'
34
- c.default_value ENV.fetch('BUNDLE_GEMFILE', './Gemfile')
35
- c.flag [:g, :gemfile]
36
-
37
- c.desc 'Path to the bundle installation directory.'
38
- c.default_value ENV.fetch('BUNDLE_PATH', Bundler.bundle_path.to_s)
39
- c.flag [:b, :'bundle-path']
40
-
41
- c.desc 'Backend prefix (i.e. path) at which to store gems.'
42
- c.flag [:prefix]
43
-
44
- c.desc 'A comma-separated list of groups referencing gems to install.'
45
- c.flag :with
46
-
47
- c.desc 'A comma-separated list of groups referencing gems to skip during installation.'
48
- c.flag :without
49
-
50
- c.desc 'Generate binstubs for installed gems.'
51
- c.default_value true
52
- c.switch :binstubs
53
-
54
- c.desc 'Retry failed network requests n times (currently not implemented).'
55
- c.default_value 1
56
- c.flag [:retry], type: Integer
3
+ $stdout.sync = true
57
4
 
58
- c.action do |global_options, options, args|
59
- raise 'Must specify a non-zero number of jobs' if options[:jobs] < 1
60
- Prebundler::Cli::Install.run($out, global_options, options, args)
61
- end
62
- end
63
-
64
- desc 'List each gem and associated source.'
65
- command :list do |c|
66
- c.desc 'Path to the gemfile.'
67
- c.default_value ENV.fetch('BUNDLE_GEMFILE', './Gemfile')
68
- c.flag [:g, :gemfile]
69
-
70
- c.desc 'Filter by source. Will perform partial matching.'
71
- c.flag [:s, :source], multiple: true
72
-
73
- c.action do |global_options, options, args|
74
- Prebundler::Cli::List.run($out, global_options, options, args)
75
- end
76
- end
77
-
78
- desc 'Generate a subset of a Gemfile.'
79
- command :subset do |c|
80
- c.desc 'Path to the gemfile.'
81
- c.default_value ENV.fetch('BUNDLE_GEMFILE', './Gemfile')
82
- c.flag [:g, :gemfile]
83
-
84
- c.desc 'Path to the bundle installation directory.'
85
- c.default_value ENV.fetch('BUNDLE_PATH', Bundler.bundle_path.to_s)
86
- c.flag [:b, :'bundle-path']
87
-
88
- c.desc 'Gem (and dependencies) to include in the subset.'
89
- c.flag [:i, :include], multiple: true
90
-
91
- c.desc "Add an additional gem to the subset. The gem doesn't have to be part of the original Gemfile."
92
- c.flag [:a, :add], multiple: true
93
-
94
- c.desc 'Include development dependencies of subsetted gems.'
95
- c.default_value false
96
- c.switch [:d, :development]
97
-
98
- c.desc 'File path to output the resulting Gemfile into. Use - for standard output.'
99
- c.default_value '-'
100
- c.flag [:o, :output]
101
-
102
- c.action do |global_options, options, args|
103
- Prebundler::Cli::Subset.run($out, global_options, options, args)
104
- end
105
- end
106
-
107
- pre do |global, command, options, args|
108
- # Pre logic here
109
- # Return true to proceed; false to abort and not call the
110
- # chosen command
111
- # Use skips_pre before a command to skip this block
112
- # on that command only
113
- $out.silence! if global[:silent]
114
- load global[:config] if global[:config]
115
- true
116
- end
117
-
118
- post do |global, command, options, args|
119
- # Post logic here
120
- # Use skips_post before a command to skip this
121
- # block on that command only
122
- end
123
-
124
- on_error do |exception|
125
- # Error logic here
126
- # return false to skip default error handling
127
- true
128
- end
129
-
130
- exit run(ARGV)
5
+ require 'prebundler'
6
+ exit Prebundler::Commands.run(ARGV)
@@ -0,0 +1,146 @@
1
+ require 'gli'
2
+ require 'etc'
3
+ require 'bundler'
4
+ require 'prebundler'
5
+ require 'prebundler/version'
6
+
7
+ module Prebundler
8
+ class Commands
9
+ extend GLI::App
10
+
11
+ program_desc 'Gem dependency prebuilder'
12
+
13
+ version Prebundler::VERSION
14
+
15
+ subcommand_option_handling :normal
16
+ arguments :strict
17
+
18
+ def self.out
19
+ @out ||= Prebundler::WritePipe.new
20
+ end
21
+
22
+ desc "Don't log to stdout"
23
+ switch [:s, :silent]
24
+
25
+ desc 'Path to config file.'
26
+ default_value './.prebundle_config'
27
+ flag [:c, :config]
28
+
29
+ desc 'Install gems from the Gemfile.lock.'
30
+ command :install do |c|
31
+ c.desc 'Maximum number of parallel gem installs.'
32
+ c.default_value Etc.nprocessors
33
+ c.flag [:j, :jobs], type: Integer
34
+
35
+ c.desc 'Path to the gemfile to install gems from.'
36
+ c.default_value ENV.fetch('BUNDLE_GEMFILE', './Gemfile')
37
+ c.flag [:g, :gemfile]
38
+
39
+ c.desc 'Path to the bundle installation directory.'
40
+ c.default_value ENV.fetch('BUNDLE_PATH', Bundler.bundle_path.to_s)
41
+ c.flag [:b, :'bundle-path']
42
+
43
+ c.desc 'Backend prefix (i.e. path) at which to store gems.'
44
+ c.flag [:prefix]
45
+
46
+ c.desc 'A comma-separated list of groups referencing gems to install.'
47
+ c.flag :with
48
+
49
+ c.desc 'A comma-separated list of groups referencing gems to skip during installation.'
50
+ c.flag :without
51
+
52
+ c.desc 'Generate binstubs for installed gems.'
53
+ c.default_value true
54
+ c.switch :binstubs
55
+
56
+ c.desc 'Retry failed network requests n times (currently not implemented).'
57
+ c.default_value 1
58
+ c.flag [:retry], type: Integer
59
+
60
+ c.action do |global_options, options, args|
61
+ raise 'Must specify a non-zero number of jobs' if options[:jobs] < 1
62
+ Prebundler::Cli::Install.run(out, global_options, options, args)
63
+ end
64
+ end
65
+
66
+ desc 'List each gem and associated source.'
67
+ command :list do |c|
68
+ c.desc 'Path to the gemfile.'
69
+ c.default_value ENV.fetch('BUNDLE_GEMFILE', './Gemfile')
70
+ c.flag [:g, :gemfile]
71
+
72
+ c.desc 'Filter by source. Will perform partial matching.'
73
+ c.flag [:s, :source], multiple: true
74
+
75
+ c.action do |global_options, options, args|
76
+ Prebundler::Cli::List.run(out, global_options, options, args)
77
+ end
78
+ end
79
+
80
+ desc 'Generate a subset of a Gemfile.'
81
+ command :subset do |c|
82
+ c.desc 'Path to the gemfile.'
83
+ c.default_value ENV.fetch('BUNDLE_GEMFILE', './Gemfile')
84
+ c.flag [:g, :gemfile]
85
+
86
+ c.desc 'Path to the bundle installation directory.'
87
+ c.default_value ENV.fetch('BUNDLE_PATH', Bundler.bundle_path.to_s)
88
+ c.flag [:b, :'bundle-path']
89
+
90
+ c.desc 'Gem (and dependencies) to include in the subset.'
91
+ c.flag [:i, :include], multiple: true
92
+
93
+ c.desc "Add an additional gem to the subset. The gem doesn't have to be part of the original Gemfile."
94
+ c.flag [:a, :add], multiple: true
95
+
96
+ c.desc 'Include development dependencies of subsetted gems.'
97
+ c.default_value false
98
+ c.switch [:d, :development]
99
+
100
+ c.desc 'File path to output the resulting Gemfile into. Use - for standard output.'
101
+ c.default_value '-'
102
+ c.flag [:o, :output]
103
+
104
+ c.action do |global_options, options, args|
105
+ Prebundler::Cli::Subset.run(out, global_options, options, args)
106
+ end
107
+ end
108
+
109
+ desc 'Generate binstubs. Accepts the same arguments as `bundle binstubs`.'
110
+ command :binstubs do
111
+ end
112
+
113
+ singleton_class.send(:prepend, Module.new do
114
+ def run(args)
115
+ if args[0] == 'binstubs'
116
+ exec "bundle binstubs #{args[1..-1].join(' ')}"
117
+ else
118
+ super
119
+ end
120
+ end
121
+ end)
122
+
123
+ pre do |global, command, options, args|
124
+ # Pre logic here
125
+ # Return true to proceed; false to abort and not call the
126
+ # chosen command
127
+ # Use skips_pre before a command to skip this block
128
+ # on that command only
129
+ out.silence! if global[:silent]
130
+ load global[:config] if global[:config]
131
+ true
132
+ end
133
+
134
+ post do |global, command, options, args|
135
+ # Post logic here
136
+ # Use skips_post before a command to skip this
137
+ # block on that command only
138
+ end
139
+
140
+ on_error do |exception|
141
+ # Error logic here
142
+ # return false to skip default error handling
143
+ true
144
+ end
145
+ end
146
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Prebundler
4
- VERSION = '0.13.0'
4
+ VERSION = '0.14.0'
5
5
  end
data/lib/prebundler.rb CHANGED
@@ -2,6 +2,7 @@ require 'ohey'
2
2
 
3
3
  module Prebundler
4
4
  autoload :Cli, 'prebundler/cli'
5
+ autoload :Commands, 'prebundler/commands'
5
6
  autoload :Configurator, 'prebundler/configurator'
6
7
  autoload :FileBackend, 'prebundler/file_backend'
7
8
  autoload :PathGemRef, 'prebundler/path_gem_ref'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prebundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
@@ -99,6 +99,7 @@ files:
99
99
  - lib/prebundler/cli/install.rb
100
100
  - lib/prebundler/cli/list.rb
101
101
  - lib/prebundler/cli/subset.rb
102
+ - lib/prebundler/commands.rb
102
103
  - lib/prebundler/configurator.rb
103
104
  - lib/prebundler/file_backend.rb
104
105
  - lib/prebundler/gem_ref.rb