bundleup 1.2.0 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -1,14 +0,0 @@
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 DELETED
@@ -1,8 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
data/.rubocop.yml DELETED
@@ -1,46 +0,0 @@
1
- require:
2
- - rubocop-minitest
3
- - rubocop-performance
4
-
5
- AllCops:
6
- NewCops: enable
7
- TargetRubyVersion: 2.5
8
- Exclude:
9
- - "*.gemspec"
10
- - "vendor/**/*"
11
-
12
- Layout/SpaceAroundEqualsInParameterDefault:
13
- EnforcedStyle: no_space
14
-
15
- Metrics/AbcSize:
16
- Exclude:
17
- - "test/**/*"
18
-
19
- Metrics/MethodLength:
20
- Exclude:
21
- - "test/**/*"
22
-
23
- Metrics/ClassLength:
24
- Exclude:
25
- - "test/**/*"
26
-
27
- Naming/MemoizedInstanceVariableName:
28
- Enabled: false
29
-
30
- Style/BarePercentLiterals:
31
- EnforcedStyle: percent_q
32
-
33
- Style/ClassAndModuleChildren:
34
- Enabled: false
35
-
36
- Style/Documentation:
37
- Enabled: false
38
-
39
- Style/DoubleNegation:
40
- Enabled: false
41
-
42
- Style/FrozenStringLiteralComment:
43
- Enabled: false
44
-
45
- Style/StringLiterals:
46
- EnforcedStyle: double_quotes
data/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- branches:
5
- only:
6
- - main
7
- rvm:
8
- - 2.5.8
9
- - 2.6.6
10
- - 2.7.1
11
- - ruby-head
12
- before_install:
13
- - gem install bundler -v 2.1.4 --conservative --no-document
14
- - gem install executable-hooks --conservative --no-document
data/CHANGELOG.md DELETED
@@ -1 +0,0 @@
1
- Release notes for this project are kept here: https://github.com/mattbrictson/bundleup/releases
data/CODE_OF_CONDUCT.md DELETED
@@ -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/
data/CONTRIBUTING.md DELETED
@@ -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,93 +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 = Gem.latest_version_for("bundler").to_s
25
- replace_in_file ".travis.yml", /bundler -v (\S+)/ => version
26
- replace_in_file "Gemfile.lock", /^BUNDLED WITH\n\s+([\d.]+)$/ => version
27
- end
28
-
29
- task :ruby do
30
- lowest = RubyVersions.lowest_supported
31
- lowest_minor = RubyVersions.lowest_supported_minor
32
-
33
- replace_in_file "bundleup.gemspec", /ruby_version = ">= (.*)"/ => lowest
34
- replace_in_file ".rubocop.yml", /TargetRubyVersion: (.*)/ => lowest_minor
35
- replace_in_file "README.md", /Ruby (\d+\.\d+)/ => lowest_minor
36
-
37
- travis = YAML.safe_load(open(".travis.yml"))
38
- travis["rvm"] = RubyVersions.latest_supported_patches + ["ruby-head"]
39
- IO.write(".travis.yml", YAML.dump(travis))
40
- end
41
-
42
- task :year do
43
- replace_in_file "LICENSE.txt", /\(c\) (\d+)/ => Date.today.year.to_s
44
- end
45
- end
46
-
47
- require "date"
48
- require "open-uri"
49
- require "yaml"
50
-
51
- def replace_in_file(path, replacements)
52
- contents = IO.read(path)
53
- orig_contents = contents.dup
54
- replacements.each do |regexp, text|
55
- contents.gsub!(regexp) do |match|
56
- match[regexp, 1] = text
57
- match
58
- end
59
- end
60
- IO.write(path, contents) if contents != orig_contents
61
- end
62
-
63
- module RubyVersions
64
- class << self
65
- def lowest_supported
66
- "#{lowest_supported_minor}.0"
67
- end
68
-
69
- def lowest_supported_minor
70
- latest_supported_patches.first[/\d+\.\d+/]
71
- end
72
-
73
- def latest
74
- latest_supported_patches.last
75
- end
76
-
77
- def latest_supported_patches
78
- patches = [versions[:stable], versions[:security_maintenance]].flatten
79
- patches.map(&Gem::Version.method(:new)).sort.map(&:to_s)
80
- end
81
-
82
- private
83
-
84
- def versions
85
- @_versions ||= begin
86
- yaml = URI.open(
87
- "https://raw.githubusercontent.com/ruby/www.ruby-lang.org/master/_data/downloads.yml"
88
- )
89
- YAML.safe_load(yaml, symbolize_names: true)
90
- end
91
- end
92
- end
93
- end
data/bin/console DELETED
@@ -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
data/bundleup.gemspec DELETED
@@ -1,40 +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.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."
23
- spec.homepage = "https://github.com/mattbrictson/bundleup"
24
- spec.license = "MIT"
25
-
26
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
- spec.bindir = "exe"
28
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
- spec.require_paths = ["lib"]
30
-
31
- spec.required_ruby_version = ">= 2.5.0"
32
-
33
- spec.add_development_dependency "bundler", "~> 2.0"
34
- spec.add_development_dependency "minitest", "~> 5.0"
35
- spec.add_development_dependency "minitest-reporters", "~> 1.1"
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"
40
- end
@@ -1,31 +0,0 @@
1
- require "open3"
2
-
3
- module Bundleup
4
- class BundleCommands
5
- include Console
6
-
7
- def outdated
8
- run(%w[bundle outdated], true)
9
- end
10
-
11
- def list
12
- run(%w[bundle list])
13
- end
14
-
15
- def update(args=[])
16
- run(%w[bundle update] + args)
17
- end
18
-
19
- private
20
-
21
- def run(cmd, fail_silently=false)
22
- cmd_line = cmd.join(" ")
23
- progress("Running `#{cmd_line}`") do
24
- out, err, status = Open3.capture3(*cmd)
25
- next(out) if status.success? || fail_silently
26
-
27
- raise ["Failed to execute: #{cmd_line}", out, err].compact.join("\n")
28
- end
29
- end
30
- end
31
- end
@@ -1,99 +0,0 @@
1
- module Bundleup
2
- module Console
3
- ANSI_CODES = {
4
- red: 31,
5
- green: 32,
6
- yellow: 33,
7
- blue: 34,
8
- gray: 90
9
- }.freeze
10
-
11
- def ok(message)
12
- puts color(:green, "✔ #{message}")
13
- end
14
-
15
- def attention(message)
16
- puts color(:yellow, message)
17
- end
18
-
19
- def color(color_name, message)
20
- code = ANSI_CODES[color_name]
21
- return message if code.nil?
22
-
23
- "\e[0;#{code};49m#{message}\e[0m"
24
- end
25
-
26
- def confirm(question)
27
- print question.sub(/\??\z/, " [Yn]? ")
28
- $stdin.gets =~ /^($|y)/i
29
- end
30
-
31
- # Runs a block in the background and displays a spinner until it completes.
32
- def progress(message, &block)
33
- spinner = %w[/ - \\ |].cycle
34
- print "\e[90m#{message}... \e[0m"
35
- result = observing_thread(block, 0.5, 0.1) do
36
- print "\r\e[90m#{message}... #{spinner.next} \e[0m"
37
- end
38
- puts "\r\e[90m#{message}... OK\e[0m"
39
- result
40
- rescue StandardError
41
- puts "\r\e[90m#{message}...\e[0m \e[31mFAILED\e[0m"
42
- raise
43
- end
44
-
45
- # Given a two-dimensional Array of strings representing a table of data,
46
- # translate each row into a single string by joining the values with
47
- # whitespace such that all the columns are nicely aligned.
48
- #
49
- # If a block is given, map the rows through the block first. These two
50
- # usages are equivalent:
51
- #
52
- # tableize(rows.map(&something))
53
- # tableize(rows, &something)
54
- #
55
- # Returns a one-dimensional Array of strings, each representing a formatted
56
- # row of the resulting table.
57
- #
58
- def tableize(rows, &block)
59
- rows = rows.map(&block) if block
60
- widths = max_length_of_each_column(rows)
61
- rows.map do |row|
62
- row.zip(widths).map { |value, width| value.ljust(width) }.join(" ")
63
- end
64
- end
65
-
66
- private
67
-
68
- def max_length_of_each_column(rows)
69
- Array.new(rows.first.count) do |i|
70
- rows.map { |values| values[i].to_s.length }.max
71
- end
72
- end
73
-
74
- # Starts the `callable` in a background thread and waits for it to complete.
75
- # If the callable fails with an exception, it will be raised here. Otherwise
76
- # the main thread is paused for an `initial_wait` time in seconds, and
77
- # subsequently for `periodic_wait` repeatedly until the thread completes.
78
- # After each wait, `yield` is called to allow a block to execute.
79
- def observing_thread(callable, initial_wait, periodic_wait)
80
- thread = Thread.new(&callable)
81
- wait_for_exit(thread, initial_wait)
82
- loop do
83
- break if wait_for_exit(thread, periodic_wait)
84
-
85
- yield
86
- end
87
- thread.value
88
- end
89
-
90
- def wait_for_exit(thread, seconds)
91
- thread.join(seconds)
92
- rescue StandardError
93
- # Sanity check. If we get an exception, the thread should be dead.
94
- raise if thread.alive?
95
-
96
- thread
97
- end
98
- end
99
- end