lib/rdoc/generator/markdown.rb in rdoc-markdown-0.4 vs lib/rdoc/generator/markdown.rb in rdoc-markdown-0.4.2

- old
+ new

@@ -12,13 +12,11 @@ RDoc::RDoc.add_generator self ## # Defines a constant for directory where templates could be found - TEMPLATE_DIR = File.expand_path( - File.join(File.dirname(__FILE__), "..", "..", "templates") - ) + TEMPLATE_DIR = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "templates")) ## # The RDoc::Store that is the source of the generated content attr_reader :store @@ -112,37 +110,43 @@ @classes.map do |klass| result << { name: klass.full_name, type: klass.type.capitalize, - path: turn_to_path(klass.full_name) + path: turn_to_path(klass.full_name), } klass.method_list.each do |method| next if method.visibility.to_s.eql?("private") result << { name: "#{klass.full_name}.#{method.name}", type: "Method", - path: "#{turn_to_path(klass.full_name)}##{method.aref}" + path: "#{turn_to_path(klass.full_name)}##{method.aref}", } end - klass.constants.sort_by { |x| x.name }.each do |const| - result << { - name: "#{klass.full_name}.#{const.name}", - type: "Constant", - path: "#{turn_to_path(klass.full_name)}##{const.name}" - } - end + klass + .constants + .sort_by { |x| x.name } + .each do |const| + result << { + name: "#{klass.full_name}.#{const.name}", + type: "Constant", + path: "#{turn_to_path(klass.full_name)}##{const.name}", + } + end - klass.attributes.sort_by { |x| x.name }.each do |attr| - result << { - name: "#{klass.full_name}.#{attr.name}", - type: "Attribute", - path: "#{turn_to_path(klass.full_name)}##{attr.aref}" - } - end + klass + .attributes + .sort_by { |x| x.name } + .each do |attr| + result << { + name: "#{klass.full_name}.#{attr.name}", + type: "Attribute", + path: "#{turn_to_path(klass.full_name)}##{attr.aref}", + } + end end result.each do |rec| db.execute "insert into contentIndex (name, type, path) values (:name, :type, :path)", rec end