From c1ae0086c7ba5666f85ff964c11c7c8784bf6492 Mon Sep 17 00:00:00 2001 From: Guillaume Malette Date: Wed, 10 Aug 2016 09:46:43 -0400 Subject: [PATCH 1/2] Specify minimum Ruby version --- turbograft.gemspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/turbograft.gemspec b/turbograft.gemspec index 6a2eadce..eac2c848 100644 --- a/turbograft.gemspec +++ b/turbograft.gemspec @@ -18,6 +18,8 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] + spec.required_ruby_version = '~> 2.1' + spec.add_dependency "coffee-rails" spec.add_development_dependency "bundler" From a550d77963365b288f0da1d3801d68a0e9765ca3 Mon Sep 17 00:00:00 2001 From: Guillaume Malette Date: Wed, 10 Aug 2016 09:50:36 -0400 Subject: [PATCH 2/2] Remove module_eval since is public since 2.1 --- lib/turbograft.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/turbograft.rb b/lib/turbograft.rb index 9f5f2493..23473d27 100644 --- a/lib/turbograft.rb +++ b/lib/turbograft.rb @@ -35,10 +35,8 @@ def referer end ActiveSupport.on_load(:action_view) do - (ActionView::RoutingUrlFor rescue ActionView::Helpers::UrlHelper).module_eval do - prepend XHRUrlFor - end - end unless RUBY_VERSION =~ /^1\.8/ + (ActionView::RoutingUrlFor rescue ActionView::Helpers::UrlHelper).prepend(XHRUrlFor) + end end end end