Permalink
Browse files

move to gem

  • Loading branch information...
1 parent c26b173 commit 660678fc6569d00d0689c103a8c2a892248952ee @lassebunk committed Sep 20, 2011
Showing with 23 additions and 5 deletions.
  1. +4 −2 README.rdoc
  2. +13 −0 gretel.gemspec
  3. +1 −1 init.rb
  4. +5 −2 lib/gretel/crumbs.rb
View
@@ -3,9 +3,11 @@ Gretel is a Ruby on Rails plugin that makes it easy yet flexible to create bread
== Installation
-In Rails 3:
+In your <em>Gemfile</em>:
- $ rails plugin install git://github.com/lassebunk/gretel.git
+ gem 'gretel'
+
+And run <code>bundle install</code>.
== Example
View
@@ -0,0 +1,13 @@
+Gem::Specification.new do |s|
+ s.name = "gretel"
+ s.version = "1.0.4"
+
+ s.author = "Lasse Bunk"
+ s.email = "lassebunk@gmail.com"
+ s.description = "Gretel is a Ruby on Rails plugin that makes it easy yet flexible to create breadcrumbs."
+ s.summary = "Flexible Ruby on Rails breadcrumbs plugin."
+ s.homepage = "http://github.com/lassebunk/gretel"
+
+ s.files = Dir['lib/**/*.rb']
+ s.require_paths = ["lib"]
+end
View
@@ -1 +1 @@
-ActionController::Base.send :include, Gretel::HelperMethods
+require 'gretel'
@@ -1,11 +1,14 @@
module Gretel
class Crumbs
class << self
- include Rails.application.routes.url_helpers
- include ActionView::Helpers::UrlHelper
def controller # hack because Rails.application.routes.url_helpers needs a controller method
end
+
def layout(&block)
+ # needs to be done here because Rails.application isn't set when this file is required
+ self.class.send :include, Rails.application.routes.url_helpers
+ self.class.send :include, ActionView::Helpers::UrlHelper
+
instance_eval &block
end

0 comments on commit 660678f

Please sign in to comment.