bundle_update_interactive 0.9.1 → 0.10.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/README.md +11 -0
- data/lib/bundle_update_interactive/cli/options.rb +9 -1
- data/lib/bundle_update_interactive/cli/table.rb +2 -2
- data/lib/bundle_update_interactive/cli.rb +1 -1
- data/lib/bundle_update_interactive/gemfile.rb +4 -0
- data/lib/bundle_update_interactive/updater.rb +6 -3
- data/lib/bundle_update_interactive/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 903a652a152b38ae645e7aea5a4216d36f464b8c9de1fb7a912d2a68aeb0a25d
|
4
|
+
data.tar.gz: cebf133ae5be56b8706ead28c59ea8d2c11967a0994327fa8ccd8ab41ef99c5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 170ac818830a83eda22e6b24349e81af25d9aeeace867e839e6e9b96ebd93b19cf3b2e7d72df8b5e3610fe3390ae95791be034dfae7d147f75964a9075c055fe
|
7
|
+
data.tar.gz: 8d3c98c30d19335071e3c582e8e828039da65b53231b38968147a4dbf3a13f6532b5bfb9db12e03d6da2a15a88a6f14a3cbf17d8b5531fa62e93515386c3c308
|
data/README.md
CHANGED
@@ -44,6 +44,7 @@ bundle ui
|
|
44
44
|
|
45
45
|
- `--commit` [applies each gem update in a discrete git commit](#git-commits)
|
46
46
|
- `--latest` [modifies the Gemfile if necessary to allow the latest gem versions](#allow-latest-versions)
|
47
|
+
- `--only-explicit` [updates Gemfile gems only (excluding indirect dependencies)](#exclude-indirect-dependencies)
|
47
48
|
- `-D` / `--exclusively=GROUP` [limits updatable gems by Gemfile groups](#limit-impact-by-gemfile-groups)
|
48
49
|
|
49
50
|
## Features
|
@@ -145,6 +146,16 @@ https://github.com/rails/rails/compare/5a8d894...77dfa65
|
|
145
146
|
|
146
147
|
This feature currently works for GitHub, GitLab, and Bitbucket repos.
|
147
148
|
|
149
|
+
### Exclude indirect dependencies
|
150
|
+
|
151
|
+
Just like with `bundle outdated`, you can pass `--only-explicit` to limit updates to only gems that are explicitly listed in the Gemfile.
|
152
|
+
|
153
|
+
```sh
|
154
|
+
bundle update-interactive --only-explicit
|
155
|
+
```
|
156
|
+
|
157
|
+
This will omit indirect dependencies from the list of gems that can be updated.
|
158
|
+
|
148
159
|
### Limit impact by Gemfile groups
|
149
160
|
|
150
161
|
The effects of `bundle update-interactive` can be limited to one or more Gemfile groups using the `--exclusively` option:
|
@@ -71,6 +71,9 @@ module BundleUpdateInteractive
|
|
71
71
|
parser.on("--latest", "Modify the Gemfile to allow the latest gem versions") do
|
72
72
|
options.latest = true
|
73
73
|
end
|
74
|
+
parser.on("--only-explicit", "Update Gemfile gems only (no indirect dependencies)") do
|
75
|
+
options.only_explicit = true
|
76
|
+
end
|
74
77
|
parser.on(
|
75
78
|
"--exclusively=GROUP",
|
76
79
|
"Update gems exclusively belonging to the specified Gemfile GROUP(s)"
|
@@ -94,12 +97,13 @@ module BundleUpdateInteractive
|
|
94
97
|
end
|
95
98
|
|
96
99
|
attr_accessor :exclusively
|
97
|
-
attr_writer :commit, :latest
|
100
|
+
attr_writer :commit, :latest, :only_explicit
|
98
101
|
|
99
102
|
def initialize
|
100
103
|
@exclusively = []
|
101
104
|
@commit = false
|
102
105
|
@latest = false
|
106
|
+
@only_explicit = false
|
103
107
|
end
|
104
108
|
|
105
109
|
def commit?
|
@@ -109,6 +113,10 @@ module BundleUpdateInteractive
|
|
109
113
|
def latest?
|
110
114
|
@latest
|
111
115
|
end
|
116
|
+
|
117
|
+
def only_explicit?
|
118
|
+
@only_explicit
|
119
|
+
end
|
112
120
|
end
|
113
121
|
end
|
114
122
|
end
|
@@ -47,7 +47,7 @@ module BundleUpdateInteractive
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def gem_names
|
50
|
-
rows.keys
|
50
|
+
rows.keys.sort
|
51
51
|
end
|
52
52
|
|
53
53
|
def render_header
|
@@ -61,7 +61,7 @@ module BundleUpdateInteractive
|
|
61
61
|
|
62
62
|
def render
|
63
63
|
lines = [render_header]
|
64
|
-
|
64
|
+
gem_names.each { |name| lines << render_gem(name) }
|
65
65
|
lines.join("\n")
|
66
66
|
end
|
67
67
|
|
@@ -61,7 +61,7 @@ module BundleUpdateInteractive
|
|
61
61
|
def generate_report(options)
|
62
62
|
whisper "Resolving latest gem versions..."
|
63
63
|
updater_class = options.latest? ? Latest::Updater : Updater
|
64
|
-
updater = updater_class.new(groups: options.exclusively)
|
64
|
+
updater = updater_class.new(groups: options.exclusively, only_explicit: options.only_explicit?)
|
65
65
|
|
66
66
|
report = updater.generate_report
|
67
67
|
unless report.empty?
|
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
module BundleUpdateInteractive
|
4
4
|
class Updater
|
5
|
-
def initialize(groups: [])
|
5
|
+
def initialize(groups: [], only_explicit: false)
|
6
|
+
@only_explicit = only_explicit
|
6
7
|
@gemfile = Gemfile.parse
|
7
8
|
@current_lockfile = Lockfile.parse
|
8
9
|
@candidate_gems = current_lockfile.gems_exclusively_installed_by(gemfile: gemfile, groups: groups) if groups.any?
|
@@ -32,12 +33,14 @@ module BundleUpdateInteractive
|
|
32
33
|
|
33
34
|
private
|
34
35
|
|
35
|
-
attr_reader :gemfile, :current_lockfile, :candidate_gems
|
36
|
+
attr_reader :gemfile, :current_lockfile, :candidate_gems, :only_explicit
|
36
37
|
|
37
38
|
def find_updatable_gems
|
38
39
|
return {} if candidate_gems && candidate_gems.empty?
|
39
40
|
|
40
|
-
build_outdated_gems(BundlerCommands.read_updated_lockfile(*Array(candidate_gems)))
|
41
|
+
updatable = build_outdated_gems(BundlerCommands.read_updated_lockfile(*Array(candidate_gems)))
|
42
|
+
updatable = updatable.slice(*gemfile.gem_names) if only_explicit
|
43
|
+
updatable
|
41
44
|
end
|
42
45
|
|
43
46
|
def build_outdated_gems(lockfile_contents)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundle_update_interactive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brictson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|