Sha256: 18f99112f37ce76757b409c25b6c866d100d850ba874e28f0c22b9d66d52f937

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

if RUBY_VERSION < "2.0"
  DatGretel::Renderer.class_eval do
    def options_for_render_with_show_root_alone(options = {})
      options = options_for_render_without_show_root_alone(options)
      if show_root_alone = options.delete(:show_root_alone)
        DatGretel.show_deprecation_warning "The :show_root_alone option is deprecated and will be removed in Gretel v4.0.0. Use `breadcrumbs(display_single_fragment: #{show_root_alone.inspect})` instead."
        options[:display_single_fragment] = show_root_alone
      end
      options
    end

    alias_method_chain :options_for_render, :show_root_alone
  end
else
  module DeprecatedShowRootAlone
    def options_for_render(options = {})
      options = super(options)
      if show_root_alone = options.delete(:show_root_alone)
        DatGretel.show_deprecation_warning "The :show_root_alone option is deprecated and will be removed in Gretel v4.0.0. Use `breadcrumbs(display_single_fragment: #{show_root_alone.inspect})` instead."
        options[:display_single_fragment] = show_root_alone
      end
      options
    end
  end

  DatGretel::Renderer.send :prepend, DeprecatedShowRootAlone
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dat_gretel-4.0.1 lib/dat_gretel/deprecated/show_root_alone.rb