tilt 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "http://rubygems.org"
2
+ gemspec
data/README.md CHANGED
@@ -21,35 +21,40 @@ template engines included in the distribution.
21
21
 
22
22
  Support for these template engines is included with the package:
23
23
 
24
- ENGINE FILE EXTENSIONS REQUIRED LIBRARIES
25
- -------------------------- ---------------------- ----------------------------
26
- ERB .erb, .rhtml none (included ruby stdlib)
27
- Interpolated String .str none (included ruby core)
28
- Erubis .erb, .rhtml, .erubis erubis
29
- Haml .haml haml
30
- Sass .sass haml (< 3.1) or sass (>= 3.1)
31
- Scss .scss haml (< 3.1) or sass (>= 3.1)
32
- Less CSS .less less
33
- Builder .builder builder
34
- Liquid .liquid liquid
35
- RDiscount .markdown, .mkd, .md rdiscount
36
- Redcarpet .markdown, .mkd, .md redcarpet
37
- BlueCloth .markdown, .mkd, .md bluecloth
38
- Kramdown .markdown, .mkd, .md kramdown
39
- Maruku .markdown, .mkd, .md maruku
40
- RedCloth .textile redcloth
41
- RDoc .rdoc rdoc
42
- Radius .radius radius
43
- Markaby .mab markaby
44
- Nokogiri .nokogiri nokogiri
45
- CoffeeScript .coffee coffee-script (+ javascript)
46
- Creole (Wiki markup) .creole creole
24
+ ENGINE FILE EXTENSIONS REQUIRED LIBRARIES
25
+ -------------------------- ----------------------- ----------------------------
26
+ ERB .erb, .rhtml none (included ruby stdlib)
27
+ Interpolated String .str none (included ruby core)
28
+ Erubis .erb, .rhtml, .erubis erubis
29
+ Haml .haml haml
30
+ Sass .sass haml (< 3.1) or sass (>= 3.1)
31
+ Scss .scss haml (< 3.1) or sass (>= 3.1)
32
+ Less CSS .less less
33
+ Builder .builder builder
34
+ Liquid .liquid liquid
35
+ RDiscount .markdown, .mkd, .md rdiscount
36
+ Redcarpet .markdown, .mkd, .md redcarpet
37
+ BlueCloth .markdown, .mkd, .md bluecloth
38
+ Kramdown .markdown, .mkd, .md kramdown
39
+ Maruku .markdown, .mkd, .md maruku
40
+ RedCloth .textile redcloth
41
+ RDoc .rdoc rdoc
42
+ Radius .radius radius
43
+ Markaby .mab markaby
44
+ Nokogiri .nokogiri nokogiri
45
+ CoffeeScript .coffee coffee-script (+ javascript)
46
+ Creole (Wiki markup) .wiki, .creole creole
47
+ WikiCloth (Wiki markup) .wiki, .mediawiki, .mw wikicloth
48
+ Yajl .yajl yajl-ruby
47
49
 
48
50
  These template engines ship with their own Tilt integration:
49
51
 
50
52
  ENGINE FILE EXTENSIONS REQUIRED LIBRARIES
51
53
  -------------------------- ----------------- ----------------------------
52
54
  Slim .slim slim (>= 0.7)
55
+ Embedded JavaScript sprockets
56
+ Embedded CoffeeScript sprockets
57
+ JST sprockets
53
58
 
54
59
  See [TEMPLATES.md][t] for detailed information on template engine
55
60
  options and supported features.
@@ -194,7 +199,7 @@ it on subsequent template invocations. Benchmarks show this yields a 5x-10x
194
199
  performance increase over evaluating the Ruby source on each invocation.
195
200
 
196
201
  Template compilation is currently supported for these template engines:
197
- StringTemplate, ERB, Erubis, Haml, Nokogiri and Builder.
202
+ StringTemplate, ERB, Erubis, Haml, Nokogiri, Builder and Yajl.
198
203
 
199
204
  LICENSE
200
205
  -------
@@ -1,5 +1,5 @@
1
1
  module Tilt
2
- VERSION = '1.3.2'
2
+ VERSION = '1.3.3'
3
3
 
4
4
  @preferred_mappings = Hash.new
5
5
  @template_mappings = Hash.new { |h, k| h[k] = [] }
@@ -172,8 +172,8 @@ module Tilt
172
172
  register MarukuTemplate, 'markdown', 'mkd', 'md'
173
173
  register KramdownTemplate, 'markdown', 'mkd', 'md'
174
174
  register BlueClothTemplate, 'markdown', 'mkd', 'md'
175
- register RedcarpetTemplate, 'markdown', 'mkd', 'md'
176
175
  register RDiscountTemplate, 'markdown', 'mkd', 'md'
176
+ register RedcarpetTemplate, 'markdown', 'mkd', 'md'
177
177
 
178
178
  require 'tilt/textile'
179
179
  register RedClothTemplate, 'textile'
@@ -181,6 +181,10 @@ module Tilt
181
181
  require 'tilt/rdoc'
182
182
  register RDocTemplate, 'rdoc'
183
183
 
184
- require 'tilt/creole'
185
- register CreoleTemplate, 'creole'
184
+ require 'tilt/wiki'
185
+ register CreoleTemplate, 'wiki', 'creole'
186
+ register WikiClothTemplate, 'wiki', 'mediawiki', 'mw'
187
+
188
+ require 'tilt/yajl'
189
+ register YajlTemplate, 'yajl'
186
190
  end
@@ -48,7 +48,7 @@ module Tilt
48
48
  self.default_mime_type = 'text/css'
49
49
 
50
50
  def self.engine_initialized?
51
- defined? ::Less::Engine
51
+ defined? ::Less
52
52
  end
53
53
 
54
54
  def initialize_engine
@@ -56,11 +56,16 @@ module Tilt
56
56
  end
57
57
 
58
58
  def prepare
59
- @engine = ::Less::Engine.new(data)
59
+ if ::Less.const_defined? :Engine
60
+ @engine = ::Less::Engine.new(data)
61
+ else
62
+ parser = ::Less::Parser.new(:filename => eval_file, :line => line)
63
+ @engine = parser.parse(data)
64
+ end
60
65
  end
61
66
 
62
67
  def evaluate(scope, locals, &block)
63
- @engine.to_css
68
+ @output ||= @engine.to_css
64
69
  end
65
70
  end
66
71
  end
@@ -42,12 +42,10 @@ module Tilt
42
42
  # Upskirt Markdown implementation. See:
43
43
  # https://github.com/tanoku/redcarpet
44
44
  #
45
- # Compatible to RDiscount
46
- class RedcarpetTemplate < RDiscountTemplate
47
- self.default_mime_type = 'text/html'
48
-
45
+ # Supports both Redcarpet 1.x and 2.x
46
+ class RedcarpetTemplate < Template
49
47
  def self.engine_initialized?
50
- defined? ::RedcarpetCompat
48
+ defined? ::Redcarpet
51
49
  end
52
50
 
53
51
  def initialize_engine
@@ -55,8 +53,69 @@ module Tilt
55
53
  end
56
54
 
57
55
  def prepare
58
- @engine = RedcarpetCompat.new(data, *flags)
59
- @output = nil
56
+ klass = [Redcarpet1, Redcarpet2].detect { |e| e.engine_initialized? }
57
+ @engine = klass.new(file, line, options) { data }
58
+ end
59
+
60
+ def evaluate(scope, locals, &block)
61
+ @engine.evaluate(scope, locals, &block)
62
+ end
63
+
64
+ # Compatibility mode for Redcarpet 1.x
65
+ class Redcarpet1 < RDiscountTemplate
66
+ self.default_mime_type = 'text/html'
67
+
68
+ def self.engine_initialized?
69
+ defined? ::RedcarpetCompat
70
+ end
71
+
72
+ def prepare
73
+ @engine = RedcarpetCompat.new(data, *flags)
74
+ @output = nil
75
+ end
76
+ end
77
+
78
+ # Future proof mode for Redcarpet 2.x (not yet released)
79
+ class Redcarpet2 < Template
80
+ self.default_mime_type = 'text/html'
81
+
82
+ def self.engine_initialized?
83
+ defined? ::Redcarpet::Render
84
+ end
85
+
86
+ def generate_renderer
87
+ renderer = options.delete(:renderer) || Redcarpet::Render::HTML
88
+ return renderer unless options.delete(:smartypants)
89
+ return renderer if renderer <= Redcarpet::Render::SmartyPants
90
+
91
+ if renderer == Redcarpet::Render::XHTML
92
+ Redcarpet::Render::SmartyHTML.new(:xhtml => true)
93
+ elsif renderer == Redcarpet::Render::HTML
94
+ Redcarpet::Render::SmartyHTML
95
+ elsif renderer.is_a? Class
96
+ Class.new(renderer) { include Redcarpet::Render::SmartyPants }
97
+ else
98
+ renderer.extend Redcarpet::Render::SmartyPants
99
+ end
100
+ end
101
+
102
+ def prepare
103
+ # try to support the same aliases
104
+ RDiscountTemplate::ALIAS.each do |opt, aka|
105
+ next if options.key? opt or not options.key? aka
106
+ options[opt] = options.delete(aka)
107
+ end
108
+
109
+ # only raise an exception if someone is trying to enable :escape_html
110
+ options.delete(:escape_html) unless options[:escape_html]
111
+
112
+ @engine = Redcarpet::Markdown.new(generate_renderer, options)
113
+ @output = nil
114
+ end
115
+
116
+ def evaluate(scope, locals, &block)
117
+ @output ||= @engine.render(data)
118
+ end
60
119
  end
61
120
  end
62
121
 
@@ -25,4 +25,26 @@ module Tilt
25
25
  @output ||= @engine.to_html
26
26
  end
27
27
  end
28
+
29
+ # WikiCloth implementation. See:
30
+ # http://redcloth.org/
31
+ class WikiClothTemplate < Template
32
+ def self.engine_initialized?
33
+ defined? ::WikiCloth::Parser
34
+ end
35
+
36
+ def initialize_engine
37
+ require_template_library 'wikicloth'
38
+ end
39
+
40
+ def prepare
41
+ @parser = options.delete(:parser) || WikiCloth::Parser
42
+ @engine = @parser.new options.merge(:data => data)
43
+ @output = nil
44
+ end
45
+
46
+ def evaluate(scope, locals, &block)
47
+ @output ||= @engine.to_html
48
+ end
49
+ end
28
50
  end
@@ -0,0 +1,94 @@
1
+ require 'tilt/template'
2
+
3
+ module Tilt
4
+
5
+ # Yajl Template implementation
6
+ #
7
+ # Yajl is a fast JSON parsing and encoding library for Ruby
8
+ # See https://github.com/brianmario/yajl-ruby
9
+ #
10
+ # The template source is evaluated as a Ruby string,
11
+ # and the result is converted #to_json.
12
+ #
13
+ # == Example
14
+ #
15
+ # # This is a template example.
16
+ # # The template can contain any Ruby statement.
17
+ # tpl <<-EOS
18
+ # @counter = 0
19
+ #
20
+ # # The json variable represents the buffer
21
+ # # and holds the data to be serialized into json.
22
+ # # It defaults to an empty hash, but you can override it at any time.
23
+ # json = {
24
+ # :"user#{@counter += 1}" => { :name => "Joshua Peek", :id => @counter },
25
+ # :"user#{@counter += 1}" => { :name => "Ryan Tomayko", :id => @counter },
26
+ # :"user#{@counter += 1}" => { :name => "Simone Carletti", :id => @counter },
27
+ # }
28
+ #
29
+ # # Since the json variable is a Hash,
30
+ # # you can use conditional statements or any other Ruby statement
31
+ # # to populate it.
32
+ # json[:"user#{@counter += 1}"] = { :name => "Unknown" } if 1 == 2
33
+ #
34
+ # # The last line doesn't affect the returned value.
35
+ # nil
36
+ # EOS
37
+ #
38
+ # template = Tilt::YajlTemplate.new { tpl }
39
+ # template.render(self)
40
+ #
41
+ class YajlTemplate < Template
42
+
43
+ self.default_mime_type = 'application/json'
44
+
45
+ def self.engine_initialized?
46
+ defined? ::Yajl
47
+ end
48
+
49
+ def initialize_engine
50
+ require_template_library 'yajl'
51
+ end
52
+
53
+ def prepare
54
+ end
55
+
56
+ def evaluate(scope, locals, &block)
57
+ decorate super(scope, locals, &block)
58
+ end
59
+
60
+ def precompiled_preamble(locals)
61
+ return super if locals.include? :json
62
+ "json = {}\n#{super}"
63
+ end
64
+
65
+ def precompiled_postamble(locals)
66
+ "Yajl::Encoder.new.encode(json)"
67
+ end
68
+
69
+ def precompiled_template(locals)
70
+ data.to_str
71
+ end
72
+
73
+
74
+ # Decorates the +json+ input according to given +options+.
75
+ #
76
+ # json - The json String to decorate.
77
+ # options - The option Hash to customize the behavior.
78
+ #
79
+ # Returns the decorated String.
80
+ def decorate(json)
81
+ callback, variable = options[:callback], options[:variable]
82
+ if callback && variable
83
+ "var #{variable} = #{json}; #{callback}(#{variable});"
84
+ elsif variable
85
+ "var #{variable} = #{json};"
86
+ elsif callback
87
+ "#{callback}(#{json});"
88
+ else
89
+ json
90
+ end
91
+ end
92
+ end
93
+
94
+ end
@@ -39,7 +39,7 @@ class CompileSiteTest < Test::Unit::TestCase
39
39
  locals = { "local#{i}" => 'value' }
40
40
  res = template.render(self, locals)
41
41
  thread_id = Thread.current.object_id
42
- res = template.render(self, "local#{thread_id.to_s}" => 'value')
42
+ res = template.render(self, "local#{thread_id.abs.to_s}" => 'value')
43
43
  rescue => boom
44
44
  main_thread.raise(boom)
45
45
  end
@@ -9,6 +9,10 @@ begin
9
9
  assert_equal Tilt::CreoleTemplate, Tilt['test.creole']
10
10
  end
11
11
 
12
+ test "registered for '.wiki' files" do
13
+ assert Tilt.mappings['wiki'].include?(Tilt::CreoleTemplate)
14
+ end
15
+
12
16
  test "compiles and evaluates the template on #render" do
13
17
  template = Tilt::CreoleTemplate.new { |t| "= Hello World!" }
14
18
  assert_equal "<h1>Hello World!</h1>", template.render
@@ -2,6 +2,7 @@ require 'contest'
2
2
  require 'tilt'
3
3
 
4
4
  begin
5
+ require 'pathname'
5
6
  require 'less'
6
7
 
7
8
  class LessTemplateTest < Test::Unit::TestCase
@@ -11,12 +12,12 @@ begin
11
12
 
12
13
  test "compiles and evaluates the template on #render" do
13
14
  template = Tilt::LessTemplate.new { |t| ".bg { background-color: #0000ff; } \n#main\n { .bg; }\n" }
14
- assert_equal ".bg, #main { background-color: #0000ff; }\n", template.render
15
+ assert_equal ".bg {\n background-color: #0000ff;\n}\n#main {\n background-color: #0000ff;\n}\n", template.render
15
16
  end
16
17
 
17
18
  test "can be rendered more than once" do
18
19
  template = Tilt::LessTemplate.new { |t| ".bg { background-color: #0000ff; } \n#main\n { .bg; }\n" }
19
- 3.times { assert_equal ".bg, #main { background-color: #0000ff; }\n", template.render }
20
+ 3.times { assert_equal ".bg {\n background-color: #0000ff;\n}\n#main {\n background-color: #0000ff;\n}\n", template.render }
20
21
  end
21
22
  end
22
23
 
@@ -1,5 +1,7 @@
1
1
  # coding: UTF-8
2
2
  require 'tilt'
3
+
4
+ begin
3
5
  require 'nokogiri'
4
6
 
5
7
  module MarkdownTests
@@ -91,6 +93,13 @@ begin
91
93
  class MarkdownRedcarpetTest < Test::Unit::TestCase
92
94
  include MarkdownTests
93
95
  template Tilt::RedcarpetTemplate
96
+ # Doesn't support escaping
97
+ undef test_escape_html_true
98
+
99
+ def test_smarty_pants_true
100
+ html = nrender "Hello ``World'' -- This is --- a test ...", :smartypants => true
101
+ assert_equal "<p>Hello “World” – This is — a test …</p>", html
102
+ end
94
103
  end
95
104
  rescue LoadError => boom
96
105
  # It should already be warned in the main tests
@@ -145,4 +154,8 @@ rescue LoadError => boom
145
154
  # It should already be warned in the main tests
146
155
  end
147
156
 
157
+ rescue LoadError
158
+ warn "Markdown tests need Nokogiri\n"
159
+ end
160
+
148
161
 
@@ -2,11 +2,11 @@ require 'contest'
2
2
  require 'tilt'
3
3
 
4
4
  begin
5
+ require 'radius'
6
+
5
7
  # Disable radius tests under Ruby versions >= 1.9.1 since it's still buggy.
6
8
  # Remove when fixed upstream.
7
- raise LoadError if RUBY_VERSION >= "1.9.1"
8
-
9
- require 'radius'
9
+ raise LoadError if RUBY_VERSION >= "1.9.1" and Radius.version < "0.7"
10
10
 
11
11
  class RadiusTemplateTest < Test::Unit::TestCase
12
12
  test "registered for '.radius' files" do
@@ -21,9 +21,19 @@ begin
21
21
  %w[md mkd markdown].each do |ext|
22
22
  mappings = Tilt.mappings[ext]
23
23
  blue_idx = mappings.index(Tilt::BlueClothTemplate)
24
- rdis_idx = mappings.index(Tilt::RedcarpetTemplate)
25
- assert rdis_idx < blue_idx,
26
- "#{rdis_idx} should be lower than #{blue_idx}"
24
+ redc_idx = mappings.index(Tilt::RedcarpetTemplate)
25
+ assert redc_idx < blue_idx,
26
+ "#{redc_idx} should be lower than #{blue_idx}"
27
+ end
28
+ end
29
+
30
+ test "registered above RDiscount" do
31
+ %w[md mkd markdown].each do |ext|
32
+ mappings = Tilt.mappings[ext]
33
+ rdis_idx = mappings.index(Tilt::RDiscountTemplate)
34
+ redc_idx = mappings.index(Tilt::RedcarpetTemplate)
35
+ assert redc_idx < rdis_idx,
36
+ "#{redc_idx} should be lower than #{rdis_idx}"
27
37
  end
28
38
  end
29
39
 
@@ -40,15 +50,9 @@ begin
40
50
  test "smartypants when :smart is set" do
41
51
  template = Tilt::RedcarpetTemplate.new(:smart => true) { |t|
42
52
  "OKAY -- 'Smarty Pants'" }
43
- assert_equal "<p>OKAY &mdash; &lsquo;Smarty Pants&rsquo;</p>\n",
53
+ assert_match /<p>OKAY &[nm]dash; &lsquo;Smarty Pants&rsquo;<\/p>/,
44
54
  template.render
45
55
  end
46
-
47
- test "stripping HTML when :filter_html is set" do
48
- template = Tilt::RedcarpetTemplate.new(:filter_html => true) { |t|
49
- "HELLO <blink>WORLD</blink>" }
50
- assert_equal "<p>HELLO WORLD</p>\n", template.render
51
- end
52
56
  end
53
57
  rescue LoadError => boom
54
58
  warn "Tilt::RedcarpetTemplate (disabled)\n"
@@ -0,0 +1,32 @@
1
+ require 'contest'
2
+ require 'tilt'
3
+
4
+ begin
5
+ require 'wikicloth'
6
+
7
+ class WikiClothTemplateTest < Test::Unit::TestCase
8
+ test "is registered for '.mediawiki' files" do
9
+ assert_equal Tilt::WikiClothTemplate, Tilt['test.mediawiki']
10
+ end
11
+
12
+ test "is registered for '.mw' files" do
13
+ assert_equal Tilt::WikiClothTemplate, Tilt['test.mw']
14
+ end
15
+
16
+ test "is registered for '.wiki' files" do
17
+ assert_equal Tilt::WikiClothTemplate, Tilt['test.wiki']
18
+ end
19
+
20
+ test "compiles and evaluates the template on #render" do
21
+ template = Tilt::WikiClothTemplate.new { |t| "= Hello World! =" }
22
+ assert_match /<h1>.*Hello World!.*<\/h1>/, template.render
23
+ end
24
+
25
+ test "can be rendered more than once" do
26
+ template = Tilt::WikiClothTemplate.new { |t| "= Hello World! =" }
27
+ 3.times { assert_match /<h1>.*Hello World!.*<\/h1>/, template.render }
28
+ end
29
+ end
30
+ rescue LoadError => boom
31
+ warn "Tilt::WikiClothTemplate (disabled)\n"
32
+ end
@@ -0,0 +1,92 @@
1
+ require 'contest'
2
+ require 'tilt'
3
+
4
+ begin
5
+ require 'yajl'
6
+
7
+ class YajlTemplateTest < Test::Unit::TestCase
8
+ test "is registered for '.yajl' files" do
9
+ assert_equal Tilt::YajlTemplate, Tilt['test.yajl']
10
+ end
11
+
12
+ test "compiles and evaluates the template on #render" do
13
+ template = Tilt::YajlTemplate.new { "json = { :integer => 3, :string => 'hello' }" }
14
+ assert_equal '{"integer":3,"string":"hello"}', template.render
15
+ end
16
+
17
+ test "can be rendered more than once" do
18
+ template = Tilt::YajlTemplate.new { "json = { :integer => 3, :string => 'hello' }" }
19
+ 3.times { assert_equal '{"integer":3,"string":"hello"}', template.render }
20
+ end
21
+
22
+ test "evaluating ruby code" do
23
+ template = Tilt::YajlTemplate.new { "json = { :integer => (3 * 2) }" }
24
+ assert_equal '{"integer":6}', template.render
25
+ end
26
+
27
+ test "evaluating in an object scope" do
28
+ template = Tilt::YajlTemplate.new { "json = { :string => 'Hey ' + @name + '!' }" }
29
+ scope = Object.new
30
+ scope.instance_variable_set :@name, 'Joe'
31
+ assert_equal '{"string":"Hey Joe!"}', template.render(scope)
32
+ end
33
+
34
+ test "passing locals" do
35
+ template = Tilt::YajlTemplate.new { "json = { :string => 'Hey ' + name + '!' }" }
36
+ assert_equal '{"string":"Hey Joe!"}', template.render(Object.new, :name => 'Joe')
37
+ end
38
+
39
+ test "passing a block for yield" do
40
+ template = Tilt::YajlTemplate.new { "json = { :string => 'Hey ' + yield + '!' }" }
41
+ assert_equal '{"string":"Hey Joe!"}', template.render { 'Joe' }
42
+ assert_equal '{"string":"Hey Moe!"}', template.render { 'Moe' }
43
+ end
44
+
45
+ test "template multiline" do
46
+ template = Tilt::YajlTemplate.new { %Q{
47
+ json = {
48
+ :string => "hello"
49
+ }
50
+ } }
51
+ assert_equal '{"string":"hello"}', template.render
52
+ end
53
+
54
+ test "template can reuse existing json buffer" do
55
+ template = Tilt::YajlTemplate.new { "json.merge! :string => 'hello'" }
56
+ assert_equal '{"string":"hello"}', template.render
57
+ end
58
+
59
+ test "template can end with any statement" do
60
+ template = Tilt::YajlTemplate.new { %Q{
61
+ json = {
62
+ :string => "hello"
63
+ }
64
+ four = 2 * 2
65
+ json[:integer] = four
66
+ nil
67
+ } }
68
+ assert_equal '{"string":"hello","integer":4}', template.render
69
+ end
70
+
71
+ test "option callback" do
72
+ options = { :callback => 'foo' }
73
+ template = Tilt::YajlTemplate.new(nil, options) { "json = { :string => 'hello' }" }
74
+ assert_equal 'foo({"string":"hello"});', template.render
75
+ end
76
+
77
+ test "option variable" do
78
+ options = { :variable => 'output' }
79
+ template = Tilt::YajlTemplate.new(nil, options) { "json = { :string => 'hello' }" }
80
+ assert_equal 'var output = {"string":"hello"};', template.render
81
+ end
82
+
83
+ test "option callback and variable" do
84
+ options = { :callback => 'foo', :variable => 'output' }
85
+ template = Tilt::YajlTemplate.new(nil, options) { "json = { :string => 'hello' }" }
86
+ assert_equal 'var output = {"string":"hello"}; foo(output);', template.render
87
+ end
88
+
89
+ end
90
+ rescue LoadError
91
+ warn "Tilt::YajlTemplateTest (disabled)\n"
92
+ end
@@ -3,8 +3,8 @@ Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = 'tilt'
6
- s.version = '1.3.2'
7
- s.date = '2011-05-26'
6
+ s.version = '1.3.3'
7
+ s.date = '2011-08-25'
8
8
 
9
9
  s.description = "Generic interface to multiple Ruby template engines"
10
10
  s.summary = s.description
@@ -15,6 +15,7 @@ Gem::Specification.new do |s|
15
15
  # = MANIFEST =
16
16
  s.files = %w[
17
17
  COPYING
18
+ Gemfile
18
19
  README.md
19
20
  Rakefile
20
21
  TEMPLATES.md
@@ -22,7 +23,6 @@ Gem::Specification.new do |s|
22
23
  lib/tilt.rb
23
24
  lib/tilt/builder.rb
24
25
  lib/tilt/coffee.rb
25
- lib/tilt/creole.rb
26
26
  lib/tilt/css.rb
27
27
  lib/tilt/erb.rb
28
28
  lib/tilt/haml.rb
@@ -35,6 +35,8 @@ Gem::Specification.new do |s|
35
35
  lib/tilt/string.rb
36
36
  lib/tilt/template.rb
37
37
  lib/tilt/textile.rb
38
+ lib/tilt/wiki.rb
39
+ lib/tilt/yajl.rb
38
40
  test/contest.rb
39
41
  test/markaby/locals.mab
40
42
  test/markaby/markaby.mab
@@ -68,6 +70,8 @@ Gem::Specification.new do |s|
68
70
  test/tilt_stringtemplate_test.rb
69
71
  test/tilt_template_test.rb
70
72
  test/tilt_test.rb
73
+ test/tilt_wikiclothtemplate_test.rb
74
+ test/tilt_yajltemplate_test.rb
71
75
  tilt.gemspec
72
76
  ]
73
77
  # = MANIFEST =
@@ -78,6 +82,7 @@ Gem::Specification.new do |s|
78
82
  s.add_development_dependency 'builder'
79
83
  s.add_development_dependency 'erubis'
80
84
  s.add_development_dependency 'haml', '>= 2.2.11'
85
+ s.add_development_dependency 'sass'
81
86
  s.add_development_dependency 'rdiscount'
82
87
  s.add_development_dependency 'liquid'
83
88
  s.add_development_dependency 'less'
@@ -91,10 +96,14 @@ Gem::Specification.new do |s|
91
96
  s.add_development_dependency 'creole'
92
97
  s.add_development_dependency 'kramdown'
93
98
  s.add_development_dependency 'redcarpet'
99
+ s.add_development_dependency 'creole'
100
+ s.add_development_dependency 'yajl-ruby'
101
+ s.add_development_dependency 'wikicloth'
102
+ s.add_development_dependency 'redcarpet'
103
+ s.add_development_dependency 'kramdown'
94
104
 
95
105
  s.homepage = "http://github.com/rtomayko/tilt/"
96
106
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Tilt", "--main", "Tilt"]
97
107
  s.require_paths = %w[lib]
98
- s.rubyforge_project = 'wink'
99
108
  s.rubygems_version = '1.1.1'
100
109
  end
metadata CHANGED
@@ -1,273 +1,278 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: tilt
3
- version: !ruby/object:Gem::Version
4
- hash: 31
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 3
9
- - 2
10
- version: 1.3.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.3
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Ryan Tomayko
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-05-26 00:00:00 -07:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2011-08-25 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: contest
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70292614853000 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
33
22
  type: :development
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: builder
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70292614853000
25
+ - !ruby/object:Gem::Dependency
26
+ name: builder
27
+ requirement: &70292614852540 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
47
33
  type: :development
48
- version_requirements: *id002
49
- - !ruby/object:Gem::Dependency
50
- name: erubis
51
34
  prerelease: false
52
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70292614852540
36
+ - !ruby/object:Gem::Dependency
37
+ name: erubis
38
+ requirement: &70292614852120 !ruby/object:Gem::Requirement
53
39
  none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- hash: 3
58
- segments:
59
- - 0
60
- version: "0"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
61
44
  type: :development
62
- version_requirements: *id003
63
- - !ruby/object:Gem::Dependency
64
- name: haml
65
45
  prerelease: false
66
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70292614852120
47
+ - !ruby/object:Gem::Dependency
48
+ name: haml
49
+ requirement: &70292614868000 !ruby/object:Gem::Requirement
67
50
  none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- hash: 17
72
- segments:
73
- - 2
74
- - 2
75
- - 11
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
76
54
  version: 2.2.11
77
55
  type: :development
78
- version_requirements: *id004
79
- - !ruby/object:Gem::Dependency
80
- name: rdiscount
81
56
  prerelease: false
82
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *70292614868000
58
+ - !ruby/object:Gem::Dependency
59
+ name: sass
60
+ requirement: &70292614867580 !ruby/object:Gem::Requirement
83
61
  none: false
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- hash: 3
88
- segments:
89
- - 0
90
- version: "0"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
91
66
  type: :development
92
- version_requirements: *id005
93
- - !ruby/object:Gem::Dependency
94
- name: liquid
95
67
  prerelease: false
96
- requirement: &id006 !ruby/object:Gem::Requirement
68
+ version_requirements: *70292614867580
69
+ - !ruby/object:Gem::Dependency
70
+ name: rdiscount
71
+ requirement: &70292614867120 !ruby/object:Gem::Requirement
97
72
  none: false
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- hash: 3
102
- segments:
103
- - 0
104
- version: "0"
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
105
77
  type: :development
106
- version_requirements: *id006
107
- - !ruby/object:Gem::Dependency
108
- name: less
109
78
  prerelease: false
110
- requirement: &id007 !ruby/object:Gem::Requirement
79
+ version_requirements: *70292614867120
80
+ - !ruby/object:Gem::Dependency
81
+ name: liquid
82
+ requirement: &70292614866700 !ruby/object:Gem::Requirement
111
83
  none: false
112
- requirements:
113
- - - ">="
114
- - !ruby/object:Gem::Version
115
- hash: 3
116
- segments:
117
- - 0
118
- version: "0"
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
119
88
  type: :development
120
- version_requirements: *id007
121
- - !ruby/object:Gem::Dependency
122
- name: radius
123
89
  prerelease: false
124
- requirement: &id008 !ruby/object:Gem::Requirement
90
+ version_requirements: *70292614866700
91
+ - !ruby/object:Gem::Dependency
92
+ name: less
93
+ requirement: &70292614866280 !ruby/object:Gem::Requirement
125
94
  none: false
126
- requirements:
127
- - - ">="
128
- - !ruby/object:Gem::Version
129
- hash: 3
130
- segments:
131
- - 0
132
- version: "0"
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
133
99
  type: :development
134
- version_requirements: *id008
135
- - !ruby/object:Gem::Dependency
136
- name: nokogiri
137
100
  prerelease: false
138
- requirement: &id009 !ruby/object:Gem::Requirement
101
+ version_requirements: *70292614866280
102
+ - !ruby/object:Gem::Dependency
103
+ name: radius
104
+ requirement: &70292614865860 !ruby/object:Gem::Requirement
139
105
  none: false
140
- requirements:
141
- - - ">="
142
- - !ruby/object:Gem::Version
143
- hash: 3
144
- segments:
145
- - 0
146
- version: "0"
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
147
110
  type: :development
148
- version_requirements: *id009
149
- - !ruby/object:Gem::Dependency
150
- name: markaby
151
111
  prerelease: false
152
- requirement: &id010 !ruby/object:Gem::Requirement
112
+ version_requirements: *70292614865860
113
+ - !ruby/object:Gem::Dependency
114
+ name: nokogiri
115
+ requirement: &70292614865440 !ruby/object:Gem::Requirement
153
116
  none: false
154
- requirements:
155
- - - ">="
156
- - !ruby/object:Gem::Version
157
- hash: 3
158
- segments:
159
- - 0
160
- version: "0"
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
161
121
  type: :development
162
- version_requirements: *id010
163
- - !ruby/object:Gem::Dependency
164
- name: coffee-script
165
122
  prerelease: false
166
- requirement: &id011 !ruby/object:Gem::Requirement
123
+ version_requirements: *70292614865440
124
+ - !ruby/object:Gem::Dependency
125
+ name: markaby
126
+ requirement: &70292614865020 !ruby/object:Gem::Requirement
167
127
  none: false
168
- requirements:
169
- - - ">="
170
- - !ruby/object:Gem::Version
171
- hash: 3
172
- segments:
173
- - 0
174
- version: "0"
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
175
132
  type: :development
176
- version_requirements: *id011
177
- - !ruby/object:Gem::Dependency
178
- name: bluecloth
179
133
  prerelease: false
180
- requirement: &id012 !ruby/object:Gem::Requirement
134
+ version_requirements: *70292614865020
135
+ - !ruby/object:Gem::Dependency
136
+ name: coffee-script
137
+ requirement: &70292614864600 !ruby/object:Gem::Requirement
181
138
  none: false
182
- requirements:
183
- - - ">="
184
- - !ruby/object:Gem::Version
185
- hash: 3
186
- segments:
187
- - 0
188
- version: "0"
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ type: :development
144
+ prerelease: false
145
+ version_requirements: *70292614864600
146
+ - !ruby/object:Gem::Dependency
147
+ name: bluecloth
148
+ requirement: &70292614864180 !ruby/object:Gem::Requirement
149
+ none: false
150
+ requirements:
151
+ - - ! '>='
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
189
154
  type: :development
190
- version_requirements: *id012
191
- - !ruby/object:Gem::Dependency
192
- name: RedCloth
193
155
  prerelease: false
194
- requirement: &id013 !ruby/object:Gem::Requirement
156
+ version_requirements: *70292614864180
157
+ - !ruby/object:Gem::Dependency
158
+ name: RedCloth
159
+ requirement: &70292614863760 !ruby/object:Gem::Requirement
195
160
  none: false
196
- requirements:
197
- - - ">="
198
- - !ruby/object:Gem::Version
199
- hash: 3
200
- segments:
201
- - 0
202
- version: "0"
161
+ requirements:
162
+ - - ! '>='
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
203
165
  type: :development
204
- version_requirements: *id013
205
- - !ruby/object:Gem::Dependency
166
+ prerelease: false
167
+ version_requirements: *70292614863760
168
+ - !ruby/object:Gem::Dependency
206
169
  name: maruku
170
+ requirement: &70292614863340 !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - ! '>='
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ type: :development
207
177
  prerelease: false
208
- requirement: &id014 !ruby/object:Gem::Requirement
178
+ version_requirements: *70292614863340
179
+ - !ruby/object:Gem::Dependency
180
+ name: creole
181
+ requirement: &70292614862920 !ruby/object:Gem::Requirement
182
+ none: false
183
+ requirements:
184
+ - - ! '>='
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ type: :development
188
+ prerelease: false
189
+ version_requirements: *70292614862920
190
+ - !ruby/object:Gem::Dependency
191
+ name: kramdown
192
+ requirement: &70292614862500 !ruby/object:Gem::Requirement
209
193
  none: false
210
- requirements:
211
- - - ">="
212
- - !ruby/object:Gem::Version
213
- hash: 3
214
- segments:
215
- - 0
216
- version: "0"
194
+ requirements:
195
+ - - ! '>='
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
217
198
  type: :development
218
- version_requirements: *id014
219
- - !ruby/object:Gem::Dependency
199
+ prerelease: false
200
+ version_requirements: *70292614862500
201
+ - !ruby/object:Gem::Dependency
202
+ name: redcarpet
203
+ requirement: &70292614862080 !ruby/object:Gem::Requirement
204
+ none: false
205
+ requirements:
206
+ - - ! '>='
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ type: :development
210
+ prerelease: false
211
+ version_requirements: *70292614862080
212
+ - !ruby/object:Gem::Dependency
220
213
  name: creole
214
+ requirement: &70292614861660 !ruby/object:Gem::Requirement
215
+ none: false
216
+ requirements:
217
+ - - ! '>='
218
+ - !ruby/object:Gem::Version
219
+ version: '0'
220
+ type: :development
221
221
  prerelease: false
222
- requirement: &id015 !ruby/object:Gem::Requirement
222
+ version_requirements: *70292614861660
223
+ - !ruby/object:Gem::Dependency
224
+ name: yajl-ruby
225
+ requirement: &70292614861240 !ruby/object:Gem::Requirement
223
226
  none: false
224
- requirements:
225
- - - ">="
226
- - !ruby/object:Gem::Version
227
- hash: 3
228
- segments:
229
- - 0
230
- version: "0"
227
+ requirements:
228
+ - - ! '>='
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
231
231
  type: :development
232
- version_requirements: *id015
233
- - !ruby/object:Gem::Dependency
234
- name: kramdown
235
232
  prerelease: false
236
- requirement: &id016 !ruby/object:Gem::Requirement
233
+ version_requirements: *70292614861240
234
+ - !ruby/object:Gem::Dependency
235
+ name: wikicloth
236
+ requirement: &70292614860820 !ruby/object:Gem::Requirement
237
237
  none: false
238
- requirements:
239
- - - ">="
240
- - !ruby/object:Gem::Version
241
- hash: 3
242
- segments:
243
- - 0
244
- version: "0"
238
+ requirements:
239
+ - - ! '>='
240
+ - !ruby/object:Gem::Version
241
+ version: '0'
245
242
  type: :development
246
- version_requirements: *id016
247
- - !ruby/object:Gem::Dependency
243
+ prerelease: false
244
+ version_requirements: *70292614860820
245
+ - !ruby/object:Gem::Dependency
248
246
  name: redcarpet
247
+ requirement: &70292614860400 !ruby/object:Gem::Requirement
248
+ none: false
249
+ requirements:
250
+ - - ! '>='
251
+ - !ruby/object:Gem::Version
252
+ version: '0'
253
+ type: :development
249
254
  prerelease: false
250
- requirement: &id017 !ruby/object:Gem::Requirement
255
+ version_requirements: *70292614860400
256
+ - !ruby/object:Gem::Dependency
257
+ name: kramdown
258
+ requirement: &70292614876340 !ruby/object:Gem::Requirement
251
259
  none: false
252
- requirements:
253
- - - ">="
254
- - !ruby/object:Gem::Version
255
- hash: 3
256
- segments:
257
- - 0
258
- version: "0"
260
+ requirements:
261
+ - - ! '>='
262
+ - !ruby/object:Gem::Version
263
+ version: '0'
259
264
  type: :development
260
- version_requirements: *id017
265
+ prerelease: false
266
+ version_requirements: *70292614876340
261
267
  description: Generic interface to multiple Ruby template engines
262
268
  email: r@tomayko.com
263
- executables:
269
+ executables:
264
270
  - tilt
265
271
  extensions: []
266
-
267
272
  extra_rdoc_files: []
268
-
269
- files:
273
+ files:
270
274
  - COPYING
275
+ - Gemfile
271
276
  - README.md
272
277
  - Rakefile
273
278
  - TEMPLATES.md
@@ -275,7 +280,6 @@ files:
275
280
  - lib/tilt.rb
276
281
  - lib/tilt/builder.rb
277
282
  - lib/tilt/coffee.rb
278
- - lib/tilt/creole.rb
279
283
  - lib/tilt/css.rb
280
284
  - lib/tilt/erb.rb
281
285
  - lib/tilt/haml.rb
@@ -288,6 +292,8 @@ files:
288
292
  - lib/tilt/string.rb
289
293
  - lib/tilt/template.rb
290
294
  - lib/tilt/textile.rb
295
+ - lib/tilt/wiki.rb
296
+ - lib/tilt/yajl.rb
291
297
  - test/contest.rb
292
298
  - test/markaby/locals.mab
293
299
  - test/markaby/markaby.mab
@@ -321,47 +327,40 @@ files:
321
327
  - test/tilt_stringtemplate_test.rb
322
328
  - test/tilt_template_test.rb
323
329
  - test/tilt_test.rb
330
+ - test/tilt_wikiclothtemplate_test.rb
331
+ - test/tilt_yajltemplate_test.rb
324
332
  - tilt.gemspec
325
- has_rdoc: true
326
333
  homepage: http://github.com/rtomayko/tilt/
327
334
  licenses: []
328
-
329
335
  post_install_message:
330
- rdoc_options:
336
+ rdoc_options:
331
337
  - --line-numbers
332
338
  - --inline-source
333
339
  - --title
334
340
  - Tilt
335
341
  - --main
336
342
  - Tilt
337
- require_paths:
343
+ require_paths:
338
344
  - lib
339
- required_ruby_version: !ruby/object:Gem::Requirement
345
+ required_ruby_version: !ruby/object:Gem::Requirement
340
346
  none: false
341
- requirements:
342
- - - ">="
343
- - !ruby/object:Gem::Version
344
- hash: 3
345
- segments:
346
- - 0
347
- version: "0"
348
- required_rubygems_version: !ruby/object:Gem::Requirement
347
+ requirements:
348
+ - - ! '>='
349
+ - !ruby/object:Gem::Version
350
+ version: '0'
351
+ required_rubygems_version: !ruby/object:Gem::Requirement
349
352
  none: false
350
- requirements:
351
- - - ">="
352
- - !ruby/object:Gem::Version
353
- hash: 3
354
- segments:
355
- - 0
356
- version: "0"
353
+ requirements:
354
+ - - ! '>='
355
+ - !ruby/object:Gem::Version
356
+ version: '0'
357
357
  requirements: []
358
-
359
- rubyforge_project: wink
360
- rubygems_version: 1.3.7
358
+ rubyforge_project:
359
+ rubygems_version: 1.8.6
361
360
  signing_key:
362
361
  specification_version: 2
363
362
  summary: Generic interface to multiple Ruby template engines
364
- test_files:
363
+ test_files:
365
364
  - test/tilt_blueclothtemplate_test.rb
366
365
  - test/tilt_buildertemplate_test.rb
367
366
  - test/tilt_cache_test.rb
@@ -388,3 +387,5 @@ test_files:
388
387
  - test/tilt_stringtemplate_test.rb
389
388
  - test/tilt_template_test.rb
390
389
  - test/tilt_test.rb
390
+ - test/tilt_wikiclothtemplate_test.rb
391
+ - test/tilt_yajltemplate_test.rb