diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-01-22 16:18:10 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-01-22 16:18:10 -0600 |
commit | eb9af20b7cc0e374277cf330bdd404f9daab28ec (patch) | |
tree | ba05a906690684e442ed92db3e63e295f0dd133e /actionpack/lib/action_view/template_handlers | |
parent | cc0b5fa9930dcc60914e21b518b3c54109243cfa (diff) | |
download | rails-eb9af20b7cc0e374277cf330bdd404f9daab28ec.tar.gz rails-eb9af20b7cc0e374277cf330bdd404f9daab28ec.tar.bz2 rails-eb9af20b7cc0e374277cf330bdd404f9daab28ec.zip |
Begin unifying the interface between ActionController and ActionView
Diffstat (limited to 'actionpack/lib/action_view/template_handlers')
-rw-r--r-- | actionpack/lib/action_view/template_handlers/builder.rb | 17 | ||||
-rw-r--r-- | actionpack/lib/action_view/template_handlers/erb.rb | 22 | ||||
-rw-r--r-- | actionpack/lib/action_view/template_handlers/rjs.rb | 13 |
3 files changed, 0 insertions, 52 deletions
diff --git a/actionpack/lib/action_view/template_handlers/builder.rb b/actionpack/lib/action_view/template_handlers/builder.rb deleted file mode 100644 index 788dc93326..0000000000 --- a/actionpack/lib/action_view/template_handlers/builder.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'builder' - -module ActionView - module TemplateHandlers - class Builder < TemplateHandler - include Compilable - - def compile(template) - "_set_controller_content_type(Mime::XML);" + - "xml = ::Builder::XmlMarkup.new(:indent => 2);" + - "self.output_buffer = xml.target!;" + - template.source + - ";xml.target!;" - end - end - end -end diff --git a/actionpack/lib/action_view/template_handlers/erb.rb b/actionpack/lib/action_view/template_handlers/erb.rb deleted file mode 100644 index e3120ba267..0000000000 --- a/actionpack/lib/action_view/template_handlers/erb.rb +++ /dev/null @@ -1,22 +0,0 @@ -module ActionView - module TemplateHandlers - class ERB < TemplateHandler - include Compilable - - ## - # :singleton-method: - # Specify trim mode for the ERB compiler. Defaults to '-'. - # See ERb documentation for suitable values. - cattr_accessor :erb_trim_mode - self.erb_trim_mode = '-' - - def compile(template) - src = ::ERB.new("<% __in_erb_template=true %>#{template.source}", nil, erb_trim_mode, '@output_buffer').src - - # Ruby 1.9 prepends an encoding to the source. However this is - # useless because you can only set an encoding on the first line - RUBY_VERSION >= '1.9' ? src.sub(/\A#coding:.*\n/, '') : src - end - end - end -end diff --git a/actionpack/lib/action_view/template_handlers/rjs.rb b/actionpack/lib/action_view/template_handlers/rjs.rb deleted file mode 100644 index 41a1fddb47..0000000000 --- a/actionpack/lib/action_view/template_handlers/rjs.rb +++ /dev/null @@ -1,13 +0,0 @@ -module ActionView - module TemplateHandlers - class RJS < TemplateHandler - include Compilable - - def compile(template) - "@template_format = :html;" + - "controller.response.content_type ||= Mime::JS;" + - "update_page do |page|;#{template.source}\nend" - end - end - end -end |