bundle-patch 0.1.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: d8b17466b5eb121598328313cfad1610ffc24389696fe4560d4a069d77a0964b
4
- data.tar.gz: 8f27ad6af43d58e7d4d45b1c4929ea0a5f81f07acdedd392f07b22fbb3e71e8e
3
+ metadata.gz: 4e963f237bf1d991d0654cc32c1b70cecc98029e3a553cd0b5aeeb183aeac80c
4
+ data.tar.gz: f84762b82d02ff168f56b82de3ea4680eac772f8f937caace1f5be38ea70e59a
5
5
  SHA512:
6
- metadata.gz: fdee9fb0b56afdb55eaba3c51139b6ceff09b81bda3e2845b89ee84400508061f1386e04d1a13475bbf7dbf18186380de33cd57d1209ea276916d6ab85e7a4db
7
- data.tar.gz: 4b47dc321f9a3f976d65ab41c5bba00e3bc6ad4de4824503a588cad8d375c1711bea149a99c8240cfb7a44d9138d29d46a6144e8a26dfddf112287d1403724e6
6
+ metadata.gz: cbf5c83c3e1e2a4ac162203cc06a9ed04e8eb0bac24f4afa2ef5dc024c85ef6bd6a66cae6b846c2880dc3921cbfdbe6913e0ba7963541a33bfc5634f0f7c9c5f
7
+ data.tar.gz: fae818ce5b5bc0cf74a095911beeee2d80edac1b474fbad89c0d12c4d08aca50407a587d9fc5ec763e805b8fa9c10b1f618cd7c42bc927e9882d0602b34e7183
data/exe/bundle-patch ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ require "bundle/patch"
3
+ require "bundle/patch/config"
4
+
5
+ config = Bundle::Patch::Config.from_argv(ARGV)
6
+ Bundle::Patch.start(config)
@@ -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.1.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.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rishijain
@@ -28,7 +28,8 @@ description: bundle-patch is a CLI tool that detects vulnerable gems in your Gem
28
28
  strategy (patch/minor/all). Uses bundler-audit under the hood.
29
29
  email:
30
30
  - jainrishi.37@gmail.com
31
- executables: []
31
+ executables:
32
+ - bundle-patch
32
33
  extensions: []
33
34
  extra_rdoc_files: []
34
35
  files:
@@ -38,6 +39,7 @@ files:
38
39
  - Rakefile
39
40
  - bin/console
40
41
  - bin/setup
42
+ - exe/bundle-patch
41
43
  - lib/bundle-patch.rb
42
44
  - lib/bundle/patch.rb
43
45
  - lib/bundle/patch/audit/advisory.rb