rdoc_osx_dictionary 1.3.1 → 2.0.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.tar.gz.sig +0 -0
- data/.gemtest +0 -0
- data/History.txt +10 -0
- data/Rakefile +4 -1
- data/bin/rdoc_osx_dictionary +0 -4
- data/lib/rdoc_osx_dictionary.rb +151 -190
- metadata +59 -30
- metadata.gz.sig +0 -0
    
        data.tar.gz.sig
    ADDED
    
    | Binary file | 
    
        data/.gemtest
    ADDED
    
    | 
            File without changes
         | 
    
        data/History.txt
    CHANGED
    
    | @@ -1,3 +1,13 @@ | |
| 1 | 
            +
            === 2.0.0 / 2011-12-15
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            * 1 major enhancement:
         | 
| 4 | 
            +
             | 
| 5 | 
            +
              * Rewritten to use rdoc 3.11 and the new mostly fancy and sometimes ugly API.
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            * 1 minor enhancements:
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              * Got patches into rdoc and bumped our dependency up
         | 
| 10 | 
            +
             | 
| 1 11 | 
             
            === 1.3.1 / 2010-03-30
         | 
| 2 12 |  | 
| 3 13 | 
             
            * 1 minor enhancement:
         | 
    
        data/Rakefile
    CHANGED
    
    | @@ -4,13 +4,16 @@ require 'rubygems' | |
| 4 4 | 
             
            require 'hoe'
         | 
| 5 5 |  | 
| 6 6 | 
             
            Hoe.plugin :seattlerb
         | 
| 7 | 
            +
            Hoe.plugin :isolate
         | 
| 7 8 |  | 
| 8 9 | 
             
            Hoe.spec 'rdoc_osx_dictionary' do
         | 
| 9 10 | 
             
              developer 'Ryan Davis', 'ryand-ruby@zenspider.com'
         | 
| 10 11 |  | 
| 11 | 
            -
               | 
| 12 | 
            +
              dependency 'rdoc', '~> 3.12'
         | 
| 12 13 |  | 
| 13 14 | 
             
              self.rubyforge_name = 'seattlerb'
         | 
| 14 15 | 
             
            end
         | 
| 15 16 |  | 
| 16 17 | 
             
            # vim: syntax=ruby
         | 
| 18 | 
            +
             | 
| 19 | 
            +
            task :fuck
         | 
    
        data/bin/rdoc_osx_dictionary
    CHANGED
    
    
    
        data/lib/rdoc_osx_dictionary.rb
    CHANGED
    
    | @@ -1,22 +1,22 @@ | |
| 1 1 | 
             
            #!/usr/bin/ruby -w
         | 
| 2 2 |  | 
| 3 | 
            +
            gem 'rdoc'
         | 
| 3 4 | 
             
            require 'fileutils'
         | 
| 4 5 | 
             
            require 'rdoc/ri/driver'
         | 
| 5 6 |  | 
| 7 | 
            +
            $d ||= false
         | 
| 8 | 
            +
            $f ||= false
         | 
| 6 9 | 
             
            $q ||= false
         | 
| 10 | 
            +
            $v ||= false
         | 
| 7 11 |  | 
| 8 12 | 
             
            # Forces /bin/tr to ignore badly formatted "unicode". (no clue where from)
         | 
| 9 13 | 
             
            ENV['LANG'] = ""
         | 
| 10 14 | 
             
            ENV['LC_ALL'] = "C"
         | 
| 11 15 |  | 
| 12 16 | 
             
            class RDoc::OSXDictionary
         | 
| 13 | 
            -
              VERSION = ' | 
| 17 | 
            +
              VERSION = '2.0.0'
         | 
| 14 18 |  | 
| 15 19 | 
             
              EXCLUDE = {
         | 
| 16 | 
            -
                "StringScanner#pre_match"  => true,
         | 
| 17 | 
            -
                "StringScanner#post_match" => true,
         | 
| 18 | 
            -
                "Gem::Package::TarInput"   => true,
         | 
| 19 | 
            -
                "IRB::OutputMethod"        => true,
         | 
| 20 20 | 
             
              }
         | 
| 21 21 |  | 
| 22 22 | 
             
              NAME_MAP = {
         | 
| @@ -55,6 +55,11 @@ class RDoc::OSXDictionary | |
| 55 55 | 
             
                                          Regexp.escape(s)
         | 
| 56 56 | 
             
                                        }.reverse.join("|"))
         | 
| 57 57 |  | 
| 58 | 
            +
              attr_reader :to_html
         | 
| 59 | 
            +
             | 
| 60 | 
            +
              def initialize
         | 
| 61 | 
            +
                @to_html = RDoc::Markup::ToHtml.new
         | 
| 62 | 
            +
              end
         | 
| 58 63 |  | 
| 59 64 | 
             
              def id *args
         | 
| 60 65 | 
             
                args.map { |s| s.gsub(/:/, ',') }.join(",").gsub(/#{NAME_MAP_RE}/) { |x|
         | 
| @@ -62,80 +67,85 @@ class RDoc::OSXDictionary | |
| 62 67 | 
             
                }
         | 
| 63 68 | 
             
              end
         | 
| 64 69 |  | 
| 65 | 
            -
              def  | 
| 66 | 
            -
                 | 
| 67 | 
            -
                fullname   = definition["full_name"]
         | 
| 68 | 
            -
                supername  = definition["superclass"]
         | 
| 69 | 
            -
                type       = supername ? "class" : "module"
         | 
| 70 | 
            -
                title      = supername ? "class #{fullname} < #{supername}" : "module #{fullname}"
         | 
| 71 | 
            -
                comment    = Array(definition["comment"]).join("\n")
         | 
| 70 | 
            +
              def write_class_info klass, stores, path
         | 
| 71 | 
            +
                m_seen = {} # HACK: known issue: on a case insensitive FS we're losing files
         | 
| 72 72 |  | 
| 73 | 
            -
                 | 
| 74 | 
            -
             | 
| 73 | 
            +
                File.open(path, "w") do |f|
         | 
| 74 | 
            +
                  c_result, m_result = [], []
         | 
| 75 75 |  | 
| 76 | 
            -
             | 
| 76 | 
            +
                  m_seen.clear
         | 
| 77 | 
            +
                  seen_system = false
         | 
| 77 78 |  | 
| 78 | 
            -
             | 
| 79 | 
            +
                  fullname  = klass
         | 
| 79 80 |  | 
| 80 | 
            -
             | 
| 81 | 
            +
                  f.puts <<-"EOD".gsub(/^ {6}/, '')
         | 
| 82 | 
            +
                    <d:entry id="#{id fullname}" d:title="#{fullname}">
         | 
| 83 | 
            +
                      <d:index d:value="#{fullname.munge}"/>
         | 
| 84 | 
            +
                  EOD
         | 
| 81 85 |  | 
| 82 | 
            -
             | 
| 86 | 
            +
                  first = true
         | 
| 83 87 |  | 
| 84 | 
            -
             | 
| 85 | 
            -
             | 
| 86 | 
            -
                   | 
| 87 | 
            -
                   | 
| 88 | 
            -
                   | 
| 88 | 
            +
                  stores.each do |store|
         | 
| 89 | 
            +
                    cdesc     = store.load_class klass
         | 
| 90 | 
            +
                    type      = store.type
         | 
| 91 | 
            +
                    from      = store.friendly_path
         | 
| 92 | 
            +
                    name      = cdesc.name
         | 
| 93 | 
            +
                    is_class  = ! cdesc.module?
         | 
| 94 | 
            +
                    supername = cdesc.superclass if is_class
         | 
| 95 | 
            +
                    comment   = to_html.convert cdesc.comment
         | 
| 96 | 
            +
                    type      = is_class ? "class" : "module"
         | 
| 97 | 
            +
                    title     = is_class ? "class #{fullname}" : "module #{fullname}"
         | 
| 89 98 |  | 
| 90 | 
            -
             | 
| 91 | 
            -
                EOD
         | 
| 99 | 
            +
                    title += " < #{supername}" if is_class and supername != "Object"
         | 
| 92 100 |  | 
| 93 | 
            -
             | 
| 101 | 
            +
                    comment = "Improperly formatted" if EXCLUDE[fullname]
         | 
| 94 102 |  | 
| 95 | 
            -
             | 
| 96 | 
            -
                definition["sources"].each do |path|
         | 
| 97 | 
            -
                  next if path =~ /^.System/
         | 
| 103 | 
            +
                    shortname = "<d:index d:value=#{name.munge.inspect}/>" if name != fullname
         | 
| 98 104 |  | 
| 99 | 
            -
             | 
| 100 | 
            -
             | 
| 105 | 
            +
                    f.puts <<-"EOD".gsub(/^ {8}/, '')
         | 
| 106 | 
            +
                        #{shortname}
         | 
| 107 | 
            +
                        <h1>#{title.munge}</h1>
         | 
| 108 | 
            +
                        <h3>From: #{from}</h3>
         | 
| 101 109 |  | 
| 102 | 
            -
             | 
| 103 | 
            -
             | 
| 110 | 
            +
                        #{comment}
         | 
| 111 | 
            +
                    EOD
         | 
| 104 112 |  | 
| 105 | 
            -
             | 
| 113 | 
            +
                    level = first ? 2 : 4
         | 
| 114 | 
            +
                    first = false
         | 
| 106 115 |  | 
| 107 | 
            -
             | 
| 116 | 
            +
                    f.puts class_details(name, fullname, cdesc, level)
         | 
| 108 117 |  | 
| 109 | 
            -
             | 
| 110 | 
            -
             | 
| 111 | 
            -
             | 
| 112 | 
            -
             | 
| 113 | 
            -
             | 
| 114 | 
            -
             | 
| 118 | 
            +
                    cdesc.method_list.each do |method|
         | 
| 119 | 
            +
                      next if m_seen[method.full_name.downcase]
         | 
| 120 | 
            +
                      method = store.load_method klass, method.full_name
         | 
| 121 | 
            +
                      m_result << display_method_info(method, from)
         | 
| 122 | 
            +
                      m_seen[method.full_name.downcase] = true
         | 
| 123 | 
            +
                    end
         | 
| 124 | 
            +
                  end # stores.each
         | 
| 115 125 |  | 
| 116 | 
            -
             | 
| 117 | 
            -
             | 
| 118 | 
            -
                result << extensions
         | 
| 126 | 
            +
                  f.puts <<-"EOD".gsub(/^ {6}/, '')
         | 
| 127 | 
            +
                    </d:entry>
         | 
| 119 128 |  | 
| 120 | 
            -
             | 
| 121 | 
            -
             | 
| 122 | 
            -
             | 
| 123 | 
            -
                 | 
| 129 | 
            +
                  EOD
         | 
| 130 | 
            +
             | 
| 131 | 
            +
                  f.puts m_result.join("\n\n")
         | 
| 132 | 
            +
                end
         | 
| 124 133 | 
             
              end
         | 
| 125 134 |  | 
| 135 | 
            +
              # REFACTOR: fold this back in
         | 
| 126 136 | 
             
              def class_details name, fullname, definition, level = 2
         | 
| 127 | 
            -
                h | 
| 128 | 
            -
                result | 
| 129 | 
            -
                includes | 
| 130 | 
            -
                constants | 
| 137 | 
            +
                h         = "h#{level}"
         | 
| 138 | 
            +
                result    = []
         | 
| 139 | 
            +
                includes  = definition.includes.map { |c| c.name }
         | 
| 140 | 
            +
                constants = definition.constants.map { |c| c.name }
         | 
| 131 141 |  | 
| 132 | 
            -
                classmeths = definition | 
| 133 | 
            -
                  name =  | 
| 142 | 
            +
                classmeths = definition.singleton_methods.map { |cm|
         | 
| 143 | 
            +
                  name = cm.name
         | 
| 134 144 | 
             
                  "<a href=\"x-dictionary:r:#{id "defs", fullname, name}\">#{name}</a>"
         | 
| 135 145 | 
             
                }
         | 
| 136 146 |  | 
| 137 | 
            -
                instmeths | 
| 138 | 
            -
                  name =  | 
| 147 | 
            +
                instmeths = definition.instance_method_list.map { |im|
         | 
| 148 | 
            +
                  name = im.name
         | 
| 139 149 | 
             
                  "<a href=\"x-dictionary:r:#{id "def", fullname, name}\">#{name.munge}</a>"
         | 
| 140 150 | 
             
                }
         | 
| 141 151 |  | 
| @@ -152,94 +162,73 @@ class RDoc::OSXDictionary | |
| 152 162 | 
             
                result
         | 
| 153 163 | 
             
              end
         | 
| 154 164 |  | 
| 155 | 
            -
              def display_method_info definition
         | 
| 156 | 
            -
                 | 
| 157 | 
            -
                klass = definition["class"]
         | 
| 158 | 
            -
                name = definition["name"]
         | 
| 165 | 
            +
              def display_method_info definition, from
         | 
| 166 | 
            +
                klass     = definition.parent_name
         | 
| 159 167 |  | 
| 160 | 
            -
                 | 
| 168 | 
            +
                fullname  = definition.full_name
         | 
| 169 | 
            +
                name      = definition.name
         | 
| 170 | 
            +
                singleton = definition.singleton
         | 
| 171 | 
            +
                params    = definition.arglists
         | 
| 172 | 
            +
                comment   = to_html.convert definition.comment
         | 
| 173 | 
            +
                type      = singleton ? "defs" : "def"
         | 
| 161 174 |  | 
| 162 175 | 
             
                return if name =~ /_reduce_\d+/
         | 
| 163 176 |  | 
| 164 | 
            -
                params = definition["params"]
         | 
| 165 | 
            -
                comment = Array(definition["comment"]).join("\n")
         | 
| 166 177 | 
             
                comment = "undocumented" if comment.empty?
         | 
| 167 | 
            -
             | 
| 168 178 | 
             
                comment = "Improperly formatted" if EXCLUDE[fullname]
         | 
| 169 179 |  | 
| 170 | 
            -
                 | 
| 171 | 
            -
             | 
| 172 | 
            -
                 | 
| 173 | 
            -
             | 
| 174 | 
            -
             | 
| 175 | 
            -
             | 
| 176 | 
            -
             | 
| 177 | 
            -
             | 
| 178 | 
            -
             | 
| 179 | 
            -
             | 
| 180 | 
            -
             | 
| 181 | 
            -
             | 
| 182 | 
            -
             | 
| 180 | 
            +
                # HACK to deal with the Dictionary compiler fucking with my whitespace.
         | 
| 181 | 
            +
                comment = comment.gsub(/<span[^>]+>/, '').gsub(/<\/span>/, '')
         | 
| 182 | 
            +
                comment = comment.gsub(/(<pre[^>]*>)\s*\n/, '\1')
         | 
| 183 | 
            +
             | 
| 184 | 
            +
                result = <<-"EOD".gsub(/^ {6}/, '')
         | 
| 185 | 
            +
                  <d:entry id="#{id type, klass, name}" d:title="#{fullname.munge}">
         | 
| 186 | 
            +
                    <d:index d:value="#{fullname.munge}"/>
         | 
| 187 | 
            +
                    <d:index d:value="#{name.munge}"/>
         | 
| 188 | 
            +
                    <h1>#{fullname.munge}</h1>
         | 
| 189 | 
            +
                    <h3>From: #{from}</h3>
         | 
| 190 | 
            +
                    <pre class="signatures">
         | 
| 191 | 
            +
                      #{d_signatures(name, params)}
         | 
| 192 | 
            +
                    </pre>
         | 
| 183 193 | 
             
                  #{comment}
         | 
| 184 | 
            -
             | 
| 185 | 
            -
             | 
| 194 | 
            +
                  </d:entry>
         | 
| 195 | 
            +
                EOD
         | 
| 186 196 | 
             
              end
         | 
| 187 197 |  | 
| 188 198 | 
             
              def d_signatures name, params
         | 
| 189 199 | 
             
                result = " "
         | 
| 200 | 
            +
                params ||= ""
         | 
| 190 201 | 
             
                if params.strip =~ /^\(/
         | 
| 191 202 | 
             
                  result << "<b>#{name.munge}</b>"
         | 
| 192 203 | 
             
                end
         | 
| 193 | 
            -
                result << "<b>#{params.munge.gsub(/\n | 
| 204 | 
            +
                result << "<b>#{params.munge.gsub(/\n+/, "\n")}</b>"
         | 
| 194 205 | 
             
              end
         | 
| 195 206 |  | 
| 196 207 | 
             
              def d_header
         | 
| 197 | 
            -
                result = <<-"EOD"
         | 
| 198 | 
            -
            <?xml version="1.0" encoding="UTF-8"?>
         | 
| 199 | 
            -
             | 
| 200 | 
            -
             | 
| 201 | 
            -
              It can be built using Dictionary Development Kit.
         | 
| 202 | 
            -
            -->
         | 
| 203 | 
            -
            <d:dictionary xmlns="http://www.w3.org/1999/xhtml" xmlns:d="http://www.apple.com/DTDs/DictionaryService-1.0.rng">
         | 
| 204 | 
            -
              EOD
         | 
| 208 | 
            +
                result = <<-"EOD".gsub(/^ {6}/, '')
         | 
| 209 | 
            +
                  <?xml version="1.0" encoding="UTF-8"?>
         | 
| 210 | 
            +
                  <d:dictionary xmlns="http://www.w3.org/1999/xhtml" xmlns:d="http://www.apple.com/DTDs/DictionaryService-1.0.rng">
         | 
| 211 | 
            +
                EOD
         | 
| 205 212 | 
             
              end
         | 
| 206 213 |  | 
| 207 | 
            -
              def  | 
| 208 | 
            -
                 | 
| 209 | 
            -
                   | 
| 210 | 
            -
             | 
| 211 | 
            -
             | 
| 212 | 
            -
             | 
| 213 | 
            -
             | 
| 214 | 
            +
              def d_footer classes, sources
         | 
| 215 | 
            +
                result = <<-"EOD".gsub(/^ {6}/, '')
         | 
| 216 | 
            +
                  <d:entry id="front_back_matter" d:title="Front/Back Matter">
         | 
| 217 | 
            +
                    <h1><b>RubyGems Dictionary</b></h1>
         | 
| 218 | 
            +
             | 
| 219 | 
            +
                    <div>
         | 
| 220 | 
            +
                      Provides dictionary definitions for ruby core, stdlib, and
         | 
| 221 | 
            +
                      all known installed ruby gems.
         | 
| 222 | 
            +
                    </div>
         | 
| 214 223 |  | 
| 215 | 
            -
             | 
| 216 | 
            -
             | 
| 217 | 
            -
             | 
| 218 | 
            -
             | 
| 219 | 
            -
             | 
| 220 | 
            -
             | 
| 221 | 
            -
             | 
| 222 | 
            -
             | 
| 223 | 
            -
              <div>
         | 
| 224 | 
            -
                <b>To see</b> this page,
         | 
| 225 | 
            -
                <ol>
         | 
| 226 | 
            -
                  <li>Open "Go" menu.</li>
         | 
| 227 | 
            -
                  <li>Choose "Front/Back Matter" menu item.
         | 
| 228 | 
            -
                  If it has sub-menu items, choose one of them.</li>
         | 
| 229 | 
            -
                </ol>
         | 
| 230 | 
            -
              </div>
         | 
| 231 | 
            -
              <div>
         | 
| 232 | 
            -
                <b>To prepare</b> the menu item, do the followings.
         | 
| 233 | 
            -
                <ol>
         | 
| 234 | 
            -
                  <li>Prepare this page source as an entry.</li>
         | 
| 235 | 
            -
                  <li>Add "DCSDictionaryFrontMatterReferenceID" key and its value to the plist of the dictionary.
         | 
| 236 | 
            -
                  The value should be the string of this page entry id. </li>
         | 
| 237 | 
            -
                </ol>
         | 
| 238 | 
            -
              </div>
         | 
| 239 | 
            -
              <br/>
         | 
| 240 | 
            -
            </d:entry>
         | 
| 241 | 
            -
            </d:dictionary>
         | 
| 242 | 
            -
              EOD
         | 
| 224 | 
            +
                    <h3>Sources:</h3>
         | 
| 225 | 
            +
                    <div>#{sources.keys.sort.join ", "}</div>
         | 
| 226 | 
            +
             | 
| 227 | 
            +
                    <h3>Classes:</h3>
         | 
| 228 | 
            +
                    <div>#{classes.keys.sort.join ", "}</div>
         | 
| 229 | 
            +
                  </d:entry>
         | 
| 230 | 
            +
                  </d:dictionary>
         | 
| 231 | 
            +
                EOD
         | 
| 243 232 | 
             
              end
         | 
| 244 233 |  | 
| 245 234 | 
             
              def make
         | 
| @@ -247,54 +236,64 @@ class RDoc::OSXDictionary | |
| 247 236 |  | 
| 248 237 | 
             
                FileUtils.rm_rf base if $d
         | 
| 249 238 |  | 
| 250 | 
            -
                 | 
| 251 | 
            -
                 | 
| 239 | 
            +
                dir = File.join base, "dict"
         | 
| 240 | 
            +
                FileUtils.mkdir_p dir unless File.directory? dir
         | 
| 241 | 
            +
             | 
| 252 242 | 
             
                dirty = false
         | 
| 253 243 | 
             
                force = $f || false
         | 
| 254 | 
            -
                 | 
| 244 | 
            +
                ri    = RDoc::RI::Driver.new
         | 
| 245 | 
            +
                dict  = ri.classes
         | 
| 246 | 
            +
             | 
| 247 | 
            +
                l_seen = {}
         | 
| 255 248 |  | 
| 256 | 
            -
                dict.sort.each do |klass,  | 
| 257 | 
            -
                  path = "#{base}/ | 
| 249 | 
            +
                dict.sort.each do |klass, stores|
         | 
| 250 | 
            +
                  path = "#{base}/dict/#{klass}.xml"
         | 
| 258 251 |  | 
| 259 | 
            -
                  next if  | 
| 260 | 
            -
                  seen[klass.downcase] = true
         | 
| 252 | 
            +
                  next if $q and klass !~ /^(String|Array|Bignum)/
         | 
| 261 253 |  | 
| 262 254 | 
             
                  unless File.exist? path then
         | 
| 263 | 
            -
                     | 
| 255 | 
            +
                    unless dirty then
         | 
| 256 | 
            +
                      warn "New entries for dictionary. Rebuilding dictionary."
         | 
| 257 | 
            +
                      warn "Sing along, kids!"
         | 
| 258 | 
            +
                    end
         | 
| 264 259 | 
             
                    dirty = true
         | 
| 265 | 
            -
             | 
| 266 260 | 
             
                    warn klass if $v
         | 
| 267 261 |  | 
| 268 | 
            -
                     | 
| 269 | 
            -
             | 
| 270 | 
            -
                      next if methods.nil? || methods.empty?
         | 
| 271 | 
            -
                      result = []
         | 
| 272 | 
            -
                      result << d_entry(klass, dict[klass], true)
         | 
| 273 | 
            -
             | 
| 274 | 
            -
                      methods.each do |k,v|
         | 
| 275 | 
            -
                        v["class"] = klass
         | 
| 276 | 
            -
                        result << d_entry(k, v)
         | 
| 277 | 
            -
                      end
         | 
| 262 | 
            +
                    $stderr.print klass[0,1] unless l_seen[klass[0,1]]
         | 
| 263 | 
            +
                    l_seen[klass[0,1]] = true
         | 
| 278 264 |  | 
| 279 | 
            -
             | 
| 280 | 
            -
                    end
         | 
| 265 | 
            +
                    write_class_info klass, stores, path
         | 
| 281 266 | 
             
                  end
         | 
| 282 267 | 
             
                end
         | 
| 283 268 |  | 
| 269 | 
            +
                warn "! YAY!! All done!!!" if dirty
         | 
| 270 | 
            +
             | 
| 284 271 | 
             
                return unless dirty unless force
         | 
| 285 272 |  | 
| 286 273 | 
             
                dict_src_path = "#{base}/RubyGemsDictionary.xml"
         | 
| 287 274 |  | 
| 288 | 
            -
                seen | 
| 275 | 
            +
                seen = {}
         | 
| 276 | 
            +
             | 
| 277 | 
            +
                classes = {}
         | 
| 278 | 
            +
                sources = {}
         | 
| 279 | 
            +
                ri.classes.sort.each do |klass, stores|
         | 
| 280 | 
            +
                  classes[klass] = true
         | 
| 281 | 
            +
             | 
| 282 | 
            +
                  stores.each do |store|
         | 
| 283 | 
            +
                    sources[store.friendly_path] = true
         | 
| 284 | 
            +
                  end
         | 
| 285 | 
            +
                end
         | 
| 289 286 |  | 
| 290 287 | 
             
                File.open(dict_src_path, "w") do |xml|
         | 
| 291 288 | 
             
                  xml.puts d_header
         | 
| 292 289 |  | 
| 293 | 
            -
                  dict.sort.each do |klass,  | 
| 294 | 
            -
                    next if  | 
| 295 | 
            -
                    seen[klass.downcase] = true
         | 
| 290 | 
            +
                  dict.sort.each do |klass, stores|
         | 
| 291 | 
            +
                    next if $q and klass !~ /^(String|Array|Bignum)/
         | 
| 296 292 |  | 
| 297 | 
            -
                     | 
| 293 | 
            +
                    next if seen[klass]
         | 
| 294 | 
            +
                    seen[klass] = true
         | 
| 295 | 
            +
             | 
| 296 | 
            +
                    path = "#{base}/dict/#{klass}.xml"
         | 
| 298 297 | 
             
                    body = File.read path rescue nil
         | 
| 299 298 | 
             
                    if body then
         | 
| 300 299 | 
             
                      xml.puts body
         | 
| @@ -303,7 +302,7 @@ class RDoc::OSXDictionary | |
| 303 302 | 
             
                    end
         | 
| 304 303 | 
             
                  end
         | 
| 305 304 |  | 
| 306 | 
            -
                  xml.puts d_footer
         | 
| 305 | 
            +
                  xml.puts d_footer(classes, sources)
         | 
| 307 306 | 
             
                end
         | 
| 308 307 |  | 
| 309 308 | 
             
                dict_name = "RubyAndGems"
         | 
| @@ -312,6 +311,7 @@ class RDoc::OSXDictionary | |
| 312 311 |  | 
| 313 312 | 
             
                Dir.chdir base do
         | 
| 314 313 | 
             
                  run("/Developer/Extras/Dictionary Development Kit/bin/build_dict.sh",
         | 
| 314 | 
            +
                      "-c=0",
         | 
| 315 315 | 
             
                      dict_name, dict_src_path,
         | 
| 316 316 | 
             
                      "#{data}/RubyGemsDictionary.css",
         | 
| 317 317 | 
             
                      "#{data}/RubyGemsInfo.plist")
         | 
| @@ -360,7 +360,7 @@ class RDoc::OSXDictionary | |
| 360 360 | 
             
                    @hooked[:uninstall] = true
         | 
| 361 361 | 
             
                    require 'fileutils'
         | 
| 362 362 | 
             
                    warn "nuking old ri cache to force rebuild"
         | 
| 363 | 
            -
                    FileUtils.rm_r File.expand_path("~/.ri/ | 
| 363 | 
            +
                    FileUtils.rm_r File.expand_path("~/.ri/dict")
         | 
| 364 364 | 
             
                    system cmd
         | 
| 365 365 | 
             
                  end
         | 
| 366 366 | 
             
                end
         | 
| @@ -374,42 +374,3 @@ class String | |
| 374 374 | 
             
                self.gsub(/&/, '&').gsub(/>/, '>').gsub(/</, '<').gsub(/-/, '-')
         | 
| 375 375 | 
             
              end
         | 
| 376 376 | 
             
            end
         | 
| 377 | 
            -
             | 
| 378 | 
            -
            class RDoc::Markup::Flow::LIST # ARG!
         | 
| 379 | 
            -
              def to_s
         | 
| 380 | 
            -
                pre, post = { :NUMBER => ['<ol>', '</ol>'] }[self.type] || ['<ul>', '</ul>']
         | 
| 381 | 
            -
             | 
| 382 | 
            -
                raise "no: #{self.type}" unless pre
         | 
| 383 | 
            -
             | 
| 384 | 
            -
                "#{pre}#{contents.join("\n")}#{post}"
         | 
| 385 | 
            -
              end
         | 
| 386 | 
            -
            end
         | 
| 387 | 
            -
             | 
| 388 | 
            -
            class Struct
         | 
| 389 | 
            -
              alias :old_to_s :to_s
         | 
| 390 | 
            -
             | 
| 391 | 
            -
              MARKUP = {
         | 
| 392 | 
            -
                "RULE" => [nil, nil],
         | 
| 393 | 
            -
                "H"    => ["<h2>", "</h2>"],
         | 
| 394 | 
            -
                "P"    => ["<p>", "</p>"],
         | 
| 395 | 
            -
                "VERB" => ["<pre>", "</pre>"],
         | 
| 396 | 
            -
                "LI"   => ['<li>', '</li>'],
         | 
| 397 | 
            -
              }
         | 
| 398 | 
            -
             | 
| 399 | 
            -
              def body
         | 
| 400 | 
            -
                self.text
         | 
| 401 | 
            -
              end
         | 
| 402 | 
            -
             | 
| 403 | 
            -
              def to_s
         | 
| 404 | 
            -
                name = self.class.name
         | 
| 405 | 
            -
                if name =~ /Flow/ then
         | 
| 406 | 
            -
                  short = name.split(/::/).last
         | 
| 407 | 
            -
                  raise short unless MARKUP.has_key? short
         | 
| 408 | 
            -
                  pre, post = MARKUP[short]
         | 
| 409 | 
            -
                  return "" unless pre
         | 
| 410 | 
            -
                  "#{pre}#{self.body}#{post}"
         | 
| 411 | 
            -
                else
         | 
| 412 | 
            -
                  old_to_s
         | 
| 413 | 
            -
                end
         | 
| 414 | 
            -
              end
         | 
| 415 | 
            -
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,76 +1,101 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: rdoc_osx_dictionary
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
               | 
| 4 | 
            +
              hash: 15
         | 
| 5 | 
            +
              prerelease: 
         | 
| 5 6 | 
             
              segments: 
         | 
| 6 | 
            -
              -  | 
| 7 | 
            -
              -  | 
| 8 | 
            -
              -  | 
| 9 | 
            -
              version:  | 
| 7 | 
            +
              - 2
         | 
| 8 | 
            +
              - 0
         | 
| 9 | 
            +
              - 0
         | 
| 10 | 
            +
              version: 2.0.0
         | 
| 10 11 | 
             
            platform: ruby
         | 
| 11 12 | 
             
            authors: 
         | 
| 12 13 | 
             
            - Ryan Davis
         | 
| 13 14 | 
             
            autorequire: 
         | 
| 14 15 | 
             
            bindir: bin
         | 
| 15 | 
            -
            cert_chain:  | 
| 16 | 
            +
            cert_chain: 
         | 
| 17 | 
            +
            - |
         | 
| 18 | 
            +
              -----BEGIN CERTIFICATE-----
         | 
| 19 | 
            +
              MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
         | 
| 20 | 
            +
              ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
         | 
| 21 | 
            +
              GRYDY29tMB4XDTA5MDMwNjE4NTMxNVoXDTEwMDMwNjE4NTMxNVowRTETMBEGA1UE
         | 
| 22 | 
            +
              AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
         | 
| 23 | 
            +
              JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
         | 
| 24 | 
            +
              b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
         | 
| 25 | 
            +
              taCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT
         | 
| 26 | 
            +
              oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
         | 
| 27 | 
            +
              GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
         | 
| 28 | 
            +
              qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
         | 
| 29 | 
            +
              gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
         | 
| 30 | 
            +
              HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
         | 
| 31 | 
            +
              AQAY59gYvDxqSqgC92nAP9P8dnGgfZgLxP237xS6XxFGJSghdz/nI6pusfCWKM8m
         | 
| 32 | 
            +
              vzjjH2wUMSSf3tNudQ3rCGLf2epkcU13/rguI88wO6MrE0wi4ZqLQX+eZQFskJb/
         | 
| 33 | 
            +
              w6x9W1ur8eR01s397LSMexySDBrJOh34cm2AlfKr/jokKCTwcM0OvVZnAutaovC0
         | 
| 34 | 
            +
              l1SVZ0ecg88bsWHA0Yhh7NFxK1utWoIhtB6AFC/+trM0FQEB/jZkIS8SaNzn96Rl
         | 
| 35 | 
            +
              n0sZEf77FLf5peR8TP/PtmIg7Cyqz23sLM4mCOoTGIy5OcZ8TdyiyINUHtb5ej/T
         | 
| 36 | 
            +
              FBHgymkyj/AOSqKRIpXPhjC6
         | 
| 37 | 
            +
              -----END CERTIFICATE-----
         | 
| 16 38 |  | 
| 17 | 
            -
            date:  | 
| 18 | 
            -
            default_executable: 
         | 
| 39 | 
            +
            date: 2011-12-15 00:00:00 Z
         | 
| 19 40 | 
             
            dependencies: 
         | 
| 20 41 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 21 42 | 
             
              name: rdoc
         | 
| 22 43 | 
             
              prerelease: false
         | 
| 23 44 | 
             
              requirement: &id001 !ruby/object:Gem::Requirement 
         | 
| 45 | 
            +
                none: false
         | 
| 24 46 | 
             
                requirements: 
         | 
| 25 47 | 
             
                - - ~>
         | 
| 26 48 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 49 | 
            +
                    hash: 31
         | 
| 27 50 | 
             
                    segments: 
         | 
| 28 | 
            -
                    - 2
         | 
| 29 | 
            -
                    - 4
         | 
| 30 51 | 
             
                    - 3
         | 
| 31 | 
            -
                     | 
| 52 | 
            +
                    - 12
         | 
| 53 | 
            +
                    version: "3.12"
         | 
| 32 54 | 
             
              type: :runtime
         | 
| 33 55 | 
             
              version_requirements: *id001
         | 
| 34 56 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 35 | 
            -
              name:  | 
| 57 | 
            +
              name: minitest
         | 
| 36 58 | 
             
              prerelease: false
         | 
| 37 59 | 
             
              requirement: &id002 !ruby/object:Gem::Requirement 
         | 
| 60 | 
            +
                none: false
         | 
| 38 61 | 
             
                requirements: 
         | 
| 39 | 
            -
                - -  | 
| 62 | 
            +
                - - ~>
         | 
| 40 63 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 64 | 
            +
                    hash: 19
         | 
| 41 65 | 
             
                    segments: 
         | 
| 42 66 | 
             
                    - 2
         | 
| 43 | 
            -
                    -  | 
| 44 | 
            -
                     | 
| 45 | 
            -
                    version: 2.0.4
         | 
| 67 | 
            +
                    - 8
         | 
| 68 | 
            +
                    version: "2.8"
         | 
| 46 69 | 
             
              type: :development
         | 
| 47 70 | 
             
              version_requirements: *id002
         | 
| 48 71 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 49 | 
            -
              name:  | 
| 72 | 
            +
              name: hoe
         | 
| 50 73 | 
             
              prerelease: false
         | 
| 51 74 | 
             
              requirement: &id003 !ruby/object:Gem::Requirement 
         | 
| 75 | 
            +
                none: false
         | 
| 52 76 | 
             
                requirements: 
         | 
| 53 | 
            -
                - -  | 
| 77 | 
            +
                - - ~>
         | 
| 54 78 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 79 | 
            +
                    hash: 27
         | 
| 55 80 | 
             
                    segments: 
         | 
| 56 | 
            -
                    -  | 
| 57 | 
            -
                    -  | 
| 58 | 
            -
                     | 
| 59 | 
            -
                    version: 1.6.0
         | 
| 81 | 
            +
                    - 2
         | 
| 82 | 
            +
                    - 12
         | 
| 83 | 
            +
                    version: "2.12"
         | 
| 60 84 | 
             
              type: :development
         | 
| 61 85 | 
             
              version_requirements: *id003
         | 
| 62 86 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 63 | 
            -
              name:  | 
| 87 | 
            +
              name: rdoc
         | 
| 64 88 | 
             
              prerelease: false
         | 
| 65 89 | 
             
              requirement: &id004 !ruby/object:Gem::Requirement 
         | 
| 90 | 
            +
                none: false
         | 
| 66 91 | 
             
                requirements: 
         | 
| 67 | 
            -
                - -  | 
| 92 | 
            +
                - - ~>
         | 
| 68 93 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 94 | 
            +
                    hash: 19
         | 
| 69 95 | 
             
                    segments: 
         | 
| 70 | 
            -
                    -  | 
| 71 | 
            -
                    -  | 
| 72 | 
            -
                     | 
| 73 | 
            -
                    version: 2.6.0
         | 
| 96 | 
            +
                    - 3
         | 
| 97 | 
            +
                    - 10
         | 
| 98 | 
            +
                    version: "3.10"
         | 
| 74 99 | 
             
              type: :development
         | 
| 75 100 | 
             
              version_requirements: *id004
         | 
| 76 101 | 
             
            description: |-
         | 
| @@ -98,7 +123,7 @@ files: | |
| 98 123 | 
             
            - data/RubyGemsInfo.plist
         | 
| 99 124 | 
             
            - lib/rdoc_osx_dictionary.rb
         | 
| 100 125 | 
             
            - lib/rubygems_plugin.rb
         | 
| 101 | 
            -
             | 
| 126 | 
            +
            - .gemtest
         | 
| 102 127 | 
             
            homepage: http://rubyforge.org/projects/seattlerb
         | 
| 103 128 | 
             
            licenses: []
         | 
| 104 129 |  | 
| @@ -109,23 +134,27 @@ rdoc_options: | |
| 109 134 | 
             
            require_paths: 
         | 
| 110 135 | 
             
            - lib
         | 
| 111 136 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement 
         | 
| 137 | 
            +
              none: false
         | 
| 112 138 | 
             
              requirements: 
         | 
| 113 139 | 
             
              - - ">="
         | 
| 114 140 | 
             
                - !ruby/object:Gem::Version 
         | 
| 141 | 
            +
                  hash: 3
         | 
| 115 142 | 
             
                  segments: 
         | 
| 116 143 | 
             
                  - 0
         | 
| 117 144 | 
             
                  version: "0"
         | 
| 118 145 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement 
         | 
| 146 | 
            +
              none: false
         | 
| 119 147 | 
             
              requirements: 
         | 
| 120 148 | 
             
              - - ">="
         | 
| 121 149 | 
             
                - !ruby/object:Gem::Version 
         | 
| 150 | 
            +
                  hash: 3
         | 
| 122 151 | 
             
                  segments: 
         | 
| 123 152 | 
             
                  - 0
         | 
| 124 153 | 
             
                  version: "0"
         | 
| 125 154 | 
             
            requirements: []
         | 
| 126 155 |  | 
| 127 156 | 
             
            rubyforge_project: seattlerb
         | 
| 128 | 
            -
            rubygems_version: 1. | 
| 157 | 
            +
            rubygems_version: 1.8.10
         | 
| 129 158 | 
             
            signing_key: 
         | 
| 130 159 | 
             
            specification_version: 3
         | 
| 131 160 | 
             
            summary: rdoc via Apple's Dictionary.app
         | 
    
        metadata.gz.sig
    ADDED
    
    | Binary file |