Skip to content

Commit

Permalink
tilt.rb: Switch to new register-API
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed Mar 10, 2011
1 parent e11fef2 commit 239057d
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions lib/tilt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def precompiled_template(locals)
@code
end
end
register 'str', StringTemplate
register StringTemplate, 'str'


# ERB template implementation. See:
Expand Down Expand Up @@ -496,7 +496,7 @@ def precompiled(locals)
end
end

%w[erb rhtml].each { |ext| register ext, ERBTemplate }
register ERBTemplate, 'erb', 'rhtml'


# Erubis template implementation. See:
Expand Down Expand Up @@ -545,7 +545,7 @@ def precompiled(locals)
end
end
end
register 'erubis', ErubisTemplate
register ErubisTemplate, 'erb', 'rhtml', 'erubis'


# Haml template implementation. See:
Expand Down Expand Up @@ -607,7 +607,7 @@ def precompiled_postamble(locals)
end
end
end
register 'haml', HamlTemplate
register HamlTemplate, 'haml'


# Sass template implementation. See:
Expand Down Expand Up @@ -638,7 +638,7 @@ def sass_options
options.merge(:filename => eval_file, :line => line, :syntax => :sass)
end
end
register 'sass', SassTemplate
register SassTemplate, 'sass'

# Sass's new .scss type template implementation.
class ScssTemplate < SassTemplate
Expand All @@ -649,7 +649,7 @@ def sass_options
options.merge(:filename => eval_file, :line => line, :syntax => :scss)
end
end
register 'scss', ScssTemplate
register ScssTemplate, 'scss'

# Lessscss template implementation. See:
# http://lesscss.org/
Expand All @@ -674,7 +674,7 @@ def evaluate(scope, locals, &block)
@engine.to_css
end
end
register 'less', LessTemplate
register LessTemplate, 'less'


# CoffeeScript template implementation. See:
Expand Down Expand Up @@ -711,7 +711,7 @@ def evaluate(scope, locals, &block)
@output ||= CoffeeScript.compile(data, :no_wrap => @no_wrap)
end
end
register 'coffee', CoffeeScriptTemplate
register CoffeeScriptTemplate, 'coffee'


# Nokogiri template implementation. See:
Expand Down Expand Up @@ -752,7 +752,7 @@ def precompiled_template(locals)
data.to_str
end
end
register 'nokogiri', NokogiriTemplate
register NokogiriTemplate, 'nokogiri'

# Builder template implementation. See:
# http://builder.rubyforge.org/
Expand Down Expand Up @@ -789,7 +789,7 @@ def precompiled_template(locals)
data.to_str
end
end
register 'builder', BuilderTemplate
register BuilderTemplate, 'builder'


# Liquid template implementation. See:
Expand Down Expand Up @@ -829,7 +829,7 @@ def evaluate(scope, locals, &block)
@engine.render(locals)
end
end
register 'liquid', LiquidTemplate
register LiquidTemplate, 'liquid'


# Discount Markdown implementation. See:
Expand Down Expand Up @@ -891,13 +891,8 @@ def evaluate(scope, locals, &block)
end
end

register 'markdown', BlueClothTemplate
register 'mkd', BlueClothTemplate
register 'md', BlueClothTemplate

register 'markdown', RDiscountTemplate
register 'mkd', RDiscountTemplate
register 'md', RDiscountTemplate
register BlueClothTemplate, 'markdown', 'mkd', 'md'
register RDiscountTemplate, 'markdown', 'mkd', 'md'



Expand All @@ -921,7 +916,7 @@ def evaluate(scope, locals, &block)
@output ||= @engine.to_html
end
end
register 'textile', RedClothTemplate
register RedClothTemplate, 'textile'


# RDoc template. See:
Expand Down Expand Up @@ -952,7 +947,7 @@ def evaluate(scope, locals, &block)
@output ||= @engine.to_s
end
end
register 'rdoc', RDocTemplate
register RDocTemplate, 'rdoc'


# Radius Template
Expand Down Expand Up @@ -989,7 +984,7 @@ def evaluate(scope, locals, &block)
parser.parse(data)
end
end
register 'radius', RadiusTemplate
register RadiusTemplate, 'radius'


# Markaby
Expand Down Expand Up @@ -1039,5 +1034,5 @@ def __run_markaby_tilt__
builder.to_s
end
end
register 'mab', MarkabyTemplate
register MarkabyTemplate, 'mab'
end

0 comments on commit 239057d

Please sign in to comment.