Class: GitPissed::HTML

Inherits:
Format
  • Object
show all
Defined in:
lib/git_pissed/formats/html.rb

Instance Attribute Summary

Attributes inherited from Format

#options, #words_by_date

Instance Method Summary collapse

Methods inherited from Format

#file_path, #to_s

Instance Method Details

#csvObject



13
14
15
16
17
18
# File 'lib/git_pissed/formats/html.rb', line 13

def csv
  CSV.new(words_by_date, options).
    table.
    map { |r| "'#{r.strip}\\n'" }.
    join('+')
end

#formattedObject



7
8
9
10
11
# File 'lib/git_pissed/formats/html.rb', line 7

def formatted
  File.read(
    File.expand_path('../templates/index.html', __FILE__)
  ).gsub("%CSV%", csv)
end

#nameObject



3
4
5
# File 'lib/git_pissed/formats/html.rb', line 3

def name
  'HTML'
end