core_docs 0.9.7 → 0.9.8
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/core_docs/version.rb +1 -1
- data/lib/core_docs.rb +37 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1d256412ec2ae1bb4f0fa75db0d902b7c3675038c4b9d318b755ffeeec10be14
|
|
4
|
+
data.tar.gz: 76ed5ff14014667eaac39be5a20131598664ca1b11289e1ca7434101a4d8979d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 70bf64441082c3ab971ecd464e530e13a0fe73852e4583571abcf0ca97fc7d6c5860c6c9e38d0cd8ea06dca32db9c60b224ab8f127b7e6f5526b9ae99a73ec6e
|
|
7
|
+
data.tar.gz: a11757d23d165b51225cf56f5fb4ed67a8f949a77895b0e4710a59e2350b808eec0d117c03a4056175d2d6fc67264251f6ec8af227003ec048700bf187a5dca0
|
data/CHANGELOG.md
CHANGED
data/lib/core_docs/version.rb
CHANGED
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
|
|
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(
|
|
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.
|
|
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:
|
|
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.
|
|
154
|
+
rubygems_version: 3.3.3
|
|
155
155
|
signing_key:
|
|
156
156
|
specification_version: 4
|
|
157
157
|
summary: Provides YARD and extended documentation support
|