bundleup 0.8.1 → 1.3.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: f92eb8b3e1592cc12b66b35c6237df1156b17b104c75d1e6e4205a20dc27b4e5
4
- data.tar.gz: 953fb0e430376675aa7264f003170d58c01a2f9e23a3619c3c997404c9e0c59a
3
+ metadata.gz: db5d58970165c2381d963205eae11b610d57f35e9654bee2edff54f2d1ff861f
4
+ data.tar.gz: 508d1cba2d3ab7c2167b60ec38fd1bf49e0252f614e07fe7cce3ed36de3dc32e
5
5
  SHA512:
6
- metadata.gz: 9cc74eb46c9e9f480625a37c36978e56c0c7e6ff54038380a14099f62b6e53060821a91fa0feef552195b52b70d370e3b752bc98aae3bc6e41db85bbae9c8fe3
7
- data.tar.gz: a6c2221b6a5cb55551aaa97d0e893005211eeb2b993dd9dc1f41988a4a17d9801a53ac8f7567c9d9f8ac7ab1553c5b8cba256519ef42637e06a83ecff9d3a858
6
+ metadata.gz: c8133402453232bfd33b17a9c3c5f903874f92f190063bc84e7f29723514ab5333d791d0ac2e6eb4c8deb75a5d5f734a20cb47d63101a79ff879b8e566c63952
7
+ data.tar.gz: c508a0e3360b51d537c948e1cd95790fd69ad01d43d86a97976729fea4737a84aa25fedd69513f379c26ba82c0abcea3f71bc3f25ad1e802845b24c81f3deb9e
@@ -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 check` (and `bundle install` if any gems are missing in your local environment), `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
@@ -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"
@@ -2,27 +2,48 @@ require "open3"
2
2
 
3
3
  module Bundleup
4
4
  class BundleCommands
5
+ class Result
6
+ attr_reader :output
7
+
8
+ def initialize(output, success)
9
+ @output = output
10
+ @success = success
11
+ end
12
+
13
+ def success?
14
+ @success
15
+ end
16
+ end
17
+
5
18
  include Console
6
19
 
20
+ def check
21
+ run(%w[bundle check], fail_silently: true).success?
22
+ end
23
+
24
+ def install
25
+ run(%w[bundle install]).output
26
+ end
27
+
7
28
  def outdated
8
- run(%w[bundle outdated], true)
29
+ run(%w[bundle outdated], fail_silently: true).output
9
30
  end
10
31
 
11
- def show
12
- run(%w[bundle show])
32
+ def list
33
+ run(%w[bundle list]).output
13
34
  end
14
35
 
15
36
  def update(args=[])
16
- run(%w[bundle update] + args)
37
+ run(%w[bundle update] + args).output
17
38
  end
18
39
 
19
40
  private
20
41
 
21
- def run(cmd, fail_silently=false)
42
+ def run(cmd, fail_silently: false)
22
43
  cmd_line = cmd.join(" ")
23
44
  progress("Running `#{cmd_line}`") do
24
45
  out, err, status = Open3.capture3(*cmd)
25
- next(out) if status.success? || fail_silently
46
+ next(Result.new(out, status.success?)) if status.success? || fail_silently
26
47
 
27
48
  raise ["Failed to execute: #{cmd_line}", out, err].compact.join("\n")
28
49
  end
@@ -78,6 +78,7 @@ module Bundleup
78
78
  # After each wait, `yield` is called to allow a block to execute.
79
79
  def observing_thread(callable, initial_wait, periodic_wait)
80
80
  thread = Thread.new(&callable)
81
+ thread.report_on_exception = false
81
82
  wait_for_exit(thread, initial_wait)
82
83
  loop do
83
84
  break if wait_for_exit(thread, periodic_wait)
@@ -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
@@ -29,6 +29,7 @@ module Bundleup
29
29
  attr_reader :update_args, :commands, :original_lockfile_contents
30
30
 
31
31
  def run
32
+ commands.check || commands.install
32
33
  find_versions(:old)
33
34
  commands.update(update_args)
34
35
  find_versions(:new)
@@ -40,15 +41,14 @@ module Bundleup
40
41
  end
41
42
 
42
43
  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
44
+ OutdatedParser.parse(commands.outdated).each do |gem|
45
+ gem_status(gem[:name]).newest_version = gem[:newest]
46
+ gem_status(gem[:name]).pin = gem[:pin]
47
47
  end
48
48
  end
49
49
 
50
50
  def find_versions(type)
51
- commands.show.scan(/\* (\S+) \((\S+)(?: (\S+))?\)/) do |name, ver, sha|
51
+ commands.list.scan(/\* (\S+) \((\S+)(?: (\S+))?\)/) do |name, ver, sha|
52
52
  gem_status(name).public_send("#{type}_version=", sha || ver)
53
53
  end
54
54
  end
@@ -1,3 +1,3 @@
1
1
  module Bundleup
2
- VERSION = "0.8.1".freeze
2
+ VERSION = "1.3.0".freeze
3
3
  end
metadata CHANGED
@@ -1,114 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundleup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 1.3.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-07-02 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '2.0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '2.0'
27
- - !ruby/object:Gem::Dependency
28
- name: coveralls
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: 0.8.19
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: 0.8.19
41
- - !ruby/object:Gem::Dependency
42
- name: minitest
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '5.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '5.0'
55
- - !ruby/object:Gem::Dependency
56
- name: minitest-reporters
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.1'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '1.1'
69
- - !ruby/object:Gem::Dependency
70
- name: rake
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '12.0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '12.0'
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - '='
88
- - !ruby/object:Gem::Version
89
- version: 0.72.0
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '='
95
- - !ruby/object:Gem::Version
96
- version: 0.72.0
97
- - !ruby/object:Gem::Dependency
98
- name: rubocop-performance
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - '='
102
- - !ruby/object:Gem::Version
103
- version: 1.4.0
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - '='
109
- - !ruby/object:Gem::Version
110
- version: 1.4.0
111
- description:
11
+ date: 2020-08-08 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Use `bundleup` whenever you want to update the locked Gemfile dependencies
14
+ of a Ruby project. It shows exactly what gems will be updated with color output
15
+ that calls attention to significant semver changes. Bundleup will also let you know
16
+ when a version "pin" in your Gemfile is preventing an update. Bundleup is a standalone
17
+ tool that leverages standard Bundler output and does not patch code or use Bundler
18
+ internals.
112
19
  email:
113
20
  - bundleup@mattbrictson.com
114
21
  executables:
@@ -116,21 +23,8 @@ executables:
116
23
  extensions: []
117
24
  extra_rdoc_files: []
118
25
  files:
119
- - ".github/main.workflow"
120
- - ".github/release-drafter.yml"
121
- - ".gitignore"
122
- - ".rubocop.yml"
123
- - ".travis.yml"
124
- - CHANGELOG.md
125
- - CODE_OF_CONDUCT.md
126
- - CONTRIBUTING.md
127
- - Gemfile
128
26
  - LICENSE.txt
129
27
  - README.md
130
- - Rakefile
131
- - bin/console
132
- - bin/setup
133
- - bundleup.gemspec
134
28
  - exe/bundleup
135
29
  - lib/bundleup.rb
136
30
  - lib/bundleup/bundle_commands.rb
@@ -138,14 +32,18 @@ files:
138
32
  - lib/bundleup/console.rb
139
33
  - lib/bundleup/gem_status.rb
140
34
  - lib/bundleup/gemfile.rb
35
+ - lib/bundleup/outdated_parser.rb
141
36
  - lib/bundleup/upgrade.rb
142
37
  - lib/bundleup/version.rb
143
- - sample.png
144
38
  homepage: https://github.com/mattbrictson/bundleup
145
39
  licenses:
146
40
  - MIT
147
- metadata: {}
148
- post_install_message:
41
+ metadata:
42
+ bug_tracker_uri: https://github.com/mattbrictson/bundleup/issues
43
+ changelog_uri: https://github.com/mattbrictson/bundleup/releases
44
+ source_code_uri: https://github.com/mattbrictson/bundleup
45
+ homepage_uri: https://github.com/mattbrictson/bundleup
46
+ post_install_message:
149
47
  rdoc_options: []
150
48
  require_paths:
151
49
  - lib
@@ -153,15 +51,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
153
51
  requirements:
154
52
  - - ">="
155
53
  - !ruby/object:Gem::Version
156
- version: 2.4.0
54
+ version: 2.5.0
157
55
  required_rubygems_version: !ruby/object:Gem::Requirement
158
56
  requirements:
159
57
  - - ">="
160
58
  - !ruby/object:Gem::Version
161
59
  version: '0'
162
60
  requirements: []
163
- rubygems_version: 3.0.4
164
- signing_key:
61
+ rubygems_version: 3.1.4
62
+ signing_key:
165
63
  specification_version: 4
166
64
  summary: A friendlier command-line interface for Bundler’s `update` and `outdated`
167
65
  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
- }
@@ -1,17 +0,0 @@
1
- name-template: "$NEXT_PATCH_VERSION"
2
- tag-template: "v$NEXT_PATCH_VERSION"
3
- categories:
4
- - title: "⚠️ Breaking Changes"
5
- label: "⚠️ Breaking"
6
- - title: "✨ New Features"
7
- label: "✨ Feature"
8
- - title: "🐛 Bug Fixes"
9
- label: "🐛 Bug Fix"
10
- - title: "📚 Documentation"
11
- label: "📚 Docs"
12
- - title: "🏠 Housekeeping"
13
- label: "🏠 Housekeeping"
14
- change-template: "- $TITLE (#$NUMBER) @$AUTHOR"
15
- no-changes-template: "- No changes"
16
- template: |
17
- $CHANGES
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
@@ -1,47 +0,0 @@
1
- require:
2
- - rubocop-performance
3
-
4
- AllCops:
5
- TargetRubyVersion: 2.4
6
- Exclude:
7
- - "*.gemspec"
8
- - "vendor/**/*"
9
-
10
- Layout/SpaceAroundEqualsInParameterDefault:
11
- EnforcedStyle: no_space
12
-
13
- Metrics/AbcSize:
14
- Exclude:
15
- - "test/**/*"
16
-
17
- Metrics/MethodLength:
18
- Exclude:
19
- - "test/**/*"
20
-
21
- Metrics/ClassLength:
22
- Exclude:
23
- - "test/**/*"
24
-
25
- Naming/MemoizedInstanceVariableName:
26
- Enabled: false
27
-
28
- Style/BarePercentLiterals:
29
- EnforcedStyle: percent_q
30
-
31
- Style/ClassAndModuleChildren:
32
- Enabled: false
33
-
34
- Style/Documentation:
35
- Enabled: false
36
-
37
- Style/DoubleNegation:
38
- Enabled: false
39
-
40
- Style/FrozenStringLiteralComment:
41
- Enabled: false
42
-
43
- Style/HashSyntax:
44
- EnforcedStyle: ruby19
45
-
46
- Style/StringLiterals:
47
- EnforcedStyle: double_quotes
@@ -1,16 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- branches:
6
- only:
7
- - master
8
- rvm:
9
- - 2.4.6
10
- - 2.5.5
11
- - 2.6.3
12
- - ruby-head
13
- before_install:
14
- - gem update --system
15
- - gem install bundler -v 2.0.2 --conservative --no-document
16
- - gem install executable-hooks --conservative --no-document
@@ -1 +0,0 @@
1
- Release notes for this project are kept here: https://github.com/mattbrictson/bundleup/releases
@@ -1,49 +0,0 @@
1
- # Contributor Code of Conduct
2
-
3
- As contributors and maintainers of this project, and in the interest of
4
- fostering an open and welcoming community, we pledge to respect all people who
5
- contribute through reporting issues, posting feature requests, updating
6
- documentation, submitting pull requests or patches, and other activities.
7
-
8
- We are committed to making participation in this project a harassment-free
9
- experience for everyone, regardless of level of experience, gender, gender
10
- identity and expression, sexual orientation, disability, personal appearance,
11
- body size, race, ethnicity, age, religion, or nationality.
12
-
13
- Examples of unacceptable behavior by participants include:
14
-
15
- * The use of sexualized language or imagery
16
- * Personal attacks
17
- * Trolling or insulting/derogatory comments
18
- * Public or private harassment
19
- * Publishing other's private information, such as physical or electronic
20
- addresses, without explicit permission
21
- * Other unethical or unprofessional conduct
22
-
23
- Project maintainers have the right and responsibility to remove, edit, or
24
- reject comments, commits, code, wiki edits, issues, and other contributions
25
- that are not aligned to this Code of Conduct, or to ban temporarily or
26
- permanently any contributor for other behaviors that they deem inappropriate,
27
- threatening, offensive, or harmful.
28
-
29
- By adopting this Code of Conduct, project maintainers commit themselves to
30
- fairly and consistently applying these principles to every aspect of managing
31
- this project. Project maintainers who do not follow or enforce the Code of
32
- Conduct may be permanently removed from the project team.
33
-
34
- This code of conduct applies both within project spaces and in public spaces
35
- when an individual is representing the project or its community.
36
-
37
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
- reported by contacting a project maintainer at matt@mattbrictson.com. All
39
- complaints will be reviewed and investigated and will result in a response that
40
- is deemed necessary and appropriate to the circumstances. Maintainers are
41
- obligated to maintain confidentiality with regard to the reporter of an
42
- incident.
43
-
44
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
- version 1.3.0, available at
46
- [http://contributor-covenant.org/version/1/3/0/][version]
47
-
48
- [homepage]: http://contributor-covenant.org
49
- [version]: http://contributor-covenant.org/version/1/3/0/
@@ -1,29 +0,0 @@
1
- # Contributing to bundleup
2
-
3
- Have a feature idea, bug fix, or refactoring suggestion? Contributions are welcome!
4
-
5
- ## Pull requests
6
-
7
- 1. Check [Issues][] to see if your contribution has already been discussed and/or implemented.
8
- 2. If not, open an issue to discuss your contribution. I won't accept all changes and do not want to waste your time.
9
- 3. Once you have the :thumbsup:, fork the repo, make your changes, and open a PR.
10
- 4. Don't forget to add your contribution and credit yourself in `CHANGELOG.md`!
11
-
12
- ## Coding guidelines
13
-
14
- * This project has a coding style enforced by [RuboCop][]. Use hash rockets and double-quoted strings, and otherwise try to follow the [Ruby style guide][style].
15
- * Writing tests is strongly encouraged! This project uses Minitest.
16
-
17
- ## Getting started
18
-
19
- After checking out the repo, run `bin/setup` to install dependencies.
20
-
21
- bundleup offers the following development and testing commands:
22
-
23
- * `bin/console` loads your working copy of bundleup into an irb session
24
- * `bundle exec bundleup` runs your working copy of the bundleup executable
25
- * `rake` executes all of bundleup's tests and RuboCop checks
26
-
27
- [Issues]: https://github.com/mattbrictson/bundleup/issues
28
- [RuboCop]: https://github.com/bbatsov/rubocop
29
- [style]: https://github.com/bbatsov/ruby-style-guide
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in bundleup.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,105 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
- require "rubocop/rake_task"
4
-
5
- Rake::TestTask.new(:test) do |t|
6
- t.libs << "test"
7
- t.libs << "lib"
8
- t.test_files = FileList["test/**/*_test.rb"]
9
- end
10
-
11
- RuboCop::RakeTask.new
12
-
13
- task default: %i[test rubocop]
14
-
15
- Rake::Task["release"].enhance do
16
- puts "Don't forget to publish the release on GitHub!"
17
- system "open https://github.com/mattbrictson/bundleup/releases"
18
- end
19
-
20
- task bump: %w[bump:bundler bump:ruby bump:year]
21
-
22
- namespace :bump do
23
- task :bundler do
24
- version = Gemfile.bundler_version
25
- replace_in_file ".travis.yml", /bundler -v (\S+)/ => version
26
- end
27
-
28
- task :ruby do
29
- lowest = RubyVersions.lowest_supported
30
- lowest_minor = RubyVersions.lowest_supported_minor
31
-
32
- replace_in_file "bundleup.gemspec", /ruby_version = ">= (.*)"/ => lowest
33
- replace_in_file ".rubocop.yml", /TargetRubyVersion: (.*)/ => lowest_minor
34
-
35
- travis = YAML.safe_load(open(".travis.yml"))
36
- travis["rvm"] = RubyVersions.latest_supported_patches + ["ruby-head"]
37
- IO.write(".travis.yml", YAML.dump(travis))
38
- end
39
-
40
- task :year do
41
- replace_in_file "LICENSE.txt", /\(c\) (\d+)/ => Date.today.year.to_s
42
- end
43
- end
44
-
45
- require "date"
46
- require "open-uri"
47
- require "yaml"
48
-
49
- def replace_in_file(path, replacements)
50
- contents = IO.read(path)
51
- orig_contents = contents.dup
52
- replacements.each do |regexp, text|
53
- contents.gsub!(regexp) do |match|
54
- match[regexp, 1] = text
55
- match
56
- end
57
- end
58
- IO.write(path, contents) if contents != orig_contents
59
- end
60
-
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
- module RubyVersions
76
- class << self
77
- def lowest_supported
78
- "#{lowest_supported_minor}.0"
79
- end
80
-
81
- def lowest_supported_minor
82
- latest_supported_patches.first[/\d+\.\d+/]
83
- end
84
-
85
- def latest
86
- latest_supported_patches.last
87
- end
88
-
89
- def latest_supported_patches
90
- patches = [versions[:stable], versions[:security_maintenance]].flatten
91
- patches.map(&Gem::Version.method(:new)).sort.map(&:to_s)
92
- end
93
-
94
- private
95
-
96
- def versions
97
- @_versions ||= begin
98
- yaml = open(
99
- "https://raw.githubusercontent.com/ruby/www.ruby-lang.org/master/_data/downloads.yml"
100
- )
101
- YAML.safe_load(yaml, symbolize_names: true)
102
- end
103
- end
104
- end
105
- end
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "bundleup"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,31 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "bundleup/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "bundleup"
8
- spec.version = Bundleup::VERSION
9
- spec.authors = ["Matt Brictson"]
10
- spec.email = ["bundleup@mattbrictson.com"]
11
-
12
- spec.summary = "A friendlier command-line interface for Bundler’s "\
13
- "`update` and `outdated` commands."
14
- spec.homepage = "https://github.com/mattbrictson/bundleup"
15
- spec.license = "MIT"
16
-
17
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
- spec.bindir = "exe"
19
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
- spec.require_paths = ["lib"]
21
-
22
- spec.required_ruby_version = ">= 2.4.0"
23
-
24
- spec.add_development_dependency "bundler", "~> 2.0"
25
- spec.add_development_dependency "coveralls", "~> 0.8.19"
26
- spec.add_development_dependency "minitest", "~> 5.0"
27
- spec.add_development_dependency "minitest-reporters", "~> 1.1"
28
- spec.add_development_dependency "rake", "~> 12.0"
29
- spec.add_development_dependency "rubocop", "0.72.0"
30
- spec.add_development_dependency "rubocop-performance", "1.4.0"
31
- end
data/sample.png DELETED
Binary file