breadcrumb 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/{README.rdoc → README.md} +43 -15
- data/lib/breadcrumb/helper.rb +1 -1
- data/lib/breadcrumb/version.rb +1 -1
- metadata +53 -26
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 88589a7033b62b3e72d434d961f8e5ca23840792
|
4
|
+
data.tar.gz: ff116689cc0f53f57a9768b87305e302483abe18
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ee5d712c06dfca5db063414430497eac02c18f139b2a43c938204daa0441b10ea8a326f734210dbaad08038d467a80ca501237c738e9eaf54b553da84ecf60d1
|
7
|
+
data.tar.gz: 6131fb22c319479472a8aea32951f0bc0f15b0bf6c9e6dc1e69c3b53e7a36e6a5825491da30f93b0d28591658aa30f0ed96dfebc3f74e0f0dcf2ac26ec9d9338
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,21 +1,34 @@
|
|
1
|
-
|
1
|
+
# Breadcrumb
|
2
2
|
|
3
|
-
=
|
3
|
+
[](https://travis-ci.org/mjacobus/breadcrumb)
|
4
|
+
[](https://coveralls.io/r/mjacobus/breadcrumb)
|
5
|
+
[](https://codeclimate.com/github/mjacobus/breadcrumb)
|
6
|
+
[](https://gemnasium.com/mjacobus/breadcrumb)
|
7
|
+
[](http://badge.fury.io/rb/breadcrumb)
|
8
|
+
|
9
|
+
## Instalation
|
4
10
|
Put the following line in your Gemfile
|
5
|
-
gem "breadcrumb"
|
6
11
|
|
7
|
-
|
12
|
+
```ruby
|
13
|
+
gem 'breadcrumb'
|
14
|
+
```
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
$ bundle
|
19
|
+
|
20
|
+
## Usage
|
8
21
|
|
9
22
|
Layout:
|
10
23
|
<%= breadcrumb %>
|
11
24
|
|
12
25
|
You can add a root path by doing this
|
13
26
|
|
14
|
-
<%=
|
27
|
+
<%= breadcrumb.prepend("Home","/") %>
|
15
28
|
|
16
29
|
In your view (say the uri path is /books/religion/the-holly-bible):
|
17
30
|
|
18
|
-
```
|
31
|
+
```erb
|
19
32
|
<%
|
20
33
|
breadcrumb.add("Books","/books")
|
21
34
|
breadcrumb.add("Religion", books_category_path(@book.category))
|
@@ -37,27 +50,27 @@ It will render
|
|
37
50
|
|
38
51
|
You can change the separator
|
39
52
|
|
40
|
-
```
|
41
|
-
|
53
|
+
```erb
|
54
|
+
<% breadcrumb.separator = '<span class="separator"> > </span>' %>
|
42
55
|
```
|
43
56
|
|
44
57
|
Titleizing
|
45
58
|
You can use breadcrumb for creating the page title:
|
46
59
|
|
47
|
-
```
|
60
|
+
```erb
|
48
61
|
<title><%= breadcrumb.titleize %></title>
|
49
62
|
```
|
50
63
|
|
51
64
|
which will ouput
|
52
65
|
|
53
66
|
|
54
|
-
```
|
67
|
+
```erb
|
55
68
|
<title>Books :: Religion :: The Holly Bible</title>
|
56
69
|
```
|
57
70
|
|
58
71
|
Titleize accepts block. When using blocks, returning false removes the title part. Returing nil, won't change the behavior. Returning String changes the title part.
|
59
72
|
|
60
|
-
```
|
73
|
+
```erb
|
61
74
|
<title><%= breadcrumb.titleize {|part| "Our Awesome Books" if parts == 'Books' } %></title>
|
62
75
|
```
|
63
76
|
|
@@ -77,12 +90,27 @@ Removing the title part
|
|
77
90
|
|
78
91
|
Outputs
|
79
92
|
|
80
|
-
```
|
93
|
+
```erb
|
81
94
|
<title>Books :: The Holly Bible</title>
|
82
95
|
```
|
83
96
|
|
84
97
|
And you can change the title separator:
|
85
98
|
|
86
|
-
```
|
87
|
-
|
88
|
-
```
|
99
|
+
```erb
|
100
|
+
<% breadcrumb.title_separator = '-' %>
|
101
|
+
```
|
102
|
+
|
103
|
+
## Authors
|
104
|
+
|
105
|
+
- [Marcelo Jacobus](https://github.com/mjacobus)
|
106
|
+
|
107
|
+
|
108
|
+
## Contributing
|
109
|
+
|
110
|
+
1. Fork it
|
111
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
112
|
+
**Do not forget to write tests**
|
113
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
114
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
115
|
+
5. Create new Pull Request
|
116
|
+
|
data/lib/breadcrumb/helper.rb
CHANGED
data/lib/breadcrumb/version.rb
CHANGED
metadata
CHANGED
@@ -1,62 +1,89 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: breadcrumb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Marcelo Jacobus
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-12-30 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: 3.2.0
|
20
|
+
- - <
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 5.0.0
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
25
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 3.2.0
|
30
|
+
- - <
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 5.0.0
|
30
33
|
- !ruby/object:Gem::Dependency
|
31
34
|
name: rspec-rails
|
32
35
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
36
|
requirements:
|
35
|
-
- -
|
37
|
+
- - '>='
|
36
38
|
- !ruby/object:Gem::Version
|
37
39
|
version: '0'
|
38
40
|
type: :development
|
39
41
|
prerelease: false
|
40
42
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
43
|
requirements:
|
43
|
-
- -
|
44
|
+
- - '>='
|
44
45
|
- !ruby/object:Gem::Version
|
45
46
|
version: '0'
|
46
47
|
- !ruby/object:Gem::Dependency
|
47
48
|
name: guard-rspec
|
48
49
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: coveralls
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: simplecov
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - '>='
|
52
80
|
- !ruby/object:Gem::Version
|
53
81
|
version: '0'
|
54
82
|
type: :development
|
55
83
|
prerelease: false
|
56
84
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
85
|
requirements:
|
59
|
-
- -
|
86
|
+
- - '>='
|
60
87
|
- !ruby/object:Gem::Version
|
61
88
|
version: '0'
|
62
89
|
description: Breadcrumb Helper
|
@@ -66,35 +93,35 @@ executables: []
|
|
66
93
|
extensions: []
|
67
94
|
extra_rdoc_files: []
|
68
95
|
files:
|
69
|
-
- lib/tasks/breadcrumb_tasks.rake
|
70
|
-
- lib/breadcrumb.rb
|
71
|
-
- lib/breadcrumb/version.rb
|
72
96
|
- lib/breadcrumb/helper.rb
|
97
|
+
- lib/breadcrumb/version.rb
|
98
|
+
- lib/breadcrumb.rb
|
99
|
+
- lib/tasks/breadcrumb_tasks.rake
|
73
100
|
- MIT-LICENSE
|
74
101
|
- Rakefile
|
75
|
-
- README.
|
102
|
+
- README.md
|
76
103
|
homepage: http://github.com/mjacobus/breadcrumb
|
77
|
-
licenses:
|
104
|
+
licenses:
|
105
|
+
- MIT
|
106
|
+
metadata: {}
|
78
107
|
post_install_message:
|
79
108
|
rdoc_options: []
|
80
109
|
require_paths:
|
81
110
|
- lib
|
82
111
|
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
-
none: false
|
84
112
|
requirements:
|
85
|
-
- -
|
113
|
+
- - '>='
|
86
114
|
- !ruby/object:Gem::Version
|
87
115
|
version: '0'
|
88
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
117
|
requirements:
|
91
|
-
- -
|
118
|
+
- - '>='
|
92
119
|
- !ruby/object:Gem::Version
|
93
120
|
version: '0'
|
94
121
|
requirements: []
|
95
122
|
rubyforge_project:
|
96
|
-
rubygems_version:
|
123
|
+
rubygems_version: 2.0.3
|
97
124
|
signing_key:
|
98
|
-
specification_version:
|
125
|
+
specification_version: 4
|
99
126
|
summary: Breadcrumb Helper
|
100
127
|
test_files: []
|