Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lib/representative_view/action_pack_4_handler.rb
Original file line number Diff line number Diff line change
@@ -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)
19 changes: 19 additions & 0 deletions lib/representative_view/action_pack_5_handler.rb
Original file line number Diff line number Diff line change
@@ -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)
19 changes: 19 additions & 0 deletions lib/representative_view/action_pack_6_handler.rb
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 2 additions & 2 deletions representative_view.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down