rdoc_osx_dictionary 1.1.1 → 1.2.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.
- data/History.txt +13 -0
- data/bin/rdoc_osx_dictionary +1 -0
- data/lib/rdoc_osx_dictionary.rb +26 -10
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
=== 1.2.0 / 2010-02-03
|
2
|
+
|
3
|
+
* 3 minor enhancements:
|
4
|
+
|
5
|
+
* Added -d flag to delete .ri directory to help me debug.
|
6
|
+
* Loudly skip bad files created from rdoc.
|
7
|
+
* Skip _reduce_\d+ methods (generated methods from racc of no value to rdoc).
|
8
|
+
|
9
|
+
* 2 bug fixes:
|
10
|
+
|
11
|
+
* Added extra de-duping on xml creation to fix The Bug I Cannot Repro(tm).
|
12
|
+
* OMG I am an idiot. Generating class id string properly now. :/
|
13
|
+
|
1
14
|
=== 1.1.1 / 2010-02-02
|
2
15
|
|
3
16
|
* 1 minor enhancement:
|
data/bin/rdoc_osx_dictionary
CHANGED
data/lib/rdoc_osx_dictionary.rb
CHANGED
@@ -8,7 +8,7 @@ ENV['LANG'] = ""
|
|
8
8
|
ENV['LC_ALL'] = "C"
|
9
9
|
|
10
10
|
class RDoc::OSXDictionary
|
11
|
-
VERSION = '1.
|
11
|
+
VERSION = '1.2.0'
|
12
12
|
|
13
13
|
exclude = %w[ StringScanner#pre_match
|
14
14
|
StringScanner#post_match
|
@@ -77,7 +77,7 @@ class RDoc::OSXDictionary
|
|
77
77
|
|
78
78
|
result = []
|
79
79
|
|
80
|
-
shortname = "<d:index d:value
|
80
|
+
shortname = "<d:index d:value=#{name.munge.inspect}/>" if name != fullname
|
81
81
|
|
82
82
|
result << <<-"EOD".gsub(/^ /, '')
|
83
83
|
<d:entry id="#{id}" d:title="#{fullname}">
|
@@ -92,10 +92,10 @@ class RDoc::OSXDictionary
|
|
92
92
|
|
93
93
|
ext, ext_type = sources.size == 1 ? ["From", :str] : ["Extensions", :list]
|
94
94
|
|
95
|
-
[["Includes",
|
96
|
-
["Constants",
|
97
|
-
["Class Methods",
|
98
|
-
["Instance Methods", instmeths.join(", ").munge,
|
95
|
+
[["Includes", includes.munge, :str],
|
96
|
+
["Constants", constants.join(", "), :str],
|
97
|
+
["Class Methods", classmeths.join(", ").munge, :str],
|
98
|
+
["Instance Methods", instmeths.join(", ").munge, :str],
|
99
99
|
[ext, sources, ext_type]].each do |n, s, t|
|
100
100
|
next if s.empty?
|
101
101
|
case t
|
@@ -110,8 +110,8 @@ class RDoc::OSXDictionary
|
|
110
110
|
end
|
111
111
|
|
112
112
|
%w(name comment superclass includes constants class_methods
|
113
|
-
instance_methods sources display_name full_name).each do |
|
114
|
-
definition.delete
|
113
|
+
instance_methods sources display_name full_name).each do |key|
|
114
|
+
definition.delete key
|
115
115
|
end
|
116
116
|
|
117
117
|
result << <<-"EOD".gsub(/^ /, '')
|
@@ -125,6 +125,8 @@ class RDoc::OSXDictionary
|
|
125
125
|
name = definition["name"]
|
126
126
|
id = fullname.gsub(/#{NAME_MAP_RE}/) { |x| "_#{NAME_MAP[x]}" }
|
127
127
|
|
128
|
+
return if name =~ /_reduce_\d+/
|
129
|
+
|
128
130
|
params = definition["params"]
|
129
131
|
comment = Array(definition["comment"]).join("\n")
|
130
132
|
comment = "undocumented" if comment.empty?
|
@@ -194,12 +196,15 @@ class RDoc::OSXDictionary
|
|
194
196
|
end
|
195
197
|
|
196
198
|
def make
|
199
|
+
base = File.expand_path "~/.ri/"
|
200
|
+
|
201
|
+
FileUtils.rm_rf base if $d
|
202
|
+
|
197
203
|
seen = {}
|
198
204
|
ri = RDoc::RI::Driver.new
|
199
205
|
dirty = false
|
200
206
|
force = $f || false
|
201
207
|
dict = ri.class_cache
|
202
|
-
base = File.expand_path "~/.ri/"
|
203
208
|
|
204
209
|
dict.sort.each do |klass, definition|
|
205
210
|
path = "#{base}/cache/#{klass}.xml"
|
@@ -232,11 +237,22 @@ class RDoc::OSXDictionary
|
|
232
237
|
|
233
238
|
dict_src_path = "#{base}/RubyGemsDictionary.xml"
|
234
239
|
|
240
|
+
seen.clear
|
241
|
+
|
235
242
|
File.open(dict_src_path, "w") do |xml|
|
236
243
|
xml.puts d_header
|
237
244
|
|
238
245
|
dict.sort.each do |klass, definition|
|
239
|
-
|
246
|
+
next if seen[klass.downcase]
|
247
|
+
seen[klass.downcase] = true
|
248
|
+
|
249
|
+
path = "#{base}/cache/#{klass}.xml"
|
250
|
+
body = File.read path rescue nil
|
251
|
+
if body then
|
252
|
+
xml.puts body
|
253
|
+
else
|
254
|
+
warn "Skipping: couldn't read: #{path}"
|
255
|
+
end
|
240
256
|
end
|
241
257
|
|
242
258
|
xml.puts d_footer
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdoc_osx_dictionary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-03 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|