rails_nav 2.6.0 → 2.7.0

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.
Files changed (4) hide show
  1. data/lib/rails_nav.rb +8 -6
  2. data/rails_nav.gemspec +1 -1
  3. metadata +14 -5
  4. checksums.yaml +0 -15
data/lib/rails_nav.rb CHANGED
@@ -7,7 +7,7 @@
7
7
  ##
8
8
  #
9
9
  def Nav.version()
10
- '2.6.0'
10
+ '2.7.0'
11
11
  end
12
12
 
13
13
  def Nav.dependencies
@@ -115,6 +115,8 @@
115
115
  end
116
116
 
117
117
  def compute_active!
118
+ nav = self
119
+
118
120
  unless empty?
119
121
  weights = []
120
122
 
@@ -140,7 +142,7 @@
140
142
  weights[index] = weight
141
143
  end
142
144
 
143
- self.weights = weights
145
+ nav.weights = weights
144
146
 
145
147
  each_with_index do |link, index|
146
148
  link.active = false
@@ -159,19 +161,19 @@
159
161
  if no_clear_winner
160
162
  detect{|link| link.default}
161
163
  else
162
- most_active_link_index = weights.index(weights.max)
163
- self[most_active_link_index]
164
+ max = weights.max
165
+ longest_matching_link = select{|link| link.weight == max}.sort{|a,b| a.content.size <=> b.content.size}.last
164
166
  end
165
167
 
166
168
  if active_link
167
169
  active_link.active = true
168
- self.active = active_link
170
+ nav.active = active_link
169
171
  end
170
172
 
171
173
  @already_computed_active = true
172
174
  end
173
175
 
174
- self
176
+ nav
175
177
  end
176
178
 
177
179
  def compute_active
data/rails_nav.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification::new do |spec|
5
5
  spec.name = "rails_nav"
6
- spec.version = "2.6.0"
6
+ spec.version = "2.7.0"
7
7
  spec.platform = Gem::Platform::RUBY
8
8
  spec.summary = "rails_nav"
9
9
  spec.description = "declarative navigation for rails applications"
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_nav
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Ara T. Howard
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-07-10 00:00:00.000000000 Z
12
+ date: 2016-09-07 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rails_current
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ! '>='
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ! '>='
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rails_helper
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ! '>='
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ! '>='
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: map
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ! '>='
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ! '>='
53
60
  - !ruby/object:Gem::Version
@@ -65,25 +72,27 @@ files:
65
72
  homepage: https://github.com/ahoward/rails_nav
66
73
  licenses:
67
74
  - same as ruby's
68
- metadata: {}
69
75
  post_install_message:
70
76
  rdoc_options: []
71
77
  require_paths:
72
78
  - lib
73
79
  required_ruby_version: !ruby/object:Gem::Requirement
80
+ none: false
74
81
  requirements:
75
82
  - - ! '>='
76
83
  - !ruby/object:Gem::Version
77
84
  version: '0'
78
85
  required_rubygems_version: !ruby/object:Gem::Requirement
86
+ none: false
79
87
  requirements:
80
88
  - - ! '>='
81
89
  - !ruby/object:Gem::Version
82
90
  version: '0'
83
91
  requirements: []
84
92
  rubyforge_project: codeforpeople
85
- rubygems_version: 2.0.3
93
+ rubygems_version: 1.8.23.2
86
94
  signing_key:
87
- specification_version: 4
95
+ specification_version: 3
88
96
  summary: rails_nav
89
97
  test_files: []
98
+ has_rdoc:
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NjAwZWFiOWZiYjJlMDJmODU0MTcxMzdhMjJlZjdjNzBhMmUzNTY4YQ==
5
- data.tar.gz: !binary |-
6
- MGMxOTdiOGMzNGUxODhhNzUyYmMzODBkYmU2MGJlODE3OGFjNzBlNg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MDA0MDZlYzdlMjZhOGIzNjhlNjUzYTk2ZTJmMGJkMzBlOTI3YjdmMmZhNDBm
10
- ZGYzYWU0ZTVmNmJhNTVkZGE5NzFmYTgyZmQyMjc5NWNkYTU2YTQ0MTIyYzc0
11
- NTkwOGU4YjRjNjIyNGJiNzFiM2UwNjcwYTZkZWZkMWY3OTA1ODc=
12
- data.tar.gz: !binary |-
13
- NmQ0ZjBiM2RmZjJiYzNjM2ZiZDdjMzEwZGE1YzAzNjZjZDJhNTUzMWZmYzIz
14
- MzU0YThiNzM0OTk5OTI5ZGIwMDg1OTM0NDAxYThiNDMzMzMzYTNhZDc3N2Ew
15
- MGJkNmVjNjIxMGY4ZjVlYzQ1YzMzYTJkMTJlZmNiNDlhOWU3MGE=