bundleup 0.9.0 → 2.0.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 +5 -5
- data/exe/bundleup +7 -1
- data/lib/bundleup.rb +19 -5
- data/lib/bundleup/backup.rb +26 -0
- data/lib/bundleup/cli.rb +96 -62
- data/lib/bundleup/colors.rb +56 -0
- data/lib/bundleup/commands.rb +40 -0
- data/lib/bundleup/gemfile.rb +9 -2
- data/lib/bundleup/logger.rb +64 -0
- data/lib/bundleup/pin_report.rb +37 -0
- data/lib/bundleup/report.rb +34 -0
- data/lib/bundleup/shell.rb +35 -0
- data/lib/bundleup/update_report.rb +63 -0
- data/lib/bundleup/version.rb +1 -1
- metadata +27 -112
- data/.github/release-drafter.yml +0 -17
- data/.github/workflows/push.yml +0 -12
- data/.gitignore +0 -8
- data/.rubocop.yml +0 -47
- data/.travis.yml +0 -16
- data/CHANGELOG.md +0 -1
- data/CODE_OF_CONDUCT.md +0 -49
- data/CONTRIBUTING.md +0 -29
- data/Gemfile +0 -4
- data/Rakefile +0 -93
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/bundleup.gemspec +0 -30
- data/lib/bundleup/bundle_commands.rb +0 -31
- data/lib/bundleup/console.rb +0 -99
- data/lib/bundleup/gem_status.rb +0 -59
- data/lib/bundleup/upgrade.rb +0 -60
- data/sample.png +0 -0
data/lib/bundleup/upgrade.rb
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
module Bundleup
|
2
|
-
class Upgrade
|
3
|
-
def initialize(update_args=[], commands=BundleCommands.new)
|
4
|
-
@update_args = update_args
|
5
|
-
@commands = commands
|
6
|
-
@gem_statuses = {}
|
7
|
-
@original_lockfile_contents = IO.read(lockfile)
|
8
|
-
run
|
9
|
-
end
|
10
|
-
|
11
|
-
def upgrades
|
12
|
-
@gem_statuses.values.select(&:upgraded?).sort_by(&:name)
|
13
|
-
end
|
14
|
-
|
15
|
-
def pins
|
16
|
-
@gem_statuses.values.select(&:pinned?).sort_by(&:name)
|
17
|
-
end
|
18
|
-
|
19
|
-
def lockfile_changed?
|
20
|
-
IO.read(lockfile) != original_lockfile_contents
|
21
|
-
end
|
22
|
-
|
23
|
-
def undo
|
24
|
-
IO.write(lockfile, original_lockfile_contents)
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
attr_reader :update_args, :commands, :original_lockfile_contents
|
30
|
-
|
31
|
-
def run
|
32
|
-
find_versions(:old)
|
33
|
-
commands.update(update_args)
|
34
|
-
find_versions(:new)
|
35
|
-
find_pinned_versions
|
36
|
-
end
|
37
|
-
|
38
|
-
def lockfile
|
39
|
-
"Gemfile.lock"
|
40
|
-
end
|
41
|
-
|
42
|
-
def find_pinned_versions
|
43
|
-
expr = /\* (\S+) \(newest (\S+),.* requested (.*)\)/
|
44
|
-
commands.outdated.scan(expr) do |name, newest, pin|
|
45
|
-
gem_status(name).newest_version = newest
|
46
|
-
gem_status(name).pin = pin
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def find_versions(type)
|
51
|
-
commands.list.scan(/\* (\S+) \((\S+)(?: (\S+))?\)/) do |name, ver, sha|
|
52
|
-
gem_status(name).public_send("#{type}_version=", sha || ver)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def gem_status(name)
|
57
|
-
@gem_statuses[name] ||= GemStatus.new(name)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
data/sample.png
DELETED
Binary file
|