Sha256: 72500bca46025f423d7562438f6c569d272323b122573108b5c8a74cacc741ed

Contents?: true

Size: 924 Bytes

Versions: 1

Compression:

Stored size: 924 Bytes

Contents

if RUBY_VERSION < "2.0"
  DatGretel::Renderer.class_eval do
    def options_for_style_with_default_style_key(style_key)
      if style_key == :default
        DatGretel.show_deprecation_warning "The :default style key is now called :inline. Please use `breadcrumbs style: :inline` instead or omit it, as it is the default."
        style_key = :inline
      end
      options_for_style_without_default_style_key(style_key)
    end

    alias_method_chain :options_for_style, :default_style_key
  end
else
  module DeprecatedDefaultStyleKey
    def options_for_style(style_key)
      if style_key == :default
        DatGretel.show_deprecation_warning "The :default style key is now called :inline. Please use `breadcrumbs style: :inline` instead or omit it, as it is the default."
        style_key = :inline
      end
      super(style_key)
    end
  end

  DatGretel::Renderer.send :prepend, DeprecatedDefaultStyleKey
end

Version data entries

1 entries across 1 versions & 1 rubygems

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