bundleup 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/CHANGELOG.md +11 -1
- data/README.md +3 -3
- data/bundleup.gemspec +1 -1
- data/lib/bundleup.rb +1 -1
- data/lib/bundleup/bundle_commands.rb +1 -1
- data/lib/bundleup/cli.rb +18 -8
- data/lib/bundleup/console.rb +2 -2
- data/lib/bundleup/gem_status.rb +4 -6
- data/lib/bundleup/{gemfile.rb → upgrade.rb} +19 -19
- data/lib/bundleup/version.rb +2 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2042941c3836df1dff0b80b1b85122edb2c9dc6f
|
4
|
+
data.tar.gz: 4bed7910cd47f5613cd5feaff7cfe133e949ca9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4edde92228db4dd91b754baa92e9b5719c168fea1536e6922b8c8437c9c75c8090cdecb11afdfda8e06737dffa5f67108a44b814c4e64390508e6d8d45541661
|
7
|
+
data.tar.gz: 21a13add9532fde6fa8c3c00796300fed0074dd1a597ab98a9fe92893eb9ffd107c2c8d304100541f3fcf1d9795e9a69eaa1edc07f8ed239ec83f46119118844
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,15 @@ bundleup is in a pre-1.0 state. This means that its APIs and behavior are subjec
|
|
8
8
|
|
9
9
|
* Your contribution here!
|
10
10
|
|
11
|
+
## [0.4.0][] (2016-02-19)
|
12
|
+
|
13
|
+
* **Change the upgrade process to modify the Gemfile.lock in place, with the
|
14
|
+
option to "undo" (i.e. restore from backup) if the changes are not desired.**
|
15
|
+
This makes bundleup much faster since it doesn't have to run `bundle update`
|
16
|
+
twice.
|
17
|
+
* Fixed a bug where color was mistakenly based on the newest version of a gem,
|
18
|
+
even if a restriction prevented upgrading to that version.
|
19
|
+
|
11
20
|
## [0.3.0][] (2016-01-08)
|
12
21
|
|
13
22
|
* Always show SHA changes in red. If a dependency is tracking a
|
@@ -27,6 +36,7 @@ bundleup is in a pre-1.0 state. This means that its APIs and behavior are subjec
|
|
27
36
|
* Initial release
|
28
37
|
|
29
38
|
[Semver]: http://semver.org
|
30
|
-
[Unreleased]: https://github.com/mattbrictson/bundleup/compare/v0.
|
39
|
+
[Unreleased]: https://github.com/mattbrictson/bundleup/compare/v0.4.0...HEAD
|
40
|
+
[0.4.0]: https://github.com/mattbrictson/bundleup/compare/v0.3.0...v0.4.0
|
31
41
|
[0.3.0]: https://github.com/mattbrictson/bundleup/compare/v0.2.0...v0.3.0
|
32
42
|
[0.2.0]: https://github.com/mattbrictson/bundleup/compare/v0.1.0...v0.2.0
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
You might like bundleup because it:
|
10
10
|
|
11
|
-
* shows you exactly what gems will be updated
|
11
|
+
* shows you exactly what gems will be updated lets you decide whether to proceed
|
12
12
|
* uses color to call your attention to important gem updates (based on [Semver][])
|
13
13
|
* lets you know when a version "pin" in your Gemfile is preventing an update
|
14
14
|
* relies on standard Bundler output and does not patch code or use Bundler internals
|
@@ -39,9 +39,9 @@ That’s it!
|
|
39
39
|
|
40
40
|
bundleup starts by making a backup copy of your Gemfile.lock. Next it runs `bundle show`, then `bundle update` and `bundle show` again to find what gems versions are being used before and after Bundler does its updating magic. (Since gems are actually being installed into your Ruby environment during these steps, the process may take a few moments to complete, especially if gems with native extensions need to be compiled.)
|
41
41
|
|
42
|
-
Finally, bundleup runs `bundle outdated` to see the gems that were *not* updated due to Gemfile restrictions.
|
42
|
+
Finally, bundleup runs `bundle outdated` to see the gems that were *not* updated due to Gemfile restrictions.
|
43
43
|
|
44
|
-
After displaying its findings, bundleup gives you the option of
|
44
|
+
After displaying its findings, bundleup gives you the option of keeping the changes. If you answer "no", bundleup will restore your original Gemfile.lock from its backup, leaving your project untouched.
|
45
45
|
|
46
46
|
|
47
47
|
## Roadmap
|
data/bundleup.gemspec
CHANGED
@@ -25,5 +25,5 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency "minitest", "~> 5.0"
|
26
26
|
spec.add_development_dependency "minitest-reporters"
|
27
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
-
spec.add_development_dependency "rubocop"
|
28
|
+
spec.add_development_dependency "rubocop", ">= 0.37.2"
|
29
29
|
end
|
data/lib/bundleup.rb
CHANGED
@@ -23,7 +23,7 @@ module Bundleup
|
|
23
23
|
out, err, status = Open3.capture3(cmd)
|
24
24
|
next(out) if status.success? || fail_silently
|
25
25
|
|
26
|
-
|
26
|
+
raise ["Failed to execute: #{cmd}", out, err].compact.join("\n")
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
data/lib/bundleup/cli.rb
CHANGED
@@ -4,11 +4,15 @@ module Bundleup
|
|
4
4
|
|
5
5
|
def run
|
6
6
|
puts \
|
7
|
-
"Please wait a moment while I
|
7
|
+
"Please wait a moment while I upgrade your Gemfile.lock..."
|
8
8
|
|
9
|
+
committed = false
|
9
10
|
review_upgrades
|
10
11
|
review_pins
|
11
|
-
|
12
|
+
committed = upgrades.any? && confirm_commit
|
13
|
+
puts "Done!" if committed
|
14
|
+
ensure
|
15
|
+
restore_lockfile unless committed
|
12
16
|
end
|
13
17
|
|
14
18
|
private
|
@@ -28,20 +32,26 @@ module Bundleup
|
|
28
32
|
print_pins_table
|
29
33
|
end
|
30
34
|
|
31
|
-
def
|
32
|
-
|
35
|
+
def confirm_commit
|
36
|
+
confirm("\nDo you want to apply these changes?")
|
33
37
|
end
|
34
38
|
|
35
|
-
def
|
36
|
-
|
39
|
+
def restore_lockfile
|
40
|
+
return unless upgrade.lockfile_changed?
|
41
|
+
upgrade.undo
|
42
|
+
puts "Your original Gemfile.lock has been restored."
|
43
|
+
end
|
44
|
+
|
45
|
+
def upgrade
|
46
|
+
@upgrade ||= Upgrade.new
|
37
47
|
end
|
38
48
|
|
39
49
|
def upgrades
|
40
|
-
|
50
|
+
upgrade.upgrades
|
41
51
|
end
|
42
52
|
|
43
53
|
def pins
|
44
|
-
|
54
|
+
upgrade.pins
|
45
55
|
end
|
46
56
|
|
47
57
|
def print_upgrades_table
|
data/lib/bundleup/console.rb
CHANGED
@@ -4,7 +4,7 @@ module Bundleup
|
|
4
4
|
:red => 31,
|
5
5
|
:green => 32,
|
6
6
|
:yellow => 33,
|
7
|
-
:blue
|
7
|
+
:blue => 34,
|
8
8
|
:gray => 90
|
9
9
|
}.freeze
|
10
10
|
|
@@ -63,7 +63,7 @@ module Bundleup
|
|
63
63
|
private
|
64
64
|
|
65
65
|
def max_length_of_each_column(rows)
|
66
|
-
rows.first.count
|
66
|
+
Array.new(rows.first.count) do |i|
|
67
67
|
rows.map { |values| values[i].to_s.length }.max
|
68
68
|
end
|
69
69
|
end
|
data/lib/bundleup/gem_status.rb
CHANGED
@@ -33,15 +33,13 @@ module Bundleup
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def major_upgrade?
|
36
|
-
|
37
|
-
|
38
|
-
major(new) != major(old_version)
|
36
|
+
return false if new_version.nil? || old_version.nil?
|
37
|
+
major(new_version) != major(old_version)
|
39
38
|
end
|
40
39
|
|
41
40
|
def minor_upgrade?
|
42
|
-
|
43
|
-
|
44
|
-
!major_upgrade? && minor(new) != minor(old_version)
|
41
|
+
return false if new_version.nil? || old_version.nil?
|
42
|
+
!major_upgrade? && minor(new_version) != minor(old_version)
|
45
43
|
end
|
46
44
|
|
47
45
|
private
|
@@ -1,12 +1,10 @@
|
|
1
|
-
require "fileutils"
|
2
|
-
require "tmpdir"
|
3
|
-
|
4
1
|
module Bundleup
|
5
|
-
class
|
2
|
+
class Upgrade
|
6
3
|
def initialize(commands=BundleCommands.new)
|
7
4
|
@commands = commands
|
8
5
|
@gem_statuses = {}
|
9
|
-
|
6
|
+
@original_lockfile_contents = IO.read(lockfile)
|
7
|
+
run
|
10
8
|
end
|
11
9
|
|
12
10
|
def upgrades
|
@@ -17,25 +15,27 @@ module Bundleup
|
|
17
15
|
@gem_statuses.values.select(&:pinned?).sort_by(&:name)
|
18
16
|
end
|
19
17
|
|
18
|
+
def lockfile_changed?
|
19
|
+
IO.read(lockfile) != original_lockfile_contents
|
20
|
+
end
|
21
|
+
|
22
|
+
def undo
|
23
|
+
IO.write(lockfile, original_lockfile_contents)
|
24
|
+
end
|
25
|
+
|
20
26
|
private
|
21
27
|
|
22
|
-
attr_reader :commands
|
28
|
+
attr_reader :commands, :original_lockfile_contents
|
23
29
|
|
24
|
-
def
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
find_pinned_versions
|
30
|
-
end
|
30
|
+
def run
|
31
|
+
find_versions(:old)
|
32
|
+
commands.update
|
33
|
+
find_versions(:new)
|
34
|
+
find_pinned_versions
|
31
35
|
end
|
32
36
|
|
33
|
-
def
|
34
|
-
|
35
|
-
FileUtils.cp("Gemfile.lock", backup)
|
36
|
-
yield
|
37
|
-
ensure
|
38
|
-
FileUtils.mv(backup, "Gemfile.lock")
|
37
|
+
def lockfile
|
38
|
+
"Gemfile.lock"
|
39
39
|
end
|
40
40
|
|
41
41
|
def find_pinned_versions
|
data/lib/bundleup/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundleup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.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: 2016-
|
11
|
+
date: 2016-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 0.37.2
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 0.37.2
|
111
111
|
description:
|
112
112
|
email:
|
113
113
|
- bundleup@mattbrictson.com
|
@@ -135,7 +135,7 @@ files:
|
|
135
135
|
- lib/bundleup/cli.rb
|
136
136
|
- lib/bundleup/console.rb
|
137
137
|
- lib/bundleup/gem_status.rb
|
138
|
-
- lib/bundleup/
|
138
|
+
- lib/bundleup/upgrade.rb
|
139
139
|
- lib/bundleup/version.rb
|
140
140
|
- sample.png
|
141
141
|
homepage: https://github.com/mattbrictson/bundleup
|