librariesio-url-parser 1.0.3 → 1.0.4

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: 1cbe610f7a8876b48f40ed8cb43058aff5e08abc55691dff82c7e3495dab9d20
4
- data.tar.gz: bad609770a8779f49094c4f1d890051b51d0a85160cc586fa86312b5907cdbb3
3
+ metadata.gz: 26ec3df36120630b6729b1d5a9b7d854acfeadede419ab34e895d0e00619fb7c
4
+ data.tar.gz: 7bf32628de41c3a243b08ee3b8aa8489e5dfbfef5fe673e7f68390a6f942dbd0
5
5
  SHA512:
6
- metadata.gz: 88945a3e0dff0472969fdef9d09d5503420e41a539aeff5c46ce089c907190b8c8b1854af395f90a48ffb7248a63ac6df4ae285024678e1ac70dfb9c68f49474
7
- data.tar.gz: 223accfcf45816de5185f3af8e2026f808810fc0371740a104f6654d5bca73f1fe2ff7ba8f374b6122e0126a86a2aacf1d3218004107c32552cf2c103b5c0885
6
+ metadata.gz: bbe57df347aafc5b82046f13a5e20d7c6deaf66cb67590540d122701d79bd516bb0b015b0b41f72d144e7c963f45e1ef7f67da61328aa819b8712c58d029b9af
7
+ data.tar.gz: c942042bb95db767107b91aa136c61cdd8408c11cfef763038abab07e0bdc515ee032cf8979e27040988aca8ce0b879214fae367511b1cf36a48a0f5e4415071
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- librariesio-url-parser (1.0.3)
4
+ librariesio-url-parser (1.0.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -13,5 +13,5 @@ require_relative "android_googlesource_url_parser"
13
13
  require_relative "sourceforge_url_parser"
14
14
 
15
15
  module LibrariesioURLParser
16
- VERSION = "1.0.3"
16
+ VERSION = "1.0.4"
17
17
  end
data/lib/url_parser.rb CHANGED
@@ -162,13 +162,20 @@ class URLParser
162
162
  url.gsub!(/\s/, '')
163
163
  end
164
164
 
165
+ # This computation is memoized because it is expensive. This prevents use cases which require using
166
+ # .try_all in a tight loop. However, if this class is required directly (without requiring any subparsers),
167
+ # this method will memoize an empty array. It is recommended to simply require librariesio-url-parser.rb directly.
168
+ # This is the default behavior when installing this gem.
165
169
  private_class_method def self.descendants
166
- descendants = []
167
- ObjectSpace.each_object(singleton_class) do |k|
168
- next if k.singleton_class?
169
-
170
- descendants.unshift k unless k == self
171
- end
172
- descendants
170
+ @descendants ||=
171
+ begin
172
+ descendants = []
173
+ ObjectSpace.each_object(singleton_class) do |k|
174
+ next if k.singleton_class?
175
+
176
+ descendants.unshift k unless k == self
177
+ end
178
+ descendants
179
+ end
173
180
  end
174
181
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: librariesio-url-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Pace
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-01 00:00:00.000000000 Z
11
+ date: 2022-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.14.1
69
- description:
69
+ description:
70
70
  email:
71
71
  - matt.pace@tidelift.com
72
72
  executables: []
@@ -98,7 +98,7 @@ licenses:
98
98
  - AGPL-3.0
99
99
  metadata:
100
100
  rubygems_mfa_required: 'true'
101
- post_install_message:
101
+ post_install_message:
102
102
  rdoc_options: []
103
103
  require_paths:
104
104
  - lib
@@ -113,8 +113,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  requirements: []
116
- rubygems_version: 3.0.3
117
- signing_key:
116
+ rubygems_version: 3.0.9
117
+ signing_key:
118
118
  specification_version: 4
119
119
  summary: Parse the URL for various repositories tracked by libraries.io
120
120
  test_files: []