navigator 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +2 -4
- data/{LICENSE.rdoc → LICENSE.md} +1 -1
- data/README.md +139 -0
- data/lib/navigator/menu.rb +3 -3
- data/lib/navigator/tag.rb +3 -3
- data/lib/navigator/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +68 -53
- metadata.gz.sig +0 -0
- data/CHANGELOG.rdoc +0 -23
- data/README.rdoc +0 -126
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0bca2c043bd730a4e027559e5d94d278230e81d4
|
4
|
+
data.tar.gz: fb9bcf32d156a9a1ae18190a55706d534f135507
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eac23032336f3acf01d03a554e2ad99cc1c0604951bacb046659d9c7c8ba5fc395a4f7ee71dd1aa047f5952ff689a74a77f32dd4994cc6892e1f198e0a06c7fd
|
7
|
+
data.tar.gz: 10feee16b33c64582a49142d534b6c2a9d6aed2cccd25528275d14405f7cc43322fb2f19b2fbb2aedaab7bffe8662cfb6fe711249a5cb48c3ed355fa9ba35967
|
checksums.yaml.gz.sig
CHANGED
data/{LICENSE.rdoc → LICENSE.md}
RENAMED
data/README.md
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
# Overview
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/navigator.png)](http://badge.fury.io/rb/navigator)
|
4
|
+
[![Code Climate GPA](https://codeclimate.com/github/bkuhlmann/navigator.png)](https://codeclimate.com/github/bkuhlmann/navigator)
|
5
|
+
[![Travis CI Status](https://secure.travis-ci.org/bkuhlmann/navigator.png)](http://travis-ci.org/bkuhlmann/navigator)
|
6
|
+
|
7
|
+
Enhances Rails with a DSL for menu navigation.
|
8
|
+
|
9
|
+
# Features
|
10
|
+
|
11
|
+
* A simple DSL for creating navigation menus.
|
12
|
+
* Supports sub-menus, nested tags, HTML attributes, etc.
|
13
|
+
* Supports the following HTML tags: ul, li, a, b, em, s, small, span, strong, sub, and sup.
|
14
|
+
* Provides the "item" convenience method which combines the "li" and "a" HTML tags into a single method for less typing.
|
15
|
+
|
16
|
+
# Requirements
|
17
|
+
|
18
|
+
0. [Ruby 2.0.x](http://www.ruby-lang.org).
|
19
|
+
0. [Ruby on Rails 4.0.x](http://rubyonrails.org).
|
20
|
+
|
21
|
+
# Setup
|
22
|
+
|
23
|
+
Type the following from the command line to securely install (recommended):
|
24
|
+
|
25
|
+
gem cert --add <(curl -Ls https://raw.github.com/bkuhlmann/navigator/master/gem-public.pem)
|
26
|
+
gem install navigator -P HighSecurity
|
27
|
+
|
28
|
+
...or type the following to insecurely install (not recommended):
|
29
|
+
|
30
|
+
gem install navigator
|
31
|
+
|
32
|
+
Add the following to your Gemfile:
|
33
|
+
|
34
|
+
gem "navigator"
|
35
|
+
|
36
|
+
# Usage
|
37
|
+
|
38
|
+
The following are examples using the render_navigation view helper:
|
39
|
+
|
40
|
+
## Unordered List (simple)
|
41
|
+
|
42
|
+
render_navigation do
|
43
|
+
item "Dashboard", "/dashboard"
|
44
|
+
item "News", "/posts"
|
45
|
+
end
|
46
|
+
|
47
|
+
Yields:
|
48
|
+
|
49
|
+
<ul>
|
50
|
+
<li><a href="/dashboard">Dashboard</a></li>
|
51
|
+
<li><a href="/posts">Posts</a></li>
|
52
|
+
</ul>
|
53
|
+
|
54
|
+
## Unordered List (with attributes)
|
55
|
+
|
56
|
+
render_navigation "ul", class: "nav" do
|
57
|
+
item "Dashboard", "/dashboard", class: "active"
|
58
|
+
item "News", "/posts"
|
59
|
+
end
|
60
|
+
|
61
|
+
Yields:
|
62
|
+
|
63
|
+
<ul class="nav">
|
64
|
+
<li class="active"><a href="/dashboard">Dashboard</a></li>
|
65
|
+
<li><a href="/posts">Posts</a></li>
|
66
|
+
</ul>
|
67
|
+
|
68
|
+
## Nav (with links)
|
69
|
+
|
70
|
+
render_navigation "nav" do
|
71
|
+
a "Dashboard", href: "/dashboard"
|
72
|
+
a "News", href: "/posts"
|
73
|
+
end
|
74
|
+
|
75
|
+
Yields:
|
76
|
+
|
77
|
+
<nav>
|
78
|
+
<a href="/dashboard">Dashboard</a>
|
79
|
+
<a href="/posts">Posts</a>
|
80
|
+
</nav>
|
81
|
+
|
82
|
+
## Twitter Bootstrap Dropdown
|
83
|
+
|
84
|
+
li nil, class: "dropdown" do
|
85
|
+
a "Manage", href: "#", class: "dropdown-toggle", "data-toggle" => "dropdown" do
|
86
|
+
b nil, class: "caret"
|
87
|
+
end
|
88
|
+
ul nil, class: "dropdown-menu" do
|
89
|
+
item "Dashboard", admin_dashboard_path
|
90
|
+
item "Users", admin_users_path
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
Yields:
|
95
|
+
|
96
|
+
<ul class="nav">
|
97
|
+
<li><a href="/en-US/admin/dashboard">Dashboard</a></li>
|
98
|
+
<li class="dropdown">
|
99
|
+
<a data-toggle="dropdown" class="dropdown-toggle" href="#">Manage<b class="caret"></b></a>
|
100
|
+
<ul class="dropdown-menu">
|
101
|
+
<li><a href="/admin/dashboard">Dashboard</a></li>
|
102
|
+
<li><a href="/admin/users">Users</a></li>
|
103
|
+
</ul>
|
104
|
+
</li>
|
105
|
+
</ul>
|
106
|
+
|
107
|
+
# Tests
|
108
|
+
|
109
|
+
To test, do the following:
|
110
|
+
|
111
|
+
0. cd to the gem root.
|
112
|
+
0. bundle install
|
113
|
+
0. bundle exec rspec spec
|
114
|
+
|
115
|
+
# Versioning
|
116
|
+
|
117
|
+
Read [Semantic Versioning](http://semver.org) for details. Briefly, it means:
|
118
|
+
|
119
|
+
* Patch (x.y.Z) - Incremented for small, backwards compatible bug fixes.
|
120
|
+
* Minor (x.Y.z) - Incremented for new, backwards compatible public API enhancements and/or bug fixes.
|
121
|
+
* Major (X.y.z) - Incremented for any backwards incompatible public API changes.
|
122
|
+
|
123
|
+
# Contributions
|
124
|
+
|
125
|
+
Read CONTRIBUTING for details.
|
126
|
+
|
127
|
+
# Credits
|
128
|
+
|
129
|
+
Developed by [Brooke Kuhlmann](http://www.redalchemist.com) at [Red Alchemist](http://www.redalchemist.com)
|
130
|
+
|
131
|
+
# License
|
132
|
+
|
133
|
+
Copyright (c) 2011 [Red Alchemist](http://www.redalchemist.com).
|
134
|
+
Read the LICENSE for details.
|
135
|
+
|
136
|
+
# History
|
137
|
+
|
138
|
+
Read the CHANGELOG for details.
|
139
|
+
Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
|
data/lib/navigator/menu.rb
CHANGED
@@ -12,7 +12,7 @@ module Navigator
|
|
12
12
|
# </nav>
|
13
13
|
class Menu
|
14
14
|
attr_accessor :options
|
15
|
-
|
15
|
+
|
16
16
|
# Initializes the menu.
|
17
17
|
# ==== Parameters
|
18
18
|
# * +template+ - Required. The view template.
|
@@ -70,7 +70,7 @@ module Navigator
|
|
70
70
|
if name.to_s =~ /^(ul|li|a|b|em|s|small|span|strong|sub|sup)$/
|
71
71
|
add(*args.unshift(name), &block)
|
72
72
|
else
|
73
|
-
@template.
|
73
|
+
@template.public_send name, *args
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
@@ -79,4 +79,4 @@ module Navigator
|
|
79
79
|
[@tag.prefix, @tag.content, @items.compact.join(''), @tag.suffix].compact * ''
|
80
80
|
end
|
81
81
|
end
|
82
|
-
end
|
82
|
+
end
|
data/lib/navigator/tag.rb
CHANGED
@@ -20,9 +20,9 @@ module Navigator
|
|
20
20
|
# Answers the HTML tag prefix (i.e. the opening tag). Example: <li>.
|
21
21
|
def prefix
|
22
22
|
attrs = html_attributes.empty? ? nil : " #{html_attributes}"
|
23
|
-
["<#{@name}", attrs, '>'].compact * ''
|
23
|
+
["<#{@name}", attrs, '>'].compact * ''
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
# Answers the HTML tag suffix (i.e. the closing tag). Example: </li>.
|
27
27
|
def suffix
|
28
28
|
"</#{@name}>"
|
@@ -33,4 +33,4 @@ module Navigator
|
|
33
33
|
[prefix, @content, suffix].compact * ''
|
34
34
|
end
|
35
35
|
end
|
36
|
-
end
|
36
|
+
end
|
data/lib/navigator/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: navigator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -10,164 +10,180 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
13
|
+
MIIDhTCCAm2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQ8wDQYDVQQDDAZicm9v
|
14
|
+
a2UxHDAaBgoJkiaJk/IsZAEZFgxyZWRhbGNoZW1pc3QxEzARBgoJkiaJk/IsZAEZ
|
15
|
+
FgNjb20wHhcNMTMwNjI1MDEzOTUyWhcNMTQwNjI1MDEzOTUyWjBEMQ8wDQYDVQQD
|
16
|
+
DAZicm9va2UxHDAaBgoJkiaJk/IsZAEZFgxyZWRhbGNoZW1pc3QxEzARBgoJkiaJ
|
17
|
+
k/IsZAEZFgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCoICuy
|
18
|
+
DEfASTaScwJxS+wuGY729rx9X6KWktpiee5UT0hSZ8RBum1PU5pfgXdZcZ9rOiGC
|
19
|
+
66qjTN7I08FWpnoz/11M9Wcqd5k1aJXnXeCKRjWmgrnqY2ecbM6CR2OhSIe63l1I
|
20
|
+
wNg9ZTx6h2S8AcdJa2cs1kGO0/NZ5PqKn8ZSFUfByJIIP6ygas7MFIh9EuDs+bTU
|
21
|
+
OVrOAtfC8rZKZ7iFhPwMeRfn4PnR/q0xfK6UXjjr7ES67/qjAbioZaNfubbe+bc7
|
22
|
+
aRcWYGTG8cFuM0PnX4dr2p3ZRXmOYwt+dcZxRZxG099v4IsC0hwttgES64BfDiQc
|
23
|
+
PrqZFq63Lzc/j+eBAgMBAAGjgYEwfzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAd
|
24
|
+
BgNVHQ4EFgQU43tA2HIdqx0YsONzs1fL6z8l4WQwIgYDVR0RBBswGYEXYnJvb2tl
|
25
|
+
QHJlZGFsY2hlbWlzdC5jb20wIgYDVR0SBBswGYEXYnJvb2tlQHJlZGFsY2hlbWlz
|
26
|
+
dC5jb20wDQYJKoZIhvcNAQEFBQADggEBADZi/zTFe3ZJ87QbGmqIadqGeqy27/KZ
|
27
|
+
tIO5rX7kPoFwIdFyW8XekozEPaWDpwRQ/E0LVz1f/7U6VEmp30tpOgXqHS7GkAlz
|
28
|
+
Q1bZjlDMkosXIYd737LfjaQB5YqzoUMWdbPmX5oKXmQMy416GrcLZXW22u5HtrHN
|
29
|
+
AT6fTCYrKaY9LWcugrGU7puOo0itBjLUC0YxtBnDGV8h0Fop9DHQ6gATPweQ7R1j
|
30
|
+
SJpzzzZ8gO6BKn4fhd+ENNQ333Qy3nuNk07TVIaNnlgeHhowUDuD9T7Z8Lka0pt3
|
31
|
+
4PteiTppsf0SSVAM9zSO5IuFngXMRwWgvjOfXE70f43RDuUVTCSyylc=
|
30
32
|
-----END CERTIFICATE-----
|
31
|
-
date:
|
33
|
+
date: 2013-08-13 00:00:00.000000000 Z
|
32
34
|
dependencies:
|
33
35
|
- !ruby/object:Gem::Dependency
|
34
36
|
name: rails
|
35
37
|
requirement: !ruby/object:Gem::Requirement
|
36
38
|
requirements:
|
37
|
-
- -
|
39
|
+
- - ~>
|
38
40
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
41
|
+
version: '4.0'
|
40
42
|
type: :runtime
|
41
43
|
prerelease: false
|
42
44
|
version_requirements: !ruby/object:Gem::Requirement
|
43
45
|
requirements:
|
44
|
-
- -
|
46
|
+
- - ~>
|
45
47
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
48
|
+
version: '4.0'
|
47
49
|
- !ruby/object:Gem::Dependency
|
48
50
|
name: rake
|
49
51
|
requirement: !ruby/object:Gem::Requirement
|
50
52
|
requirements:
|
51
|
-
- -
|
53
|
+
- - '>='
|
52
54
|
- !ruby/object:Gem::Version
|
53
55
|
version: '0'
|
54
56
|
type: :development
|
55
57
|
prerelease: false
|
56
58
|
version_requirements: !ruby/object:Gem::Requirement
|
57
59
|
requirements:
|
58
|
-
- -
|
60
|
+
- - '>='
|
59
61
|
- !ruby/object:Gem::Version
|
60
62
|
version: '0'
|
61
63
|
- !ruby/object:Gem::Dependency
|
62
64
|
name: pry
|
63
65
|
requirement: !ruby/object:Gem::Requirement
|
64
66
|
requirements:
|
65
|
-
- -
|
67
|
+
- - '>='
|
66
68
|
- !ruby/object:Gem::Version
|
67
69
|
version: '0'
|
68
70
|
type: :development
|
69
71
|
prerelease: false
|
70
72
|
version_requirements: !ruby/object:Gem::Requirement
|
71
73
|
requirements:
|
72
|
-
- -
|
74
|
+
- - '>='
|
73
75
|
- !ruby/object:Gem::Version
|
74
76
|
version: '0'
|
75
77
|
- !ruby/object:Gem::Dependency
|
76
|
-
name: pry-
|
78
|
+
name: pry-byebug
|
77
79
|
requirement: !ruby/object:Gem::Requirement
|
78
80
|
requirements:
|
79
|
-
- -
|
81
|
+
- - '>='
|
80
82
|
- !ruby/object:Gem::Version
|
81
83
|
version: '0'
|
82
84
|
type: :development
|
83
85
|
prerelease: false
|
84
86
|
version_requirements: !ruby/object:Gem::Requirement
|
85
87
|
requirements:
|
86
|
-
- -
|
88
|
+
- - '>='
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: pry-rescue
|
93
|
+
requirement: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
type: :development
|
99
|
+
prerelease: false
|
100
|
+
version_requirements: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - '>='
|
87
103
|
- !ruby/object:Gem::Version
|
88
104
|
version: '0'
|
89
105
|
- !ruby/object:Gem::Dependency
|
90
106
|
name: pry-stack_explorer
|
91
107
|
requirement: !ruby/object:Gem::Requirement
|
92
108
|
requirements:
|
93
|
-
- -
|
109
|
+
- - '>='
|
94
110
|
- !ruby/object:Gem::Version
|
95
111
|
version: '0'
|
96
112
|
type: :development
|
97
113
|
prerelease: false
|
98
114
|
version_requirements: !ruby/object:Gem::Requirement
|
99
115
|
requirements:
|
100
|
-
- -
|
116
|
+
- - '>='
|
101
117
|
- !ruby/object:Gem::Version
|
102
118
|
version: '0'
|
103
119
|
- !ruby/object:Gem::Dependency
|
104
120
|
name: pry-vterm_aliases
|
105
121
|
requirement: !ruby/object:Gem::Requirement
|
106
122
|
requirements:
|
107
|
-
- -
|
123
|
+
- - '>='
|
108
124
|
- !ruby/object:Gem::Version
|
109
125
|
version: '0'
|
110
126
|
type: :development
|
111
127
|
prerelease: false
|
112
128
|
version_requirements: !ruby/object:Gem::Requirement
|
113
129
|
requirements:
|
114
|
-
- -
|
130
|
+
- - '>='
|
115
131
|
- !ruby/object:Gem::Version
|
116
132
|
version: '0'
|
117
133
|
- !ruby/object:Gem::Dependency
|
118
134
|
name: rspec-rails
|
119
135
|
requirement: !ruby/object:Gem::Requirement
|
120
136
|
requirements:
|
121
|
-
- -
|
137
|
+
- - '>='
|
122
138
|
- !ruby/object:Gem::Version
|
123
139
|
version: '0'
|
124
140
|
type: :development
|
125
141
|
prerelease: false
|
126
142
|
version_requirements: !ruby/object:Gem::Requirement
|
127
143
|
requirements:
|
128
|
-
- -
|
144
|
+
- - '>='
|
129
145
|
- !ruby/object:Gem::Version
|
130
146
|
version: '0'
|
131
147
|
- !ruby/object:Gem::Dependency
|
132
148
|
name: rb-fsevent
|
133
149
|
requirement: !ruby/object:Gem::Requirement
|
134
150
|
requirements:
|
135
|
-
- -
|
151
|
+
- - '>='
|
136
152
|
- !ruby/object:Gem::Version
|
137
153
|
version: '0'
|
138
154
|
type: :development
|
139
155
|
prerelease: false
|
140
156
|
version_requirements: !ruby/object:Gem::Requirement
|
141
157
|
requirements:
|
142
|
-
- -
|
158
|
+
- - '>='
|
143
159
|
- !ruby/object:Gem::Version
|
144
160
|
version: '0'
|
145
161
|
- !ruby/object:Gem::Dependency
|
146
162
|
name: rb-inotify
|
147
163
|
requirement: !ruby/object:Gem::Requirement
|
148
164
|
requirements:
|
149
|
-
- -
|
165
|
+
- - '>='
|
150
166
|
- !ruby/object:Gem::Version
|
151
167
|
version: '0'
|
152
168
|
type: :development
|
153
169
|
prerelease: false
|
154
170
|
version_requirements: !ruby/object:Gem::Requirement
|
155
171
|
requirements:
|
156
|
-
- -
|
172
|
+
- - '>='
|
157
173
|
- !ruby/object:Gem::Version
|
158
174
|
version: '0'
|
159
175
|
- !ruby/object:Gem::Dependency
|
160
176
|
name: guard-rspec
|
161
177
|
requirement: !ruby/object:Gem::Requirement
|
162
178
|
requirements:
|
163
|
-
- -
|
179
|
+
- - '>='
|
164
180
|
- !ruby/object:Gem::Version
|
165
181
|
version: '0'
|
166
182
|
type: :development
|
167
183
|
prerelease: false
|
168
184
|
version_requirements: !ruby/object:Gem::Requirement
|
169
185
|
requirements:
|
170
|
-
- -
|
186
|
+
- - '>='
|
171
187
|
- !ruby/object:Gem::Version
|
172
188
|
version: '0'
|
173
189
|
description: Enhances Rails with a DSL for menu navigation complete with sub-menus,
|
@@ -176,18 +192,16 @@ email: brooke@redalchemist.com
|
|
176
192
|
executables: []
|
177
193
|
extensions: []
|
178
194
|
extra_rdoc_files:
|
179
|
-
- README.
|
180
|
-
-
|
181
|
-
- LICENSE.rdoc
|
195
|
+
- README.md
|
196
|
+
- LICENSE.md
|
182
197
|
files:
|
183
|
-
- CHANGELOG.rdoc
|
184
|
-
- LICENSE.rdoc
|
185
|
-
- README.rdoc
|
186
|
-
- lib/navigator.rb
|
187
198
|
- lib/navigator/action_view/instance_methods.rb
|
188
199
|
- lib/navigator/menu.rb
|
189
200
|
- lib/navigator/tag.rb
|
190
201
|
- lib/navigator/version.rb
|
202
|
+
- lib/navigator.rb
|
203
|
+
- README.md
|
204
|
+
- LICENSE.md
|
191
205
|
homepage: http://www.redalchemist.com
|
192
206
|
licenses:
|
193
207
|
- MIT
|
@@ -198,16 +212,17 @@ require_paths:
|
|
198
212
|
- lib
|
199
213
|
required_ruby_version: !ruby/object:Gem::Requirement
|
200
214
|
requirements:
|
201
|
-
- -
|
215
|
+
- - ~>
|
202
216
|
- !ruby/object:Gem::Version
|
203
|
-
version:
|
217
|
+
version: 2.0.0
|
204
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
219
|
requirements:
|
206
|
-
- -
|
220
|
+
- - '>='
|
207
221
|
- !ruby/object:Gem::Version
|
208
222
|
version: '0'
|
209
223
|
requirements: []
|
210
|
-
|
224
|
+
rubyforge_project:
|
225
|
+
rubygems_version: 2.0.6
|
211
226
|
signing_key:
|
212
227
|
specification_version: 4
|
213
228
|
summary: Enhances Rails with a DSL for menu navigation.
|
metadata.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.rdoc
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
= 0.2.1 (2021-08-03)
|
2
|
-
|
3
|
-
Updated gemspec to support Ruby 2.0.x
|
4
|
-
|
5
|
-
= v0.2.0
|
6
|
-
|
7
|
-
* Added Twitter Bootstrap navigation menu example.
|
8
|
-
* Switched gem dependency to Rails 3.x.x range.
|
9
|
-
* Added Guard support.
|
10
|
-
* Converted/detailed the CONTRIBUTING guidelines per GitHub requirements.
|
11
|
-
* Added spec focus capability.
|
12
|
-
* Added Gem Badge support.
|
13
|
-
* Added Code Climate support.
|
14
|
-
* Added Campfire notification support.
|
15
|
-
* Switched from HTTP to HTTPS when sourcing from RubyGems.
|
16
|
-
* Added Pry development support.
|
17
|
-
* Cleaned up Guard gem dependency requirements.
|
18
|
-
* Added 'tmp' directory to .gitignore.
|
19
|
-
* Cleaned up requirement path syntax.
|
20
|
-
|
21
|
-
= v0.1.0
|
22
|
-
|
23
|
-
* Initial version.
|
data/README.rdoc
DELETED
@@ -1,126 +0,0 @@
|
|
1
|
-
= Overview
|
2
|
-
|
3
|
-
{<img src="https://badge.fury.io/rb/navigator.png" alt="Gem Version" />}[http://badge.fury.io/rb/navigator]
|
4
|
-
{<img src="https://codeclimate.com/github/bkuhlmann/navigator.png" alt="Code Climate GPA" />}[https://codeclimate.com/github/bkuhlmann/navigator]
|
5
|
-
{<img src="https://secure.travis-ci.org/bkuhlmann/navigator.png" alt="Travis CI Status" />}[http://travis-ci.org/bkuhlmann/navigator]
|
6
|
-
|
7
|
-
Enhances Rails with a DSL for menu navigation.
|
8
|
-
|
9
|
-
= Features
|
10
|
-
|
11
|
-
* A simple DSL for creating navigation menus.
|
12
|
-
* Supports sub-menus, nested tags, HTML attributes, etc.
|
13
|
-
* Supports the following HTML tags: ul, li, a, b, em, s, small, span, strong, sub, and sup.
|
14
|
-
* Provides the "item" convenience method which combines the "li" and "a" HTML tags into a single method for less typing.
|
15
|
-
|
16
|
-
= Requirements
|
17
|
-
|
18
|
-
1. {Ruby 2.0.x}[http://www.ruby-lang.org].
|
19
|
-
2. {Ruby on Rails 3.2.x}[http://rubyonrails.org].
|
20
|
-
|
21
|
-
= Setup
|
22
|
-
|
23
|
-
Type the following from the command line to install:
|
24
|
-
|
25
|
-
gem install navigator
|
26
|
-
|
27
|
-
Add the following to your Gemfile:
|
28
|
-
|
29
|
-
gem "navigator"
|
30
|
-
|
31
|
-
= Usage
|
32
|
-
|
33
|
-
The following are examples using the render_navigation view helper:
|
34
|
-
|
35
|
-
== Unordered List (simple)
|
36
|
-
|
37
|
-
render_navigation do
|
38
|
-
item "Dashboard", "/dashboard"
|
39
|
-
item "News", "/posts"
|
40
|
-
end
|
41
|
-
|
42
|
-
Yields:
|
43
|
-
|
44
|
-
<ul>
|
45
|
-
<li><a href="/dashboard">Dashboard</a></li>
|
46
|
-
<li><a href="/posts">Posts</a></li>
|
47
|
-
</ul>
|
48
|
-
|
49
|
-
== Unordered List (with attributes)
|
50
|
-
|
51
|
-
render_navigation "ul", class: "nav" do
|
52
|
-
item "Dashboard", "/dashboard", class: "active"
|
53
|
-
item "News", "/posts"
|
54
|
-
end
|
55
|
-
|
56
|
-
Yields:
|
57
|
-
|
58
|
-
<ul class="nav">
|
59
|
-
<li class="active"><a href="/dashboard">Dashboard</a></li>
|
60
|
-
<li><a href="/posts">Posts</a></li>
|
61
|
-
</ul>
|
62
|
-
|
63
|
-
== Nav (with links)
|
64
|
-
|
65
|
-
render_navigation "nav" do
|
66
|
-
a "Dashboard", href: "/dashboard"
|
67
|
-
a "News", href: "/posts"
|
68
|
-
end
|
69
|
-
|
70
|
-
Yields:
|
71
|
-
|
72
|
-
<nav>
|
73
|
-
<a href="/dashboard">Dashboard</a>
|
74
|
-
<a href="/posts">Posts</a>
|
75
|
-
</nav>
|
76
|
-
|
77
|
-
== Twitter Bootstrap Dropdown
|
78
|
-
|
79
|
-
li nil, class: "dropdown" do
|
80
|
-
a "Manage", href: "#", class: "dropdown-toggle", "data-toggle" => "dropdown" do
|
81
|
-
b nil, class: "caret"
|
82
|
-
end
|
83
|
-
ul nil, class: "dropdown-menu" do
|
84
|
-
item "Dashboard", admin_dashboard_path
|
85
|
-
item "Users", admin_users_path
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
Yields:
|
90
|
-
|
91
|
-
<ul class="nav">
|
92
|
-
<li><a href="/en-US/admin/dashboard">Dashboard</a></li>
|
93
|
-
<li class="dropdown">
|
94
|
-
<a data-toggle="dropdown" class="dropdown-toggle" href="#">Manage<b class="caret"></b></a>
|
95
|
-
<ul class="dropdown-menu">
|
96
|
-
<li><a href="/admin/dashboard">Dashboard</a></li>
|
97
|
-
<li><a href="/admin/users">Users</a></li>
|
98
|
-
</ul>
|
99
|
-
</li>
|
100
|
-
</ul>
|
101
|
-
|
102
|
-
= Tests
|
103
|
-
|
104
|
-
To test, do the following:
|
105
|
-
|
106
|
-
1. cd to the gem root.
|
107
|
-
2. bundle install
|
108
|
-
3. bundle exec rspec spec
|
109
|
-
|
110
|
-
= Contributions
|
111
|
-
|
112
|
-
Read CONTRIBUTING for details.
|
113
|
-
|
114
|
-
= Credits
|
115
|
-
|
116
|
-
Developed by {Brooke Kuhlmann}[http://www.redalchemist.com] at {Red Alchemist}[http://www.redalchemist.com]
|
117
|
-
|
118
|
-
= License
|
119
|
-
|
120
|
-
Copyright (c) 2012 {Red Alchemist}[http://www.redalchemist.com].
|
121
|
-
Read the LICENSE for details.
|
122
|
-
|
123
|
-
= History
|
124
|
-
|
125
|
-
Read the CHANGELOG for details.
|
126
|
-
Built with Gemsmith[https://github.com/bkuhlmann/gemsmith].
|