semantic_navigation 0.1.3 → 0.1.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 +15 -0
- data/TODO +5 -0
- data/lib/semantic_navigation/core/base.rb +4 -2
- data/lib/semantic_navigation/version.rb +1 -1
- data/spec/lib/semantic_navigation/core/leaf_spec.rb +7 -0
- metadata +5 -21
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MWNmMmQxYWZiZmUwMjZjYzgxYjlhMGYwODg2OGFhMDgxZDFjYjc0Yw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZTA1ODBlZTdkNmFlYjU2ZWMzMDM2ZjgwYjcyYjBjNGNhNjU0M2FmOA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
N2M0ZGY1NjNhN2Y0NzJiZWUyOWUwMjU3YTQ0MzZjNGQxZTNiNWJjMGFjY2Y3
|
10
|
+
NzI0ZTIyMTAxZGVkYTdlYzQ4NTQ1N2ZmZTU2NTIyMDNjODBhOWQ2ZTRmNWZm
|
11
|
+
MzUyYzdjMGZjM2M4MGFlZGFjYTAyNDQ0ZjZmNzllNjQwYWNiNzQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YTRiZjNlYmJkOTQ3ZGYzMzkyNzk0Zjg2NzgzMGQwNTc5OWM5YTI1NTcxYzMy
|
14
|
+
NzE1OGIxOTZiZjNlNTEwYTE0YWIzOWM0YWMwNDQ3NTY5YjA2Yzc5MDY4ZThj
|
15
|
+
MTE1YmUzMWI3ZDhhODNlOTU2YWY4NDE5NmMwNTFiNDM2YTBmZDU=
|
data/TODO
CHANGED
@@ -8,6 +8,11 @@ Concept:
|
|
8
8
|
- Add renderers for other template frameworks
|
9
9
|
- Move bootstrap renderers to bootstrap version 4.0.0
|
10
10
|
- Possible to make dynamic items in menu (database or something else)
|
11
|
+
- Pattern routes, can accept Proc
|
12
|
+
- scope can set default url params
|
13
|
+
- active_if method, can accept Proc
|
14
|
+
- add possibility for routes like {controller: 'some_controller', actions: ['index', 'new', 'create']}, or
|
15
|
+
"some_controller#(index|new|create)"
|
11
16
|
|
12
17
|
Convention over configuration:
|
13
18
|
- Move menu definitions outside the initializers folder
|
@@ -29,9 +29,11 @@ module SemanticNavigation
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def current_page?(options = {})
|
32
|
-
|
32
|
+
result = true
|
33
33
|
if options.is_a? Hash
|
34
|
-
options.
|
34
|
+
opts = options.dup
|
35
|
+
opts[:controller] = opts[:controller].to_s[1..-1] if opts[:controller] && opts[:controller][0] == '/'
|
36
|
+
opts.each do |key, value|
|
35
37
|
result &= (view_object.params[key.to_sym].to_s == value.to_s)
|
36
38
|
end
|
37
39
|
else
|
@@ -95,6 +95,13 @@ describe SemanticNavigation::Core::Leaf do
|
|
95
95
|
|
96
96
|
context :marked do
|
97
97
|
|
98
|
+
it 'as active even if controller name starts from `/`' do
|
99
|
+
leaf = SemanticNavigation::Core::Leaf.new({url: {controller: '/first', action: 'index'}}, 1)
|
100
|
+
@view_object.stub(:params).and_return({controller: 'first', action: 'index'})
|
101
|
+
leaf.mark_active.should be_true
|
102
|
+
leaf.active.should be_true
|
103
|
+
end
|
104
|
+
|
98
105
|
it 'as active if have active url with symbol names' do
|
99
106
|
leaf = SemanticNavigation::Core::Leaf.new({:url => {:controller => :first, :action => :index}}, 1)
|
100
107
|
@view_object.stub(:params).and_return({:controller => 'first', :action => 'index'})
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_navigation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Sergey Gribovski
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-12-17 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ! '>='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: simplecov
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ! '>='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ! '>='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: appraisal
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ! '>='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ! '>='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rails
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ! '>='
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ! '>='
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -144,33 +135,26 @@ files:
|
|
144
135
|
- spec/spec_helper.rb
|
145
136
|
homepage: https://github.com/fr33z3/semantic_navigation
|
146
137
|
licenses: []
|
138
|
+
metadata: {}
|
147
139
|
post_install_message:
|
148
140
|
rdoc_options: []
|
149
141
|
require_paths:
|
150
142
|
- lib
|
151
143
|
required_ruby_version: !ruby/object:Gem::Requirement
|
152
|
-
none: false
|
153
144
|
requirements:
|
154
145
|
- - ! '>='
|
155
146
|
- !ruby/object:Gem::Version
|
156
147
|
version: '0'
|
157
|
-
segments:
|
158
|
-
- 0
|
159
|
-
hash: -52167356157994890
|
160
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
149
|
requirements:
|
163
150
|
- - ! '>='
|
164
151
|
- !ruby/object:Gem::Version
|
165
152
|
version: '0'
|
166
|
-
segments:
|
167
|
-
- 0
|
168
|
-
hash: -52167356157994890
|
169
153
|
requirements: []
|
170
154
|
rubyforge_project: semantic_navigation
|
171
|
-
rubygems_version: 1.
|
155
|
+
rubygems_version: 2.1.9
|
172
156
|
signing_key:
|
173
|
-
specification_version:
|
157
|
+
specification_version: 4
|
174
158
|
summary: Make the navigation in your Rails app by several lines
|
175
159
|
test_files:
|
176
160
|
- spec/lib/semantic_navigation/configuration_spec.rb
|