Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove trailing whitespace #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/gretel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/gretel/crumb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/gretel/deprecated.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Dir[File.dirname(__FILE__) + "/deprecated/*.rb"].each { |file| require file }
Dir[File.dirname(__FILE__) + "/deprecated/*.rb"].each { |file| require file }
2 changes: 1 addition & 1 deletion lib/gretel/deprecated/default_style_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ def options_for_style(style_key)
end

Gretel::Renderer.send :prepend, DeprecatedDefaultStyleKey
end
end
2 changes: 1 addition & 1 deletion lib/gretel/deprecated/layout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def layout(&block)
"See https://github.com/lassebunk/gretel/blob/master/README.md for details.")
end
end
end
end
2 changes: 1 addition & 1 deletion lib/gretel/link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ def method_missing(method, *args, &block)
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/gretel/resettable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def reset!
end
end
end
end
end
16 changes: 8 additions & 8 deletions lib/gretel/view_helpers.rb
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand All @@ -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 %>
Expand Down