Class: IPT::README::TextileFormatter
- Inherits:
-
AbstractFormatter
- Object
- AbstractFormatter
- IPT::README::TextileFormatter
- Defined in:
- lib/ipt/readme.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ TextileFormatter
constructor
A new instance of TextileFormatter.
- #to_html(input) ⇒ Object
Methods inherited from AbstractFormatter
Constructor Details
#initialize ⇒ TextileFormatter
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_formats ⇒ Object
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 |