gemdiff 3.1.0 → 4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 816c043aaed3ee188c5cb4637b06ff695b530d8ea8ffa93d804f01e8f4958e90
4
- data.tar.gz: b8916af6f878439433af752c67d985b8e490bc95debaf8ec3572c4d9cd01603d
3
+ metadata.gz: e111a272d3cfc29dd3af0ce56ed591987bf3b32e96f0aceb9a4072f093a8f9bb
4
+ data.tar.gz: 5bd138ca9d683ef421254383e3aad597e55040504b0f54649e1da78bfcdd91a2
5
5
  SHA512:
6
- metadata.gz: 8b74933f842115b3725e477ac697f0b95f932f845742fc489330e6e68591893bff0c0ddb3ec272c932c0262dbb2c7bfbfd093b71a4461c1f1b01f155ffba62d9
7
- data.tar.gz: 2f4954b0a299d1ea135116eadc0cbd30d8272764f1dcf9f7da3bdc190cd4415b2f7f440f80cec5b593ddaa1786f660cb0e0f2967b5ae7bc6bec9cf26e6bf17ad
6
+ metadata.gz: 1b3266162b26eaf306985f60270d445d44454b53d4394d49658275cf6f3d1924af8c3b247beb62945faa781f3ef1477bf6de5494b523b3df5bf35a14eb45b7c7
7
+ data.tar.gz: 84609af2a57a3d3eef8ad4aaff2fc1af2c234877b4a45e4c2464524eeeb3f5b544dfddebb8a3972479fef50e5e0f852c24125632544277132bb3c9bc1cef222b
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # gemdiff
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/gemdiff.svg)](http://rubygems.org/gems/gemdiff)
4
- [![Build Status](https://travis-ci.org/teeparham/gemdiff.svg?branch=master)](https://travis-ci.org/teeparham/gemdiff)
4
+ [![Build Status](https://travis-ci.org/teeparham/gemdiff.svg?branch=main)](https://travis-ci.org/teeparham/gemdiff)
5
5
 
6
6
  `gemdiff` is a command-line tool to find source code for ruby gems.
7
7
  It connects gem version management (rubygems + bundler) with source code (GitHub).
8
8
 
9
- `gemdiff` provides commands to
9
+ `gemdiff` provides commands to
10
10
  * Find GitHub repositories for gems
11
11
  * Open the compare view for two gem versions
12
12
  * Inspect your bundle and list all the available updates
@@ -146,8 +146,8 @@ to run with the `open` command with a URL argument):
146
146
  $ gemdiff open pundit
147
147
  ```
148
148
 
149
- You may also use `.` as a shortcut for the current directory name.
150
- This is helpful if you would like to quickly open the gem you are developing, for example:
149
+ You may also use `.` as a shortcut for the current directory name.
150
+ This is helpful if you would like to quickly open the gem you are developing, for example:
151
151
 
152
152
  ```sh
153
153
  $ pwd
@@ -175,7 +175,7 @@ $ gemdiff compare pundit 1.0.0 0.3.0
175
175
  You can compare a version with a branch name:
176
176
 
177
177
  ```sh
178
- $ gemdiff compare arel 6.0.0 master
178
+ $ gemdiff compare arel 6.0.0 main
179
179
  ```
180
180
 
181
181
  ### `gemdiff releases [gem]`
@@ -186,12 +186,12 @@ Open the repository's release history page:
186
186
  $ gemdiff releases haml
187
187
  ```
188
188
 
189
- ### `gemdiff master [gem]`
189
+ ### `gemdiff main [gem]`
190
190
 
191
- Open the repository's master branch commit history page:
191
+ Open the repository's main branch commit history page:
192
192
 
193
193
  ```sh
194
- $ gemdiff master haml
194
+ $ gemdiff main haml
195
195
  ```
196
196
 
197
197
  ### `gemdiff help`
@@ -220,8 +220,8 @@ pwd
220
220
  /Users/you/ruby/somegem
221
221
  gemdiff find .
222
222
  gemdiff open .
223
- gemdiff master .
224
- gemdiff compare . 1.2.3 master
223
+ gemdiff main .
224
+ gemdiff compare . 1.2.3 main
225
225
  ```
226
226
 
227
227
  ### Authenticated GitHub API requests
@@ -245,11 +245,11 @@ releases, submit an issue to the gem maintainer to tag their releases.
245
245
 
246
246
  3. The versions must be tagged using the standard format of `v1.2.3`. If you find gems that follow
247
247
  a non-standard format (such as `1.2.3`), please open an issue or submit a pull request.
248
- See [`lib/gemdiff/outdated_gem.rb`](https://github.com/teeparham/gemdiff/blob/master/lib/gemdiff/outdated_gem.rb).
248
+ See [`lib/gemdiff/outdated_gem.rb`](https://github.com/teeparham/gemdiff/blob/main/lib/gemdiff/outdated_gem.rb).
249
249
 
250
250
  4. Encourage gem maintainers to enter the GitHub repository URL in the `homepage` field of their gemspec
251
251
  or anywhere in the description. If you find exceptions, open an issue or submit a pull request.
252
- See [`lib/gemdiff/repo_finder.rb`](https://github.com/teeparham/gemdiff/blob/master/lib/gemdiff/repo_finder.rb).
252
+ See [`lib/gemdiff/repo_finder.rb`](https://github.com/teeparham/gemdiff/blob/main/lib/gemdiff/repo_finder.rb).
253
253
 
254
254
  ### More Info
255
255
 
data/bin/gemdiff CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- $LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib"
4
+ $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
5
5
 
6
6
  # Exit cleanly from an early interrupt
7
7
  Signal.trap("INT") { exit 1 }
@@ -32,7 +32,7 @@ module Gemdiff
32
32
  .gsub("(newest", "")
33
33
  .gsub(", installed", " >")
34
34
  .gsub(/([(),])/, "")
35
- .split(" ")
35
+ .split
36
36
 
37
37
  # ["haml", "4.0.5", ">", "4.0.4"]
38
38
  # ["a_forked_gem", "0.7.0", "99ddbc9", ">", "0.7.0", "1da2295"]
data/lib/gemdiff/cli.rb CHANGED
@@ -34,9 +34,9 @@ module Gemdiff
34
34
  find(gem_name).releases
35
35
  end
36
36
 
37
- desc "master <gem>", "Open the github master branch commits page for a gem"
38
- def master(gem_name)
39
- find(gem_name).master
37
+ desc "main <gem>", "Open the github main branch commits page for a gem"
38
+ def main(gem_name)
39
+ find(gem_name).main
40
40
  end
41
41
 
42
42
  desc "compare <gem> [<old> <new>]", <<~DESC
@@ -102,10 +102,11 @@ module Gemdiff
102
102
  return
103
103
  end
104
104
  response = ask("\nCommit? (c to commit, r to reset, else do nothing)")
105
- if response == "c"
105
+ case response
106
+ when "c"
106
107
  gem_updater.commit
107
- puts "\n" + colorize_git_output(gem_updater.show)
108
- elsif response == "r"
108
+ puts "\n#{colorize_git_output(gem_updater.show)}"
109
+ when "r"
109
110
  puts gem_updater.reset
110
111
  end
111
112
  end
@@ -49,7 +49,7 @@ module Gemdiff
49
49
  end
50
50
 
51
51
  def version(changed_line)
52
- changed_line.split("\n").first.split(" ").last.gsub(/[()]/, "")
52
+ changed_line.split("\n").first.split.last.gsub(/[()]/, "")
53
53
  end
54
54
 
55
55
  # example returns:
@@ -68,7 +68,7 @@ module Gemdiff
68
68
  end
69
69
 
70
70
  def commits_url
71
- clean_url "#{repo}/commits/master"
71
+ clean_url "#{repo}/commits/main"
72
72
  end
73
73
 
74
74
  def compare_message
@@ -79,7 +79,7 @@ module Gemdiff
79
79
  clean_url "#{repo}/compare/#{compare_part}"
80
80
  end
81
81
 
82
- def master
82
+ def main
83
83
  open_url(commits_url) if repo?
84
84
  end
85
85
 
@@ -137,7 +137,7 @@ module Gemdiff
137
137
  # swap versions if needed
138
138
  def old_new(v_old, v_new)
139
139
  return [v_old, v_new] unless v_old && v_new
140
- if v_old == "master" || (Gem::Version.new(v_old) > Gem::Version.new(v_new))
140
+ if v_old == "main" || (Gem::Version.new(v_old) > Gem::Version.new(v_new))
141
141
  [v_new, v_old]
142
142
  else
143
143
  [v_old, v_new]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gemdiff
4
- VERSION = "3.1.0"
4
+ VERSION = "4.0.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemdiff
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tee Parham
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-18 00:00:00.000000000 Z
11
+ date: 2021-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: launchy
@@ -118,7 +118,7 @@ homepage: https://github.com/teeparham/gemdiff
118
118
  licenses:
119
119
  - MIT
120
120
  metadata: {}
121
- post_install_message:
121
+ post_install_message:
122
122
  rdoc_options: []
123
123
  require_paths:
124
124
  - lib
@@ -126,15 +126,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - ">="
128
128
  - !ruby/object:Gem::Version
129
- version: 2.4.0
129
+ version: 2.5.0
130
130
  required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  requirements:
132
132
  - - ">="
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  requirements: []
136
- rubygems_version: 3.1.3
137
- signing_key:
136
+ rubygems_version: 3.2.13
137
+ signing_key:
138
138
  specification_version: 4
139
139
  summary: Find source repositories for ruby gems. Open, compare, and update outdated
140
140
  gem versions