bummr 1.0.0 → 1.1.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: a418b56df2ef27d3133a50eb3496fc185e08fd33980891d55f0fa17b4924640e
4
- data.tar.gz: afa326b65168586bb0f9526c8f060d830b55f94ddaa5228c24cbbc0b65d43dc7
3
+ metadata.gz: c6eba01b649b2d2a467eebcc14c7c81040b8c6038c4a0f798fc740688fbb1fb6
4
+ data.tar.gz: 390435ebf0c5efb38bd355748afd84758912c72cc6a43e88f6cf7c0c2befec52
5
5
  SHA512:
6
- metadata.gz: f86b59ec25374e52448f933a6923e582713f05a6f23f050b2af0854d3fab4a8489e04f4feaeb14a94707cc1650e3472f79caf67ba0af6fbb8a0c6694acdedcca
7
- data.tar.gz: 56e01e31f8e7d03a7111f378d4283cf497e90dc4e29c0f0bac8bebf2cb423b5bf27d6e74fa16c804e6f50b3f174d0f0850821b8dd314fcbcea35fe70756a21fe
6
+ metadata.gz: 8315fefc4d58a5bef3ebabe084886c975a967e9bf38d4b9d48105d83ee01ce34065dfed54f725487343b8752128a1c1c2c452c982ff497e1c9befb46c59f64b7
7
+ data.tar.gz: dabf3ccfd52d3e927335fe591188d7512092dca5de2bec188c20b28c77d52a9b709241ac8dd8f2b4e9e5fbb33b82586eea41de311c61f8c3381df3571ab58f42
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bummr (0.6.0)
4
+ bummr (1.1.0)
5
5
  rainbow
6
6
  thor
7
7
 
data/README.md CHANGED
@@ -1,6 +1,5 @@
1
1
  # Bummr
2
2
 
3
- [![CircleCI](https://circleci.com/gh/lpender/bummr.svg?style=shield)](https://circleci.com/gh/lpender/bummr)
4
3
  [![Code Climate](https://codeclimate.com/github/lpender/bummr/badges/gpa.svg)](https://codeclimate.com/github/lpender/bummr)
5
4
  [![Test Coverage](https://api.codeclimate.com/v1/badges/52d6651bf8cd5e729b11/test_coverage)](https://codeclimate.com/github/lpender/bummr/test_coverage)
6
5
 
@@ -14,7 +13,7 @@ build in separate commits, and logs the name and sha of each gem that fails.
14
13
 
15
14
  Bummr assumes you have good test coverage and follow a [pull-request workflow].
16
15
 
17
- By default, bummr will assume your base branch is named `master`. If you would
16
+ By default, bummr will assume your base branch is named `main`. If you would
18
17
  like to designate a different base branch, you can set the `BASE_BRANCH`
19
18
  environment variable: `export BASE_BRANCH='main'`
20
19
 
@@ -50,7 +49,7 @@ on the number of outdated gems you have and the number of tests in your test
50
49
  suite.
51
50
 
52
51
  For the purpose of these instructions, we are assuming that your base branch is
53
- `master`. If you would like to specify a different base branch, see the
52
+ `main`. If you would like to specify a different base branch, see the
54
53
  instructions in the Installation section of this README.
55
54
 
56
55
  - After installing, create a new, clean branch off of your main branch.
@@ -81,7 +80,7 @@ instructions in the Installation section of this README.
81
80
  Update gemname from 0.0.1 to 0.0.2
82
81
  ```
83
82
 
84
- - Runs `git rebase -i master` to allow you the chance to review and make changes.
83
+ - Runs `git rebase -i main` to allow you the chance to review and make changes.
85
84
  - Runs `bummr test`
86
85
 
87
86
  ##### `bummr test`
@@ -91,7 +90,7 @@ Update gemname from 0.0.1 to 0.0.2
91
90
 
92
91
  ##### `bummr bisect`
93
92
 
94
- - `git bisect`s against master.
93
+ - `git bisect`s against main.
95
94
  - Upon finding the bad commit, runs `git bisect reset` and notifies the developer on
96
95
  how best to proceed.
97
96
  - Logs the bad commit in `log/bummr.log`.
@@ -99,7 +98,7 @@ Update gemname from 0.0.1 to 0.0.2
99
98
  ## Notes
100
99
 
101
100
  - Bummr assumes you have good test coverage and follow a [pull-request workflow]
102
- with `master` as your default branch.
101
+ with `main` as your default branch.
103
102
  - Once the build passes, you can push your branch and create a pull-request!
104
103
  - You may wish to `tail -f log/bummr.log` in a separate terminal window so you
105
104
  can see which commits are being removed.
@@ -114,11 +113,13 @@ Set version in `lib/bummr/version.rb`
114
113
 
115
114
  `rake build` to build locally
116
115
 
117
- `gem install --local ~/dev/mine/bummr/pkg/bummr-X.X.X.gem` in the app you
118
- wish to use it with.
116
+ `gem install --local ./pkg/bummr-X.X.X.gem` with the ruby version of the app
117
+ you'd like to use it with.
119
118
 
120
119
  `rake` will run the suite of unit tests.
121
120
 
121
+ `gem push ./pkg/bummr-x.x.x.gem` to publish new versions.
122
+
122
123
  The suite relies on Oliver Peate's [jet
123
124
  black](https://github.com/odlp/jet_black) testing library for command line feature
124
125
  tests.
data/lib/bummr/cli.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  TEST_COMMAND = ENV["BUMMR_TEST"] || "bundle exec rake"
2
- BASE_BRANCH = ENV["BASE_BRANCH"] || "master"
2
+ BASE_BRANCH = ENV["BASE_BRANCH"] || "main"
3
3
  HEADLESS = ENV["BUMMR_HEADLESS"] || false
4
4
 
5
5
  module Bummr
data/lib/bummr/remover.rb CHANGED
@@ -15,7 +15,7 @@ module Bummr
15
15
  "Please do one of the following: \n\n" +
16
16
  " 1. Update your code to work with the latest version of this gem.\n\n" +
17
17
  " 2. Perform the following steps to lock the gem version:\n\n" +
18
- " - `git reset --hard master`\n" +
18
+ " - `git reset --hard main`\n" +
19
19
  " - Lock the version of this Gem in your Gemfile.\n" +
20
20
  " - Commit the changes.\n" +
21
21
  " - Run `bummr update` again.\n\n"
data/lib/bummr/updater.rb CHANGED
@@ -16,15 +16,15 @@ module Bummr
16
16
  end
17
17
 
18
18
  def update_gem(gem, index)
19
- puts "Updating #{gem[:name]}: #{index+1} of #{@outdated_gems.count}"
19
+ puts "Updating #{gem[:name]}: #{index + 1} of #{@outdated_gems.count}"
20
20
  system("bundle update #{gem[:name]}")
21
21
 
22
22
  updated_version = updated_version_for(gem)
23
23
 
24
- if (updated_version)
25
- message = "Update #{gem[:name]} from #{gem[:installed]} to #{updated_version}"
24
+ message = if updated_version
25
+ "Update #{gem[:name]} from #{gem[:installed]} to #{updated_version}"
26
26
  else
27
- message = "Update dependencies for #{gem[:name]}"
27
+ "Update dependencies for #{gem[:name]}"
28
28
  end
29
29
 
30
30
  if gem[:installed] == updated_version
@@ -43,7 +43,8 @@ module Bummr
43
43
  end
44
44
 
45
45
  def updated_version_for(gem)
46
- `bundle list | grep " #{gem[:name]} "`&.split('(')[1].split(')')[0]
46
+ string = `bundle list --paths | grep "#{gem[:name]}"`
47
+ string.match(/#{gem[:name]}-(.*)$/)[1]
47
48
  end
48
49
  end
49
50
  end
data/lib/bummr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bummr
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
data/spec/check_spec.rb CHANGED
@@ -41,7 +41,7 @@ describe Bummr::Check do
41
41
  allow(check)
42
42
  .to receive(:check_base_branch).and_call_original
43
43
  allow(check).to receive(:`).with('git rev-parse --abbrev-ref HEAD')
44
- .and_return "master\n"
44
+ .and_return "main\n"
45
45
 
46
46
  check.check
47
47
 
@@ -108,7 +108,7 @@ describe Bummr::Check do
108
108
  context "check_diff fails" do
109
109
  before do
110
110
  allow(check).to receive(:check_diff).and_call_original
111
- allow(check).to receive(:`).with('git diff master')
111
+ allow(check).to receive(:`).with('git diff main')
112
112
  .and_return "+ file"
113
113
  end
114
114
 
@@ -116,7 +116,7 @@ describe Bummr::Check do
116
116
  check.check(true)
117
117
 
118
118
  expect(check).to have_received(:puts)
119
- .with("Please make sure that `git diff master` returns empty".color(:red))
119
+ .with("Please make sure that `git diff main` returns empty".color(:red))
120
120
  expect(check).to have_received(:yes?)
121
121
  expect(check).to have_received(:exit).with(0)
122
122
  end
@@ -124,8 +124,8 @@ describe Bummr::Updater do
124
124
  describe "#updated_version_for" do
125
125
  it "returns the correct version from bundle list" do
126
126
  allow(updater).to receive(:`).with(
127
- "bundle list | grep \" #{gem[:name]} \""
128
- ).and_return(" * #{gem[:name]} (3.5.2)\n")
127
+ "bundle list --paths | grep \"#{gem[:name]}\""
128
+ ).and_return("asdf/asdf/asdf/#{gem[:name]}-3.5.2")
129
129
 
130
130
  expect(updater.updated_version_for(gem)).to eq "3.5.2"
131
131
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bummr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Pender
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-15 00:00:00.000000000 Z
11
+ date: 2024-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor