diff --git a/lib/nice_partials/monkey_patch.rb b/lib/nice_partials/monkey_patch.rb index 58f4695..a2c979c 100644 --- a/lib/nice_partials/monkey_patch.rb +++ b/lib/nice_partials/monkey_patch.rb @@ -26,9 +26,6 @@ def with_nice_partials_t_prefix(lookup_context, block) end end -require "active_support/deprecation" -NicePartials::DEPRECATOR = ActiveSupport::Deprecation.new("1.0", "nice_partials") - module NicePartials::RenderingWithAutoContext ActionView::Base.prepend self @@ -36,15 +33,6 @@ def partial @partial ||= nice_partial end - def p(*args) - if args.empty? - NicePartials::DEPRECATOR.deprecation_warning :p, :partial # In-branch printing so we don't warn on legit `Kernel.p` calls. - partial - else - super # …we're really Kernel.p - end - end - def render(options = {}, locals = {}, &block) _partial = @partial super diff --git a/test/fixtures/_clobberer.html.erb b/test/fixtures/_clobberer.html.erb deleted file mode 100644 index 79efc93..0000000 --- a/test/fixtures/_clobberer.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<% p "it's clobbering time" %> -<%# TODO: Remove this file once `p` has been removed post deprecation, but don't change it yet. %> -<%= p.yield :message %> diff --git a/test/renderer_test.rb b/test/renderer_test.rb index 6aca50c..447d2ea 100644 --- a/test/renderer_test.rb +++ b/test/renderer_test.rb @@ -55,20 +55,4 @@ class RendererTest < NicePartials::Test assert_rendered "hello from nice partials" assert_equal "Some extra content", nice_partial.output_buffer end - - test "doesn't clobber Kernel.p" do - assert_output "\"it's clobbering time\"\n" do - render("clobberer") { |p| p.content_for :message, "hello from nice partials" } - end - - assert_rendered "hello from nice partials" - end - - test "deprecates top-level access through p method" do - assert_deprecated /p is deprecated and will be removed from nice_partials \d/, NicePartials::DEPRECATOR do - assert_output "\"it's clobbering time\"\n" do - render("clobberer") { |p| p.content_for :message, "hello from nice partials" } - end - end - end end