Sha256: 682c2b94b944e3fa05807d596b6994ad3adf6d0738a8df85e51584f1b9dad5bb

Contents?: true

Size: 911 Bytes

Versions: 2

Compression:

Stored size: 911 Bytes

Contents

if RUBY_VERSION < "2.0"
  Gretel::Renderer.class_eval do
    def options_for_style_with_default_style_key(style_key)
      if style_key == :default
        Gretel.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
        Gretel.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

  Gretel::Renderer.send :prepend, DeprecatedDefaultStyleKey
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
gretel-lite-3.0.10 lib/gretel/deprecated/default_style_key.rb
gretel-3.0.9 lib/gretel/deprecated/default_style_key.rb