bundle-patch 0.2.0 → 0.3.0
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 +4 -4
- data/lib/bundle/patch/config.rb +31 -0
- data/lib/bundle/patch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e963f237bf1d991d0654cc32c1b70cecc98029e3a553cd0b5aeeb183aeac80c
|
4
|
+
data.tar.gz: f84762b82d02ff168f56b82de3ea4680eac772f8f937caace1f5be38ea70e59a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbf5c83c3e1e2a4ac162203cc06a9ed04e8eb0bac24f4afa2ef5dc024c85ef6bd6a66cae6b846c2880dc3921cbfdbe6913e0ba7963541a33bfc5634f0f7c9c5f
|
7
|
+
data.tar.gz: fae818ce5b5bc0cf74a095911beeee2d80edac1b474fbad89c0d12c4d08aca50407a587d9fc5ec763e805b8fa9c10b1f618cd7c42bc927e9882d0602b34e7183
|
data/lib/bundle/patch/config.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
# lib/bundle/patch/config.rb
|
2
|
+
require "optparse"
|
3
|
+
|
2
4
|
module Bundle
|
3
5
|
module Patch
|
4
6
|
class Config
|
@@ -10,6 +12,35 @@ module Bundle
|
|
10
12
|
@skip_bundle_install = skip_bundle_install
|
11
13
|
end
|
12
14
|
|
15
|
+
def self.from_argv(argv)
|
16
|
+
options = {
|
17
|
+
dry_run: false,
|
18
|
+
skip_bundle_install: false,
|
19
|
+
mode: "patch"
|
20
|
+
}
|
21
|
+
|
22
|
+
OptionParser.new do |opts|
|
23
|
+
opts.banner = "Usage: bundle-patch [options]"
|
24
|
+
|
25
|
+
opts.on("--dry-run", "Print what would be done, but don't change anything") do
|
26
|
+
options[:dry_run] = true
|
27
|
+
end
|
28
|
+
|
29
|
+
opts.on("--skip-bundle-install", "Skip running `bundle install` after patching") do
|
30
|
+
options[:skip_bundle_install] = true
|
31
|
+
end
|
32
|
+
|
33
|
+
opts.on("--mode=MODE", "Update mode: patch (default), minor, or all") do |mode|
|
34
|
+
unless %w[patch minor all].include?(mode)
|
35
|
+
raise OptionParser::InvalidArgument, "Invalid mode: #{mode}"
|
36
|
+
end
|
37
|
+
options[:mode] = mode
|
38
|
+
end
|
39
|
+
end.parse!(argv)
|
40
|
+
|
41
|
+
new(**options)
|
42
|
+
end
|
43
|
+
|
13
44
|
def allow_update?(from_version, to_version)
|
14
45
|
return true if mode == "all"
|
15
46
|
|
data/lib/bundle/patch/version.rb
CHANGED