Module: Gretel
- Extended by:
- Resettable
- Defined in:
- lib/gretel.rb,
lib/gretel/link.rb,
lib/gretel/crumb.rb,
lib/gretel/crumbs.rb,
lib/gretel/version.rb,
lib/gretel/renderer.rb,
lib/gretel/resettable.rb,
lib/gretel/view_helpers.rb,
lib/generators/gretel/install_generator.rb
Defined Under Namespace
Modules: Crumbs, Resettable, ViewHelpers Classes: Crumb, InstallGenerator, Link, Renderer
Constant Summary collapse
- VERSION =
"3.0.0"
Class Attribute Summary collapse
-
.reload_environments ⇒ Object
Array of Rails environment names with automatic configuration reload.
Class Method Summary collapse
-
.breadcrumb_paths ⇒ Object
Returns the path from with breadcrumbs are loaded.
-
.breadcrumb_paths=(paths) ⇒ Object
Sets the path from with breadcrumbs are loaded.
-
.configure {|_self| ... } ⇒ Object
Yields this
Gretelto be configured. -
.register_style(style, options) ⇒ Object
Registers a style for later use.
-
.show_deprecation_warning(message) ⇒ Object
Shows a deprecation warning.
-
.suppress_deprecation_warnings=(value) ⇒ Object
Sets whether to suppress deprecation warnings.
-
.suppress_deprecation_warnings? ⇒ Boolean
Whether to suppress deprecation warnings.
Methods included from Resettable
Class Attribute Details
.reload_environments ⇒ Object
Array of Rails environment names with automatic configuration reload. Default is [“development”].
43 44 45 |
# File 'lib/gretel.rb', line 43 def reload_environments @reload_environments ||= ["development"] end |
Class Method Details
.breadcrumb_paths ⇒ Object
Returns the path from with breadcrumbs are loaded. Default is config/breadcrumbs.rb.
15 16 17 |
# File 'lib/gretel.rb', line 15 def ||= [Rails.root.join("config", "breadcrumbs.rb"), Rails.root.join("config", "breadcrumbs", "**", "*.rb")] end |
.breadcrumb_paths=(paths) ⇒ Object
Sets the path from with breadcrumbs are loaded. Default is config/breadcrumbs.rb.
20 21 22 |
# File 'lib/gretel.rb', line 20 def (paths) = paths end |
.configure {|_self| ... } ⇒ Object
Yields this Gretel to be configured.
Gretel.configure do |config|
config.reload_environments << "staging"
end
62 63 64 |
# File 'lib/gretel.rb', line 62 def configure yield self end |
.register_style(style, options) ⇒ Object
Registers a style for later use.
Gretel.register_style :ul, { container_tag: :ul, fragment_tag: :li }
50 51 52 |
# File 'lib/gretel.rb', line 50 def register_style(style, ) Gretel::Renderer.register_style style, end |
.show_deprecation_warning(message) ⇒ Object
Shows a deprecation warning.
35 36 37 38 39 40 |
# File 'lib/gretel.rb', line 35 def show_deprecation_warning() return if suppress_deprecation_warnings? = "[Gretel] #{message}" puts Rails.logger.warn end |
.suppress_deprecation_warnings=(value) ⇒ Object
Sets whether to suppress deprecation warnings.
30 31 32 |
# File 'lib/gretel.rb', line 30 def suppress_deprecation_warnings=(value) @suppress_deprecation_warnings = value end |
.suppress_deprecation_warnings? ⇒ Boolean
Whether to suppress deprecation warnings.
25 26 27 |
# File 'lib/gretel.rb', line 25 def suppress_deprecation_warnings? !!@suppress_deprecation_warnings end |