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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0826c8763ed454c3e1765072b8d6fe361c241eb122d1442d216fd06109ae014
4
- data.tar.gz: c423a94bd2043d4e22ed1addf03936b62ca865d671c05529e1067fa7ff18d6a4
3
+ metadata.gz: 4e963f237bf1d991d0654cc32c1b70cecc98029e3a553cd0b5aeeb183aeac80c
4
+ data.tar.gz: f84762b82d02ff168f56b82de3ea4680eac772f8f937caace1f5be38ea70e59a
5
5
  SHA512:
6
- metadata.gz: 03c8684f16d1bc4b484a29314f3304fb985427f30ee9ac05b1d500885a323035fe2e1576639ce3a0eefb20eef2b0d6ad656bfb4616ccd2c282950ac5d8985844
7
- data.tar.gz: cbc9b6894eff3cbe31f299d63b35e8678fe18d99fbde1c02d7b0e0e74f9adbf12b0b3315f0bbc8282dbd56c1be67e36ead2496e66b08c23e229e77af15b9e2a5
6
+ metadata.gz: cbf5c83c3e1e2a4ac162203cc06a9ed04e8eb0bac24f4afa2ef5dc024c85ef6bd6a66cae6b846c2880dc3921cbfdbe6913e0ba7963541a33bfc5634f0f7c9c5f
7
+ data.tar.gz: fae818ce5b5bc0cf74a095911beeee2d80edac1b474fbad89c0d12c4d08aca50407a587d9fc5ec763e805b8fa9c10b1f618cd7c42bc927e9882d0602b34e7183
@@ -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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bundle
4
4
  module Patch
5
- VERSION = "0.2.0"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundle-patch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rishijain