cinch-rubydoc 0.3.0 → 0.4.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 +4 -4
- data/lib/cinch/rubydoc.rb +21 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 099eb2e4312acffb59ea2dc00c2128f641ad116c
|
4
|
+
data.tar.gz: 783d7e09d3185e3ae303e66f72bef8e8fd3a6a79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c07089ed26c8ce4116f6e19c36f612fb9f21b34a981d5c676f3a911fb855b02d382b82e016dc48549b4ca192363bc07677b8ad1d0d24e3e7079c269403a9ad61
|
7
|
+
data.tar.gz: 94f1adf4fa54b8df7a61de02eac1813cf8b0885ae557ff505d1af70d8eac894e3641cb3918b53fb1f2543634733304c604a320a8c4d682587b69beb9917bd6fe
|
data/lib/cinch/rubydoc.rb
CHANGED
@@ -36,6 +36,10 @@ module Cinch
|
|
36
36
|
private
|
37
37
|
|
38
38
|
def url_for(name)
|
39
|
+
if name.start_with?('YAML')
|
40
|
+
name.sub!(/^YAML/, 'Psych')
|
41
|
+
end
|
42
|
+
|
39
43
|
obj = @store[name]
|
40
44
|
if obj.nil? && name.end_with?('.new')
|
41
45
|
obj = @store[name.sub(/\.new\z/, '#initialize')]
|
@@ -80,7 +84,23 @@ module Cinch
|
|
80
84
|
def path_for(obj)
|
81
85
|
case obj.type
|
82
86
|
when :method
|
83
|
-
scope =
|
87
|
+
scope = \
|
88
|
+
if obj.module_function?
|
89
|
+
if obj.parent.name == :Kernel
|
90
|
+
'instance'
|
91
|
+
else
|
92
|
+
'class'
|
93
|
+
end
|
94
|
+
elsif obj.scope == :instance && obj.visibility == :private
|
95
|
+
obj2 = @store[obj.to_s.sub('#', '.')]
|
96
|
+
if obj2 && obj2.module_function?
|
97
|
+
'class'
|
98
|
+
else
|
99
|
+
obj.scope
|
100
|
+
end
|
101
|
+
else
|
102
|
+
obj.scope
|
103
|
+
end
|
84
104
|
"#{path_for obj.parent}##{CGI.escape obj.name.to_s}-#{scope}_method"
|
85
105
|
when :constant
|
86
106
|
"#{path_for obj.parent}##{obj.name}-constant"
|