diff --git a/lib/gretel.rb b/lib/gretel.rb index 7694ead..e59ae64 100644 --- a/lib/gretel.rb +++ b/lib/gretel.rb @@ -21,7 +21,7 @@ def breadcrumb_paths Rails::Engine.subclasses.map(&:instance) engine_roots = engines.map { |e| e.config.root } - + [*engine_roots, Rails.root].map do |root| [root.join("config", "breadcrumbs.rb"), root.join("config", "breadcrumbs", "**", "*.rb"), @@ -59,7 +59,7 @@ def reload_environments end # Registers a style for later use. - # + # # Gretel.register_style :ul, { container_tag: :ul, fragment_tag: :li } def register_style(style, options) Gretel::Renderer.register_style style, options @@ -69,7 +69,7 @@ def register_style(style, options) attr_writer :reload_environments # Yields this +Gretel+ to be configured. - # + # # Gretel.configure do |config| # config.reload_environments << "staging" # end diff --git a/lib/gretel/crumb.rb b/lib/gretel/crumb.rb index 5186695..5db0718 100644 --- a/lib/gretel/crumb.rb +++ b/lib/gretel/crumb.rb @@ -29,7 +29,7 @@ def link(*args) # Transform objects to real paths. url = url_for(url) if url - + links << Gretel::Link.new(key, text, url, options) end diff --git a/lib/gretel/deprecated.rb b/lib/gretel/deprecated.rb index 64ac02b..9ad737c 100644 --- a/lib/gretel/deprecated.rb +++ b/lib/gretel/deprecated.rb @@ -1 +1 @@ -Dir[File.dirname(__FILE__) + "/deprecated/*.rb"].each { |file| require file } \ No newline at end of file +Dir[File.dirname(__FILE__) + "/deprecated/*.rb"].each { |file| require file } diff --git a/lib/gretel/deprecated/default_style_key.rb b/lib/gretel/deprecated/default_style_key.rb index dd4000c..39ca0ef 100644 --- a/lib/gretel/deprecated/default_style_key.rb +++ b/lib/gretel/deprecated/default_style_key.rb @@ -22,4 +22,4 @@ def options_for_style(style_key) end Gretel::Renderer.send :prepend, DeprecatedDefaultStyleKey -end \ No newline at end of file +end diff --git a/lib/gretel/deprecated/layout.rb b/lib/gretel/deprecated/layout.rb index 2e2608d..e7cfd84 100644 --- a/lib/gretel/deprecated/layout.rb +++ b/lib/gretel/deprecated/layout.rb @@ -12,4 +12,4 @@ def layout(&block) "See https://github.com/lassebunk/gretel/blob/master/README.md for details.") end end -end \ No newline at end of file +end diff --git a/lib/gretel/link.rb b/lib/gretel/link.rb index 0950adf..68071ad 100644 --- a/lib/gretel/link.rb +++ b/lib/gretel/link.rb @@ -36,4 +36,4 @@ def method_missing(method, *args, &block) end end end -end \ No newline at end of file +end diff --git a/lib/gretel/resettable.rb b/lib/gretel/resettable.rb index 9f15a15..96a1fae 100644 --- a/lib/gretel/resettable.rb +++ b/lib/gretel/resettable.rb @@ -10,4 +10,4 @@ def reset! end end end -end \ No newline at end of file +end diff --git a/lib/gretel/view_helpers.rb b/lib/gretel/view_helpers.rb index 93ceb75..7566e1b 100644 --- a/lib/gretel/view_helpers.rb +++ b/lib/gretel/view_helpers.rb @@ -1,11 +1,11 @@ module Gretel module ViewHelpers # Sets the current breadcrumb to be rendered elsewhere. Put it somewhere in the view, preferably in the top, before you render any breadcrumbs HTML: - # + # # <% breadcrumb :category, @category %> - # + # # If you pass an instance of an object that responds to +model_name+ (like an ActiveRecord model instance), the breadcrumb can be automatically inferred, so a shortcut for the above would be: - # + # # <% breadcrumb @category %> def breadcrumb(key = nil, *args) if key.nil? || key.is_a?(Hash) @@ -15,15 +15,15 @@ def breadcrumb(key = nil, *args) end # Yields a block where inside the block you have a different breadcrumb than outside. - # + # # <% breadcrumb :about %> - # + # # <%= breadcrumbs # shows the :about breadcrumb %> - # + # # <% with_breadcrumb :product, Product.first do %> # <%= breadcrumbs # shows the :product breadcrumb %> # <% end %> - # + # # <%= breadcrumbs # shows the :about breadcrumb %> def with_breadcrumb(key, *args, &block) original_renderer = @_gretel_renderer @@ -49,7 +49,7 @@ def breadcrumbs(options = {}) end # Returns or yields parent breadcrumb (second-to-last in the trail) if it is present. - # + # # <% parent_breadcrumb do |link| %> # <%= link_to link.text, link.url %> (<%= link.key %>) # <% end %>