rails_nav 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rails_nav.rb +26 -24
- data/rails_nav.gemspec +1 -1
- metadata +5 -5
data/lib/rails_nav.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
##
|
5
5
|
#
|
6
6
|
def Nav.version()
|
7
|
-
'1.0.
|
7
|
+
'1.0.1'
|
8
8
|
end
|
9
9
|
|
10
10
|
def Nav.dependencies
|
@@ -65,34 +65,36 @@
|
|
65
65
|
##
|
66
66
|
#
|
67
67
|
def compute_active!
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
link
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
68
|
+
unless empty?
|
69
|
+
weights = []
|
70
|
+
|
71
|
+
each_with_index do |link, index|
|
72
|
+
link.controller = @controller
|
73
|
+
active = link.compute_active!
|
74
|
+
|
75
|
+
weights[index] =
|
76
|
+
case active
|
77
|
+
when nil, false
|
78
|
+
-1
|
79
|
+
when true
|
80
|
+
0
|
81
|
+
else
|
82
|
+
Integer(active)
|
83
|
+
end
|
84
|
+
end
|
84
85
|
|
85
|
-
|
86
|
-
|
87
|
-
|
86
|
+
each_with_index do |link, index|
|
87
|
+
link.active = false
|
88
|
+
end
|
89
|
+
|
90
|
+
active_link = self[weights.index(weights.max)]
|
88
91
|
|
89
|
-
|
92
|
+
active_link.active = true
|
90
93
|
|
91
|
-
|
94
|
+
@already_computed_active = true
|
95
|
+
end
|
92
96
|
|
93
97
|
self
|
94
|
-
ensure
|
95
|
-
@already_computed_active = true
|
96
98
|
end
|
97
99
|
|
98
100
|
def compute_active
|
data/rails_nav.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_nav
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-03-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails_current
|
16
|
-
requirement: &
|
16
|
+
requirement: &70198040784780 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.6'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70198040784780
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rails_helper
|
27
|
-
requirement: &
|
27
|
+
requirement: &70198040604960 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '1.2'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70198040604960
|
36
36
|
description: ! 'description: rails_nav kicks the ass'
|
37
37
|
email: ara.t.howard@gmail.com
|
38
38
|
executables: []
|