crumble 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -1
- data/VERSION +1 -1
- data/app/helpers/breadcrumbs_helper.rb +4 -2
- data/lib/breadcrumb.rb +2 -1
- data/lib/crumble/railtie.rb +11 -0
- metadata +18 -5
data/README.md
CHANGED
@@ -5,11 +5,13 @@ It's a tiny combination of a helper and a simple configuration class to make bre
|
|
5
5
|
Installation
|
6
6
|
============
|
7
7
|
|
8
|
+
1. Rails 2.3
|
9
|
+
|
8
10
|
The gem is hosted on gemcutter, so if you haven’t already, add it as a gem source:
|
9
11
|
|
10
12
|
gem sources -a http://gemcutter.org/
|
11
13
|
|
12
|
-
Then install the
|
14
|
+
Then install the Crumble gem (recommended):
|
13
15
|
|
14
16
|
gem install crumble
|
15
17
|
|
@@ -25,6 +27,14 @@ This will cause the problem. Either disable it, or let Rails use the default, wh
|
|
25
27
|
|
26
28
|
config.reload_plugins = true
|
27
29
|
|
30
|
+
2. Rails 3
|
31
|
+
|
32
|
+
In Gemfile add:
|
33
|
+
|
34
|
+
source 'http://rubygems.org'
|
35
|
+
# ...
|
36
|
+
gem 'crumble', :require => 'breadcrumb'
|
37
|
+
|
28
38
|
Usage
|
29
39
|
=====
|
30
40
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
@@ -4,7 +4,9 @@ module BreadcrumbsHelper
|
|
4
4
|
if trail.controller.to_sym == params[:controller].to_sym and
|
5
5
|
trail.action.to_sym == params[:action].to_sym
|
6
6
|
next unless trail.condition_met?(self)
|
7
|
-
|
7
|
+
breadcrumb_trails = calculate_breadcrumb_trail(trail.trail)
|
8
|
+
breadcrumb_trails = breadcrumb_trails.html_safe if breadcrumb_trails.respond_to? :html_safe
|
9
|
+
return breadcrumb_trails
|
8
10
|
end
|
9
11
|
end
|
10
12
|
""
|
@@ -100,4 +102,4 @@ module BreadcrumbsHelper
|
|
100
102
|
crumb.title
|
101
103
|
end
|
102
104
|
end
|
103
|
-
end
|
105
|
+
end
|
data/lib/breadcrumb.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
module Crumble
|
2
|
+
if defined? Rails::Railtie
|
3
|
+
require 'rails'
|
4
|
+
class Railtie < Rails::Railtie
|
5
|
+
initializer 'breadcrumbs_helper.include_to_action_controller' do
|
6
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../app/helpers/breadcrumbs_helper')
|
7
|
+
ActionController::Base.helper(BreadcrumbsHelper)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crumble
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Mathias Meyer
|
@@ -9,7 +15,7 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-11-05 00:00:00 +01:00
|
13
19
|
default_executable:
|
14
20
|
dependencies: []
|
15
21
|
|
@@ -28,6 +34,7 @@ files:
|
|
28
34
|
- VERSION
|
29
35
|
- app/helpers/breadcrumbs_helper.rb
|
30
36
|
- lib/breadcrumb.rb
|
37
|
+
- lib/crumble/railtie.rb
|
31
38
|
- rails/init.rb
|
32
39
|
- spec/breadcrumb_spec.rb
|
33
40
|
- spec/breadcrumbs_helper_spec.rb
|
@@ -42,21 +49,27 @@ rdoc_options:
|
|
42
49
|
require_paths:
|
43
50
|
- lib
|
44
51
|
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
45
53
|
requirements:
|
46
54
|
- - ">="
|
47
55
|
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
57
|
+
segments:
|
58
|
+
- 0
|
48
59
|
version: "0"
|
49
|
-
version:
|
50
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
51
62
|
requirements:
|
52
63
|
- - ">="
|
53
64
|
- !ruby/object:Gem::Version
|
65
|
+
hash: 3
|
66
|
+
segments:
|
67
|
+
- 0
|
54
68
|
version: "0"
|
55
|
-
version:
|
56
69
|
requirements: []
|
57
70
|
|
58
71
|
rubyforge_project:
|
59
|
-
rubygems_version: 1.3.
|
72
|
+
rubygems_version: 1.3.7
|
60
73
|
signing_key:
|
61
74
|
specification_version: 3
|
62
75
|
summary: Crumble - It's like breadcrumbs for your Rails application!
|