123456789_123456789_123456789_123456789_123456789_

Class: RDoc::Parser::ChangeLog::Git::LogEntry

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Struct
Instance Chain:
self, Struct
Inherits: Struct
  • Object
Defined in: lib/rdoc/parser/changelog.rb

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(base, commit, author, email, date, contents) ⇒ LogEntry

[ GitHub ]

  
# File 'lib/rdoc/parser/changelog.rb', line 273

def initialize(base, commit, author, email, date, contents)
  case contents
  when String
    contents = RDoc::Markdown.parse(contents).parts.each do |body|
      case body
      when RDoc::Markup::Heading
        body.level += HEADING_LEVEL + 1
      end
    end
    case first = contents[0]
    when RDoc::Markup::Paragraph
      contents[0] = RDoc::Markup::Heading.new(HEADING_LEVEL + 1, first.text)
    end
  end
  super
end

Instance Attribute Details

#author (rw)

[ GitHub ]

  
# File 'lib/rdoc/parser/changelog.rb', line 270

LogEntry = Struct.new(:base, :commit, :author, :email, :date, :contents)

#base (rw)

[ GitHub ]

  
# File 'lib/rdoc/parser/changelog.rb', line 270

LogEntry = Struct.new(:base, :commit, :author, :email, :date, :contents)

#commit (rw)

[ GitHub ]

  
# File 'lib/rdoc/parser/changelog.rb', line 270

LogEntry = Struct.new(:base, :commit, :author, :email, :date, :contents)

#contents (rw)

[ GitHub ]

  
# File 'lib/rdoc/parser/changelog.rb', line 270

LogEntry = Struct.new(:base, :commit, :author, :email, :date, :contents)

#date (rw)

[ GitHub ]

  
# File 'lib/rdoc/parser/changelog.rb', line 270

LogEntry = Struct.new(:base, :commit, :author, :email, :date, :contents)

#email (rw)

[ GitHub ]

  
# File 'lib/rdoc/parser/changelog.rb', line 270

LogEntry = Struct.new(:base, :commit, :author, :email, :date, :contents)

Instance Method Details

#accept(visitor)

[ GitHub ]

  
# File 'lib/rdoc/parser/changelog.rb', line 313

def accept visitor
  visitor.accept_heading self
  begin
    if visitor.respond_to?(:code_object=)
      code_object = visitor.code_object
      visitor.code_object = self
    end
    contents.each do |body|
      body.accept visitor
    end
  ensure
    if visitor.respond_to?(:code_object)
      visitor.code_object = code_object
    end
  end
end

#aref

[ GitHub ]

  
# File 'lib/rdoc/parser/changelog.rb', line 294

def aref
  "label-#{commit}"
end

#label(context = nil)

[ GitHub ]

  
# File 'lib/rdoc/parser/changelog.rb', line 298

def label context = nil
  aref
end

#level

[ GitHub ]

  
# File 'lib/rdoc/parser/changelog.rb', line 290

def level
  HEADING_LEVEL
end

#pretty_print(q)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rdoc/parser/changelog.rb', line 330

def pretty_print q # :nodoc:
  q.group(2, '[log_entry: ', ']') do
    q.text commit
    q.text ','
    q.breakable
    q.group(2, '[date: ', ']') { q.text date }
    q.text ','
    q.breakable
    q.group(2, '[author: ', ']') { q.text author }
    q.text ','
    q.breakable
    q.group(2, '[email: ', ']') { q.text email }
    q.text ','
    q.breakable
    q.pp contents
  end
end

#text

[ GitHub ]

  
# File 'lib/rdoc/parser/changelog.rb', line 302

def text
  case base
  when nil
    "#{date}"
  when /%s/
    "{#{date}}[#{base % commit}]"
  else
    "{#{date}}[#{base}#{commit}]"
  end + " {#{author}}[mailto:#{email}]"
end