diff --git a/lib/representative_view/action_pack_4_handler.rb b/lib/representative_view/action_pack_4_handler.rb new file mode 100644 index 0000000..f23a412 --- /dev/null +++ b/lib/representative_view/action_pack_4_handler.rb @@ -0,0 +1,19 @@ +require 'representative_view/view_helpers' + +module RepresentativeView + + class ActionPack4Handler + + def self.call(template) + <<-RUBY + representative_view(formats.first) do |r| + #{template.source} + end + RUBY + end + + end + +end + +ActionView::Template.register_template_handler(:rep, RepresentativeView::ActionPack4Handler) diff --git a/lib/representative_view/action_pack_5_handler.rb b/lib/representative_view/action_pack_5_handler.rb new file mode 100644 index 0000000..a0bc84a --- /dev/null +++ b/lib/representative_view/action_pack_5_handler.rb @@ -0,0 +1,19 @@ +require 'representative_view/view_helpers' + +module RepresentativeView + + class ActionPack5Handler + + def self.call(template) + <<-RUBY + representative_view(formats.first) do |r| + #{template.source} + end + RUBY + end + + end + +end + +ActionView::Template.register_template_handler(:rep, RepresentativeView::ActionPack5Handler) diff --git a/lib/representative_view/action_pack_6_handler.rb b/lib/representative_view/action_pack_6_handler.rb new file mode 100644 index 0000000..5fc5779 --- /dev/null +++ b/lib/representative_view/action_pack_6_handler.rb @@ -0,0 +1,19 @@ +require 'representative_view/view_helpers' + +module RepresentativeView + + class ActionPack6Handler + + def self.call(template, source) + <<-RUBY + representative_view(formats.first) do |r| + #{source} + end + RUBY + end + + end + +end + +ActionView::Template.register_template_handler(:rep, RepresentativeView::ActionPack6Handler) diff --git a/representative_view.gemspec b/representative_view.gemspec index d827ba6..32dc984 100644 --- a/representative_view.gemspec +++ b/representative_view.gemspec @@ -13,8 +13,8 @@ Gem::Specification.new do |gem| gem.version = RepresentativeView::VERSION.dup gem.platform = Gem::Platform::RUBY - gem.add_runtime_dependency("representative", "~> 1.0.2") - gem.add_runtime_dependency("actionpack", "> 2.3.0", "< 4.0.0") + gem.add_runtime_dependency("representative", "~> 1.2.0") + gem.add_runtime_dependency("actionpack", "> 2.3.0", "< 7.0.0") gem.require_paths = ["lib"]