core_docs 0.9.7 → 0.9.8

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: 2d98c78d9139bc6b8f25828959e92e6a5614cb201b5fb90dcc61abdfa37d1325
4
- data.tar.gz: 0513f7b6c38a1be3f416c14281b83d5c3a253a219a37f50b84edf4b0c699c5ac
3
+ metadata.gz: 1d256412ec2ae1bb4f0fa75db0d902b7c3675038c4b9d318b755ffeeec10be14
4
+ data.tar.gz: 76ed5ff14014667eaac39be5a20131598664ca1b11289e1ca7434101a4d8979d
5
5
  SHA512:
6
- metadata.gz: e834ed96831e7b0d87a2edc84105b1517dd6ac5287dd4b9e3a5f28353087db1a7896fb93c61cad053959e25509d04707947dd4097b37ac5dfc7dac6421f44809
7
- data.tar.gz: 6b3933da56f767a0d02c488abbb4e2e52c9189eaeb5bef8219de58b47001e895e170c57e66f0287f450e529a067b1fac873ea86511e5e77c53e88c5d2501ac85
6
+ metadata.gz: 70bf64441082c3ab971ecd464e530e13a0fe73852e4583571abcf0ca97fc7d6c5860c6c9e38d0cd8ea06dca32db9c60b224ab8f127b7e6f5526b9ae99a73ec6e
7
+ data.tar.gz: a11757d23d165b51225cf56f5fb4ed67a8f949a77895b0e4710a59e2350b808eec0d117c03a4056175d2d6fc67264251f6ec8af227003ec048700bf187a5dca0
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Core Docs Changelog
2
2
  ===================
3
3
 
4
+ ### v0.9.8
5
+
6
+ * Import upstream patch (by @kyrylo) to fix support for Ruby >= 2.7
7
+ * Fix loading mechanism regression introduced in v0.9.7
8
+
4
9
  ### v0.9.7
5
10
 
6
11
  * Build 3.1 docs
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CoreDocs
4
- VERSION = "0.9.7"
4
+ VERSION = "0.9.8"
5
5
  end
data/lib/core_docs.rb CHANGED
@@ -14,7 +14,7 @@ module CoreDocs
14
14
  end
15
15
 
16
16
  if RUBY_VERSION =~ /\A(2|3)\.(\d)/
17
- CoreDocs.load_yardoc("#$1.#$2")
17
+ CoreDocs.load_yardoc("#$1#$2")
18
18
  else
19
19
  warn "Cannot load core docs for ruby version #{RUBY_VERSION}"
20
20
  end
@@ -27,6 +27,41 @@ end
27
27
  module CoreDocs
28
28
  module MethodInfo
29
29
 
30
+ # From upstream patch(@kyrylo)
31
+ # https://github.com/pry/pry-doc/commit/f0de941e6f5338e2c933e039f9bdef09408cd1c8
32
+ METHOD_INSPECT_PATTERN =
33
+ # Ruby 2.7 changed how #inspect for methods looks like. It attaches param
34
+ # list and source location now. We use 2 Regexps: one is for 2.7+ and the
35
+ # other one is for older Rubies. This way we can modify both of them
36
+ # without the risk of breaking.
37
+ #
38
+ # See: https://bugs.ruby-lang.org/issues/14145
39
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7.0")
40
+ %r{\A
41
+ \#<
42
+ (?:Unbound)?Method:\s
43
+ (.+) # Method owner such as "BigDecimal"
44
+ ([\#\.].+?) # Method signature such as ".finite?" or "#finite?"
45
+ \(.*\) # Param list
46
+ (?:
47
+ \s/.+\.rb:\d+ # Source location
48
+ )?
49
+ .* # Sometimes there's gibberish like "<main>:0", we ignore that
50
+ >
51
+ \z}x
52
+ else
53
+ %r{\A
54
+ \#<
55
+ (?:Unbound)?Method:\s
56
+ (.+) # Method owner such as "BigDecimal"
57
+ ([\#\.].+?) # Method signature such as ".finite?" or "#finite?"
58
+ (?:
59
+ \(.*\) # Param list
60
+ )?
61
+ >
62
+ \z}x
63
+ end
64
+
30
65
  # Convert a method object into the `Class#method` string notation.
31
66
  # @param [Method, UnboundMethod] meth
32
67
  # @return [String] The method in string receiver notation.
@@ -34,7 +69,7 @@ module CoreDocs
34
69
  # must figure out a better way to distinguish between class methods and
35
70
  # instance methods.
36
71
  def self.receiver_notation_for(meth)
37
- match = meth.inspect.match(/\A#<(?:Unbound)?Method: (.+)([#\.].+)>\z/)
72
+ match = meth.inspect.match(METHOD_INSPECT_PATTERN)
38
73
  owner = meth.owner.to_s.sub(/#<.+?:(.+?)>/, '\1')
39
74
  name = match[2]
40
75
  name.sub!('#', '.') if match[1] =~ /\A#<Class:/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: core_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mair (banisterfiend)
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-12-29 00:00:00.000000000 Z
12
+ date: 2022-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yard
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  requirements: []
154
- rubygems_version: 3.2.22
154
+ rubygems_version: 3.3.3
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: Provides YARD and extended documentation support