jadof 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/jadof/page.rb CHANGED
@@ -181,8 +181,10 @@ module JADOF #:nodoc:
181
181
  DEFAULT_DIR = './pages/'
182
182
 
183
183
  DEFAULT_FORMATTERS = {
184
- 'markdown' => lambda { |text| require 'maruku'; Maruku.new(text).to_html },
185
- 'erb' => lambda { |text| require 'erb'; ERB.new(text).result }
184
+ 'markdown' => lambda { |text| require 'maruku'; Maruku.new(text).to_html },
185
+ 'erb' => lambda { |text| require 'erb'; ERB.new(text).result },
186
+ 'haml' => lambda { |text| require 'haml'; Haml::Engine.new(text).render },
187
+ 'textile' => lambda { |text| require 'redcloth'; RedCloth.new(text).to_html }
186
188
  }
187
189
 
188
190
  # @return [String] A simple name for this {Page}.
@@ -308,6 +308,18 @@ shared_examples_for "JADOF Page" do
308
308
  @jadof_page_class[:foo].to_html.should == '<p><strong>Hello World!</strong></p>'
309
309
  end
310
310
 
311
+ it 'should have haml out of the box' do
312
+ create_page 'foo.haml', "#hola= 'Hello World'"
313
+ @jadof_page_class.formatters = @jadof_page_class::DEFAULT_FORMATTERS
314
+ @jadof_page_class[:foo].to_html.should == "<div id='hola'>Hello World</div>\n"
315
+ end
316
+
317
+ it 'should have textile out of the box' do
318
+ create_page 'foo.textile', 'h1. Hello World!'
319
+ @jadof_page_class.formatters = @jadof_page_class::DEFAULT_FORMATTERS
320
+ @jadof_page_class[:foo].to_html.should == '<h1>Hello World!</h1>'
321
+ end
322
+
311
323
  end
312
324
 
313
325
  describe ':: Caching' do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 4
9
- version: 0.1.4
8
+ - 5
9
+ version: 0.1.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - remi
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-02-28 00:00:00 -07:00
17
+ date: 2010-03-01 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency