Class: IPT::README::TextileFormatter

Inherits:
AbstractFormatter show all
Defined in:
lib/ipt/readme.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractFormatter

supports

Constructor Details

#initializeTextileFormatter

Returns a new instance of TextileFormatter.



46
47
48
49
50
51
52
53
# File 'lib/ipt/readme.rb', line 46

def initialize
  begin
    require 'RedCloth'
  rescue LoadError => e
    puts "The RedCloth gem is required if you want to create HTML Readme files."
    puts "Install using: sudo gem install RedCloth"
  end      
end

Class Method Details

.supported_formatsObject



42
43
44
# File 'lib/ipt/readme.rb', line 42

def self.supported_formats
  %w(text textile)
end

Instance Method Details

#to_html(input) ⇒ Object



55
56
57
# File 'lib/ipt/readme.rb', line 55

def to_html(input)
  RedCloth.new(input).to_html
end