bundleup 0.8.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41775d894ceef821d639e5a283e9880a453695e1638ae007b707fb3b9641043f
4
- data.tar.gz: e3f6ea14d551dbc1e561d8573579894fa21579415576ef551bfc08ae95984d9f
3
+ metadata.gz: 34d18c6d9e39ccd56bb47b656745a19d022981a7a8c735a277eb2a782b106df8
4
+ data.tar.gz: 787cba0d2ec134b82de3dbae1819f609ebd55c98bfbdbc9fe58609eb35e861ab
5
5
  SHA512:
6
- metadata.gz: bc8901a74431a2c75ef87b334d9aad4669ee0c62df4a0c41ec24017113f8a942f7ea582b80018100c77ce1301e4f266c283bbda88590ad50f76bf44cd9fb179d
7
- data.tar.gz: 5a09c595275237a78cb914bb7bcde07d4d7ef54340579d1c207bee88a21070b239bdfc39cbba081af946f5491f22634252133064731531b0b6c4076e429bd0a7
6
+ metadata.gz: efcf4a177c7dc9b7e774b6f800f811abf6351d5e884858d9d4d2e626dddb28c2d09164485812032b61a8c15161ff809891b1a918c574ab63c46c57e96fe28108
7
+ data.tar.gz: 2bd482d805cf7f0e0c340d1c5e0c5bf0e12c018e5055533481aa882b792f9fa342ca70fbd57f6b51f13ec21b113bca9f98919b51f8867fb796f91492e35de14c
@@ -0,0 +1,14 @@
1
+ name: Release Drafter
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ update_release_draft:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: release-drafter/release-drafter@v5
13
+ env:
14
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
data/.gitignore CHANGED
@@ -2,7 +2,6 @@
2
2
  /.yardoc
3
3
  /Gemfile.lock
4
4
  /_yardoc/
5
- /coverage/
6
5
  /doc/
7
6
  /pkg/
8
7
  /spec/reports/
@@ -1,8 +1,10 @@
1
1
  require:
2
+ - rubocop-minitest
2
3
  - rubocop-performance
3
4
 
4
5
  AllCops:
5
- TargetRubyVersion: 2.4
6
+ NewCops: enable
7
+ TargetRubyVersion: 2.5
6
8
  Exclude:
7
9
  - "*.gemspec"
8
10
  - "vendor/**/*"
@@ -40,8 +42,5 @@ Style/DoubleNegation:
40
42
  Style/FrozenStringLiteralComment:
41
43
  Enabled: false
42
44
 
43
- Style/HashSyntax:
44
- EnforcedStyle: ruby19
45
-
46
45
  Style/StringLiterals:
47
46
  EnforcedStyle: double_quotes
@@ -1,16 +1,14 @@
1
1
  ---
2
- sudo: false
3
2
  language: ruby
4
3
  cache: bundler
5
4
  branches:
6
5
  only:
7
- - master
6
+ - main
8
7
  rvm:
9
- - 2.4.6
10
- - 2.5.5
11
- - 2.6.3
8
+ - 2.5.8
9
+ - 2.6.6
10
+ - 2.7.1
12
11
  - ruby-head
13
12
  before_install:
14
- - gem update --system
15
- - gem install bundler -v 2.0.2 --conservative --no-document
13
+ - gem install bundler -v 2.1.4 --conservative --no-document
16
14
  - gem install executable-hooks --conservative --no-document
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019 Matt Brictson
3
+ Copyright (c) 2020 Matt Brictson
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,22 +1,25 @@
1
1
  # bundleup
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/bundleup.svg)](http://badge.fury.io/rb/bundleup)
4
- [![Build Status](https://travis-ci.org/mattbrictson/bundleup.svg?branch=master)](https://travis-ci.org/mattbrictson/bundleup)
5
- [![Coverage Status](https://coveralls.io/repos/mattbrictson/bundleup/badge.svg?branch=master&service=github)](https://coveralls.io/github/mattbrictson/bundleup?branch=master)
4
+ [![Build Status](https://travis-ci.org/mattbrictson/bundleup.svg?branch=main)](https://travis-ci.org/mattbrictson/bundleup)
6
5
 
7
6
  **Run `bundleup` on a Ruby project containing a Gemfile to see what gem dependencies need updating.** It is a friendlier command-line interface to [Bundler’s][bundler] `bundle update` and `bundle outdated`.
8
7
 
9
8
  You might like bundleup because it:
10
9
 
11
- * shows you exactly what gems will be updated lets you decide whether to proceed
12
- * uses color to call your attention to important gem updates (based on [Semver][])
13
- * lets you know when a version "pin" in your Gemfile is preventing an update
14
- * relies on standard Bundler output and does not patch code or use Bundler internals
10
+ - shows you exactly what gems will be updated lets you decide whether to proceed
11
+ - uses color to call your attention to important gem updates (based on [Semver][])
12
+ - lets you know when a version "pin" in your Gemfile is preventing an update
13
+ - relies on standard Bundler output and does not patch code or use Bundler internals
15
14
 
16
15
  Here it is in action:
17
16
 
18
- <img src="https://raw.github.com/mattbrictson/bundleup/master/sample.png" width="599" height="553" alt="Sample output">
17
+ <img src="https://raw.github.com/mattbrictson/bundleup/main/sample.png" width="599" height="553" alt="Sample output">
19
18
 
19
+ ## Requirements
20
+
21
+ - Bundler 1.16 or later
22
+ - Ruby 2.5 or later
20
23
 
21
24
  ## Usage
22
25
 
@@ -43,29 +46,26 @@ bundleup --group=development
43
46
 
44
47
  ## How it works
45
48
 
46
- 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.)
49
+ bundleup starts by making a backup copy of your Gemfile.lock. Next it runs `bundle list`, then `bundle update` and `bundle list` 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.)
47
50
 
48
- Finally, bundleup runs `bundle outdated` to see the gems that were *not* updated due to Gemfile restrictions.
51
+ Finally, bundleup runs `bundle outdated` to see the gems that were _not_ updated due to Gemfile restrictions.
49
52
 
50
53
  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.
51
54
 
52
-
53
55
  ## Roadmap
54
56
 
55
57
  bundleup is a very simple script at this point, but it could be more. Some possibilities:
56
58
 
57
- * Automatically commit the Gemfile.lock changes with a nice commit message
58
- * Integrate with bundler-audit to mark upgrades that have important security fixes
59
- * Display relevant CHANGELOG entries for major upgrades
60
- * Non-interactive mode
59
+ - Automatically commit the Gemfile.lock changes with a nice commit message
60
+ - Integrate with bundler-audit to mark upgrades that have important security fixes
61
+ - Display relevant CHANGELOG entries for major upgrades
62
+ - Non-interactive mode
61
63
 
62
64
  If you have other ideas, open an issue on GitHub!
63
65
 
64
-
65
66
  ## Contributing
66
67
 
67
68
  Code contributions are also welcome! Read [CONTRIBUTING.md](CONTRIBUTING.md) to get started.
68
69
 
69
-
70
70
  [bundler]: http://bundler.io
71
- [Semver]: http://semver.org
71
+ [semver]: http://semver.org
data/Rakefile CHANGED
@@ -21,8 +21,9 @@ task bump: %w[bump:bundler bump:ruby bump:year]
21
21
 
22
22
  namespace :bump do
23
23
  task :bundler do
24
- version = Gemfile.bundler_version
24
+ version = Gem.latest_version_for("bundler").to_s
25
25
  replace_in_file ".travis.yml", /bundler -v (\S+)/ => version
26
+ replace_in_file "Gemfile.lock", /^BUNDLED WITH\n\s+([\d.]+)$/ => version
26
27
  end
27
28
 
28
29
  task :ruby do
@@ -31,6 +32,7 @@ namespace :bump do
31
32
 
32
33
  replace_in_file "bundleup.gemspec", /ruby_version = ">= (.*)"/ => lowest
33
34
  replace_in_file ".rubocop.yml", /TargetRubyVersion: (.*)/ => lowest_minor
35
+ replace_in_file "README.md", /Ruby (\d+\.\d+)/ => lowest_minor
34
36
 
35
37
  travis = YAML.safe_load(open(".travis.yml"))
36
38
  travis["rvm"] = RubyVersions.latest_supported_patches + ["ruby-head"]
@@ -58,20 +60,6 @@ def replace_in_file(path, replacements)
58
60
  IO.write(path, contents) if contents != orig_contents
59
61
  end
60
62
 
61
- module Gemfile
62
- class << self
63
- def bundler_version
64
- lock_file[/BUNDLED WITH\n (\S+)$/, 1]
65
- end
66
-
67
- private
68
-
69
- def lock_file
70
- @_lock_file ||= IO.read("Gemfile.lock")
71
- end
72
- end
73
- end
74
-
75
63
  module RubyVersions
76
64
  class << self
77
65
  def lowest_supported
@@ -95,7 +83,7 @@ module RubyVersions
95
83
 
96
84
  def versions
97
85
  @_versions ||= begin
98
- yaml = open(
86
+ yaml = URI.open(
99
87
  "https://raw.githubusercontent.com/ruby/www.ruby-lang.org/master/_data/downloads.yml"
100
88
  )
101
89
  YAML.safe_load(yaml, symbolize_names: true)
@@ -11,6 +11,15 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = "A friendlier command-line interface for Bundler’s "\
13
13
  "`update` and `outdated` commands."
14
+ spec.description = "Use `bundleup` whenever you want to update the "\
15
+ "locked Gemfile dependencies of a Ruby project. It "\
16
+ "shows exactly what gems will be updated with color "\
17
+ "output that calls attention to significant semver "\
18
+ "changes. Bundleup will also let you know when a "\
19
+ 'version "pin" in your Gemfile is preventing an '\
20
+ "update. Bundleup is a standalone tool that leverages "\
21
+ "standard Bundler output and does not patch code or "\
22
+ "use Bundler internals."
14
23
  spec.homepage = "https://github.com/mattbrictson/bundleup"
15
24
  spec.license = "MIT"
16
25
 
@@ -19,13 +28,13 @@ Gem::Specification.new do |spec|
19
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
29
  spec.require_paths = ["lib"]
21
30
 
22
- spec.required_ruby_version = ">= 2.4.0"
31
+ spec.required_ruby_version = ">= 2.5.0"
23
32
 
24
33
  spec.add_development_dependency "bundler", "~> 2.0"
25
- spec.add_development_dependency "coveralls", "~> 0.8.19"
26
34
  spec.add_development_dependency "minitest", "~> 5.0"
27
35
  spec.add_development_dependency "minitest-reporters", "~> 1.1"
28
- spec.add_development_dependency "rake", "~> 12.0"
29
- spec.add_development_dependency "rubocop", "0.71.0"
30
- spec.add_development_dependency "rubocop-performance", "1.4.0"
36
+ spec.add_development_dependency "rake", "~> 13.0"
37
+ spec.add_development_dependency "rubocop", "0.86.0"
38
+ spec.add_development_dependency "rubocop-minitest", "0.9.0"
39
+ spec.add_development_dependency "rubocop-performance", "1.6.1"
31
40
  end
@@ -3,5 +3,6 @@ require "bundleup/console"
3
3
  require "bundleup/bundle_commands"
4
4
  require "bundleup/gem_status"
5
5
  require "bundleup/gemfile"
6
+ require "bundleup/outdated_parser"
6
7
  require "bundleup/upgrade"
7
8
  require "bundleup/cli"
@@ -8,8 +8,8 @@ module Bundleup
8
8
  run(%w[bundle outdated], true)
9
9
  end
10
10
 
11
- def show
12
- run(%w[bundle show])
11
+ def list
12
+ run(%w[bundle list])
13
13
  end
14
14
 
15
15
  def update(args=[])
@@ -0,0 +1,17 @@
1
+ module Bundleup
2
+ module OutdatedParser
3
+ def self.parse(output)
4
+ expr = if output.match?(/^Gem\s+Current\s+Latest/)
5
+ # Bundler >= 2.2 format
6
+ /^(\S+)\s\s+\S+\s\s+(\d\S+)\s\s+(\S.*?)(?:$|\s\s)/
7
+ else
8
+ # Bundler < 2.2
9
+ /\* (\S+) \(newest (\S+),.* requested (.*)\)/
10
+ end
11
+
12
+ output.scan(expr).map do |name, newest, pin|
13
+ { name: name, newest: newest, pin: pin }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -40,15 +40,14 @@ module Bundleup
40
40
  end
41
41
 
42
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
43
+ OutdatedParser.parse(commands.outdated).each do |gem|
44
+ gem_status(gem[:name]).newest_version = gem[:newest]
45
+ gem_status(gem[:name]).pin = gem[:pin]
47
46
  end
48
47
  end
49
48
 
50
49
  def find_versions(type)
51
- commands.show.scan(/\* (\S+) \((\S+)(?: (\S+))?\)/) do |name, ver, sha|
50
+ commands.list.scan(/\* (\S+) \((\S+)(?: (\S+))?\)/) do |name, ver, sha|
52
51
  gem_status(name).public_send("#{type}_version=", sha || ver)
53
52
  end
54
53
  end
@@ -1,3 +1,3 @@
1
1
  module Bundleup
2
- VERSION = "0.8.0".freeze
2
+ VERSION = "1.2.0".freeze
3
3
  end
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.8.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brictson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-23 00:00:00.000000000 Z
11
+ date: 2020-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -25,90 +25,95 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: coveralls
28
+ name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.8.19
33
+ version: '5.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.8.19
40
+ version: '5.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: minitest
42
+ name: minitest-reporters
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.0'
47
+ version: '1.1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '5.0'
54
+ version: '1.1'
55
55
  - !ruby/object:Gem::Dependency
56
- name: minitest-reporters
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.1'
61
+ version: '13.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.1'
68
+ version: '13.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: rubocop
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: '12.0'
75
+ version: 0.86.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: '12.0'
82
+ version: 0.86.0
83
83
  - !ruby/object:Gem::Dependency
84
- name: rubocop
84
+ name: rubocop-minitest
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 0.71.0
89
+ version: 0.9.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 0.71.0
96
+ version: 0.9.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop-performance
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 1.4.0
103
+ version: 1.6.1
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: 1.4.0
111
- description:
110
+ version: 1.6.1
111
+ description: Use `bundleup` whenever you want to update the locked Gemfile dependencies
112
+ of a Ruby project. It shows exactly what gems will be updated with color output
113
+ that calls attention to significant semver changes. Bundleup will also let you know
114
+ when a version "pin" in your Gemfile is preventing an update. Bundleup is a standalone
115
+ tool that leverages standard Bundler output and does not patch code or use Bundler
116
+ internals.
112
117
  email:
113
118
  - bundleup@mattbrictson.com
114
119
  executables:
@@ -116,8 +121,8 @@ executables:
116
121
  extensions: []
117
122
  extra_rdoc_files: []
118
123
  files:
119
- - ".github/main.workflow"
120
124
  - ".github/release-drafter.yml"
125
+ - ".github/workflows/push.yml"
121
126
  - ".gitignore"
122
127
  - ".rubocop.yml"
123
128
  - ".travis.yml"
@@ -138,6 +143,7 @@ files:
138
143
  - lib/bundleup/console.rb
139
144
  - lib/bundleup/gem_status.rb
140
145
  - lib/bundleup/gemfile.rb
146
+ - lib/bundleup/outdated_parser.rb
141
147
  - lib/bundleup/upgrade.rb
142
148
  - lib/bundleup/version.rb
143
149
  - sample.png
@@ -145,7 +151,7 @@ homepage: https://github.com/mattbrictson/bundleup
145
151
  licenses:
146
152
  - MIT
147
153
  metadata: {}
148
- post_install_message:
154
+ post_install_message:
149
155
  rdoc_options: []
150
156
  require_paths:
151
157
  - lib
@@ -153,15 +159,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
153
159
  requirements:
154
160
  - - ">="
155
161
  - !ruby/object:Gem::Version
156
- version: 2.4.0
162
+ version: 2.5.0
157
163
  required_rubygems_version: !ruby/object:Gem::Requirement
158
164
  requirements:
159
165
  - - ">="
160
166
  - !ruby/object:Gem::Version
161
167
  version: '0'
162
168
  requirements: []
163
- rubygems_version: 3.0.4
164
- signing_key:
169
+ rubygems_version: 3.1.4
170
+ signing_key:
165
171
  specification_version: 4
166
172
  summary: A friendlier command-line interface for Bundler’s `update` and `outdated`
167
173
  commands.
@@ -1,9 +0,0 @@
1
- workflow "Push" {
2
- on = "push"
3
- resolves = ["Draft Release"]
4
- }
5
-
6
- action "Draft Release" {
7
- uses = "toolmantim/release-drafter@v5.1.1"
8
- secrets = ["GITHUB_TOKEN"]
9
- }