gemdiff 4.0.0 → 4.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: e111a272d3cfc29dd3af0ce56ed591987bf3b32e96f0aceb9a4072f093a8f9bb
4
- data.tar.gz: 5bd138ca9d683ef421254383e3aad597e55040504b0f54649e1da78bfcdd91a2
3
+ metadata.gz: 8561d98525b5af6630489157667b734a6246b043f1b61aad0eb5520b59fa2151
4
+ data.tar.gz: d9ba487fb07a322ec4a00cbde23c3b85d9409131b47089008c7e8045f6260f64
5
5
  SHA512:
6
- metadata.gz: 1b3266162b26eaf306985f60270d445d44454b53d4394d49658275cf6f3d1924af8c3b247beb62945faa781f3ef1477bf6de5494b523b3df5bf35a14eb45b7c7
7
- data.tar.gz: 84609af2a57a3d3eef8ad4aaff2fc1af2c234877b4a45e4c2464524eeeb3f5b544dfddebb8a3972479fef50e5e0f852c24125632544277132bb3c9bc1cef222b
6
+ metadata.gz: b864867a77e56dd1a5980bd3e8f915679d92b26ec409a0b49b5b3036ad1f661928a3e3f25a281faae8e97c34e6a395d4a3dfad1b5f768141c31d65882ec84dfb
7
+ data.tar.gz: 5eb7e674d4d49b38e0bbb7f90ae5636ff645bf273daba23e31ec5894e3b33ef6975722bb8ecf59b76f8f9e369952af5a5a98c1482c1629ab01cce33156cd64da
data/README.md CHANGED
@@ -1,7 +1,7 @@
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=main)](https://travis-ci.org/teeparham/gemdiff)
4
+ [![CI](https://github.com/teeparham/gemdiff/actions/workflows/test.yml/badge.svg)](https://github.com/teeparham/gemdiff/actions/workflows/test.yml)
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).
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Gemdiff
4
4
  class BundleInspector
5
+ BUNDLE_OUTDATED_PARSE_REGEX = /\A([^\s]+)\s\(newest\s([^,]+),\sinstalled\s([^,\)]+).*\z/.freeze
6
+
5
7
  def list
6
8
  @list ||=
7
9
  outdated
@@ -21,24 +23,13 @@ module Gemdiff
21
23
  private
22
24
 
23
25
  def bundle_outdated_strict
24
- `bundle outdated --strict`
26
+ `bundle outdated --strict --parseable`
25
27
  end
26
28
 
27
29
  def new_outdated_gem(line)
28
- return unless line.start_with?(" * ")
29
-
30
- # clean & convert new & old output to same format
31
- items = line.delete("*")
32
- .gsub("(newest", "")
33
- .gsub(", installed", " >")
34
- .gsub(/([(),])/, "")
35
- .split
36
-
37
- # ["haml", "4.0.5", ">", "4.0.4"]
38
- # ["a_forked_gem", "0.7.0", "99ddbc9", ">", "0.7.0", "1da2295"]
30
+ return unless match = BUNDLE_OUTDATED_PARSE_REGEX.match(line)
39
31
 
40
- return if items[3] == ">" # skip non-gems for now
41
- OutdatedGem.new(items[0], items[3], items[1])
32
+ OutdatedGem.new(match[1], match[2], match[3])
42
33
  end
43
34
  end
44
35
  end
@@ -89,6 +89,16 @@ module Gemdiff
89
89
  zeus: "burke/zeus",
90
90
  }.freeze
91
91
 
92
+ PERMITTED_GEMSPEC_CLASSES =
93
+ %w[
94
+ Gem::Dependency
95
+ Gem::Requirement
96
+ Gem::Specification
97
+ Gem::Version
98
+ Symbol
99
+ Time
100
+ ].freeze
101
+
92
102
  class << self
93
103
  # Try to get the homepage from the gemspec
94
104
  # If not found, search github
@@ -104,7 +114,11 @@ module Gemdiff
104
114
  end
105
115
  yaml = gemspec(gem_name)
106
116
  return if yaml.to_s.empty?
107
- spec = YAML.load(yaml)
117
+ spec = if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6.0')
118
+ YAML.safe_load(yaml, permitted_classes: PERMITTED_GEMSPEC_CLASSES)
119
+ else
120
+ YAML.load(yaml)
121
+ end
108
122
  return clean_url(spec.homepage) if spec.homepage =~ GITHUB_REPO_REGEX
109
123
  match = spec.description.to_s.match(GITHUB_REPO_REGEX)
110
124
  match && clean_url(match[0])
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gemdiff
4
- VERSION = "4.0.0"
4
+ VERSION = "4.1.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: 4.0.0
4
+ version: 4.1.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: 2021-03-11 00:00:00.000000000 Z
11
+ date: 2022-04-10 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
@@ -133,8 +133,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  requirements: []
136
- rubygems_version: 3.2.13
137
- signing_key:
136
+ rubygems_version: 3.2.4
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