simple_navigation 1.3 → 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.
data.tar.gz.sig ADDED
@@ -0,0 +1 @@
1
+ �r�q ���j�U���!���T�����b��� k�ю��6ϕg�{��lF�e� ��(�2���>}����I2��F��ϓR�n܃61:^� L�jV�5�|��j�ǧ2���i<����Ү%-{}$�eI�C���s �U��!w`3Ll�Pl:~I�q�n7�,����(���ӧ��5g��E���yM�H�2�¿4Yl8�@RQf^Q�`�:ƐzVD�1�=�Mc ����B�PM߰W�U)Z �4
data/Rakefile CHANGED
@@ -2,8 +2,8 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('simple_navigation', '1.3') do |e|
6
- e.description = "Easy navigation menu gem for Ruby on Rails"
5
+ Echoe.new('simple_navigation', '1.4') do |e|
6
+ e.description = "Simple navigation menu gem for Ruby on Rails"
7
7
  e.url = "http://github.com/mexpolk/simple_navigation"
8
8
  e.author = "Ivan Torres"
9
9
  e.email = "mexpolk@gmail.com"
@@ -12,50 +12,40 @@ module SimpleNavigation
12
12
  # Reset current menu
13
13
  self.current_menu_id = nil
14
14
 
15
- html_attributes = { :id => navigation[:id],
16
- :class => 'simple_navigation', :depth => 0 }
15
+ html_attrs = { :id => navigation[:id], :class => 'simple_navigation' }
16
+ html_attrs[:class] << " #{navigation[:class]}" if navigation.has_key?(:class)
17
17
 
18
18
  # Render root menus
19
- content_tag(:ul,
20
- navigation[:menus].map{ |menu| render_menu(menu, :depth => 0) },
21
- html_attributes)
19
+ content_tag(:ul, navigation[:menus].map{ |menu| render_menu(menu) }, html_attrs)
22
20
 
23
21
  end # simple_navigation(name)
24
22
 
25
23
  def render_menu(menu, options = {})
26
24
 
27
25
  # Set default html attributes
28
- list_html_attributes = { :id => [menu[:id], 'menus'].join('_'), :depth => 0 }
29
- menu_html_attributes = { :id => menu[:id], :drop_down => false, :class => 'menu' }
30
-
31
- # Detect menu depth
32
- list_html_attributes[:depth] = options[:depth] + 1 if options.has_key?(:depth)
33
-
34
- # Detect if has submenus
35
- menu_html_attributes.merge!(:drop_down => true) if menu.has_key?(:menus)
26
+ html_attrs = { :id => menu[:id] }
27
+ html_attrs[:class] = menu[:class] if menu.has_key?(:class)
36
28
 
37
29
  # Render submenus first so we can detect if current menu
38
30
  # is between child menu's
39
31
  menus = ''
40
32
  menus = content_tag(:ul,
41
- menu[:menus].map{ |child| render_menu(child, options) },
42
- list_html_attributes) if
43
- menu.has_key?(:menus)
33
+ menu[:menus].map{ |child| render_menu(child, options) }) if menu.has_key?(:menus)
44
34
 
45
35
  # Is this menu is the current?
46
36
  if current_menu?(menu)
47
- menu_html_attributes[:class] << ' current'
37
+ html_attrs[:class] << ' current'
48
38
  self.current_menu_id = menu[:id]
49
39
  # Is the current menu under this menu?
50
40
  elsif self.current_menu_id
51
- menu_html_attributes[:class] << ' current_child' if
41
+ html_attrs[:class] << ' current' if
52
42
  self.current_menu_id.to_s.match(/^#{menu[:id]}/)
53
43
  end
54
44
 
55
45
  # Render menu
56
46
  content_tag(:li,
57
47
  render_menu_title(menu) + menus,
58
- menu_html_attributes)
48
+ html_attrs)
59
49
 
60
50
  end # render_menu(menu)
61
51
 
@@ -75,8 +65,8 @@ module SimpleNavigation
75
65
  end
76
66
  end
77
67
  if menu.has_key?(:url)
78
- title = link_to(title, url_for(menu[:url]))
79
- else
68
+ title = link_to(title, url_for(menu[:url]))
69
+ else
80
70
  title = content_tag(:span, title)
81
71
  end
82
72
  title
@@ -103,6 +93,7 @@ module SimpleNavigation
103
93
  end
104
94
  current
105
95
  end # current_menu?
96
+
106
97
  end # Helper
107
98
 
108
99
  class Configuration
@@ -147,7 +138,7 @@ module SimpleNavigation
147
138
  def initialize(name, options = {})
148
139
  options.merge!(:i18n => false) unless options.has_key?(:i18n)
149
140
  self.translation = ['simple_navigation', name].join('.')
150
- self.id = ['simple_navigation', name].join('_')
141
+ self.id = name
151
142
  self.menus = []
152
143
  self.name = name
153
144
  self.options = options
@@ -2,12 +2,13 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{simple_navigation}
5
- s.version = "1.3"
5
+ s.version = "1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Ivan Torres"]
9
- s.date = %q{2009-12-15}
10
- s.description = %q{Easy navigation menu gem for Ruby on Rails}
9
+ s.cert_chain = ["/Users/ivan/.ssh/gem-public_cert.pem"]
10
+ s.date = %q{2010-09-23}
11
+ s.description = %q{Simple navigation menu gem for Ruby on Rails}
11
12
  s.email = %q{mexpolk@gmail.com}
12
13
  s.extra_rdoc_files = ["README.rdoc", "lib/simple_navigation.rb"]
13
14
  s.files = ["Manifest", "README.rdoc", "Rakefile", "init.rb", "lib/simple_navigation.rb", "simple_navigation.gemspec"]
@@ -15,14 +16,15 @@ Gem::Specification.new do |s|
15
16
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Simple_navigation", "--main", "README.rdoc"]
16
17
  s.require_paths = ["lib"]
17
18
  s.rubyforge_project = %q{simple_navigation}
18
- s.rubygems_version = %q{1.3.5}
19
- s.summary = %q{Easy navigation menu gem for Ruby on Rails}
19
+ s.rubygems_version = %q{1.3.7}
20
+ s.signing_key = %q{/Users/ivan/.ssh/gem-private_key.pem}
21
+ s.summary = %q{Simple navigation menu gem for Ruby on Rails}
20
22
 
21
23
  if s.respond_to? :specification_version then
22
24
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
25
  s.specification_version = 3
24
26
 
25
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
27
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
28
  else
27
29
  end
28
30
  else
metadata CHANGED
@@ -1,19 +1,45 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_navigation
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.3"
4
+ hash: 7
5
+ prerelease: false
6
+ segments:
7
+ - 1
8
+ - 4
9
+ version: "1.4"
5
10
  platform: ruby
6
11
  authors:
7
12
  - Ivan Torres
8
13
  autorequire:
9
14
  bindir: bin
10
- cert_chain: []
15
+ cert_chain:
16
+ - |
17
+ -----BEGIN CERTIFICATE-----
18
+ MIIDMDCCAhigAwIBAgIBADANBgkqhkiG9w0BAQUFADA+MRAwDgYDVQQDDAdtZXhw
19
+ b2xrMRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZFgNjb20w
20
+ HhcNMTAwOTIzMTYzODI3WhcNMTEwOTIzMTYzODI3WjA+MRAwDgYDVQQDDAdtZXhw
21
+ b2xrMRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZFgNjb20w
22
+ ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDS4zDOIsDwqhcJFGH1Cs0S
23
+ BCp0fEo68xB+4jPoqG5mxqo94//FA3XhKqlvCgqpf4bGXLycHu42W7AlzaFFZ/SL
24
+ z77hvNgLPrA5EmcVg92ydhjMgnIMzJ/ksM0bNNPAH7GhBxl+HPYP7Dkx4U5F0/hz
25
+ xw2MLPIDSV/je0aomK9LWoHpSfCbr5/YBaDbairHcR8yJ87UVo4rqs1tamSle0iU
26
+ 6LnNCljLa1vSBHOeZOW/i28Go02qqDCPYHr6NPw/dd+jqlO+fqvnH9dlmeUknAso
27
+ terNme2M56MW5fZ8ORj2YKVC7IJnVT4mBCwgkJSVFBCX+TprJbrEYAHObPqLHTYl
28
+ AgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQLQeOW
29
+ xCxK39VboHu0bOm2hHFJfDANBgkqhkiG9w0BAQUFAAOCAQEAtRlYI7JfoRo88U6C
30
+ ay1YFkceNeJolb8yJcuGKiFvpjOmd4yoai5rj44UBq/k4mrZSYVq+r7ZMotAC4zq
31
+ b0nt+cBmpYxX/yXpEi+1MpVBewoq3XsVqJ+RKMcIn3z0DtdRqCGsBH6MO/EoQK7A
32
+ B3tuPCW0jZ7WlChY2eu/ygbtsa/Ik7iZyBiykZVfw/bXLuhlwKh/4NoIYERHckuP
33
+ FQhG9HbmCEnmAw9e6YytIrQDqp0hiRAJAFsO7xwhvV0J9DEtIjoVhST+DxMJv7ey
34
+ ffB/5PGg058D8Xm4rzXkzFrU+m14EtW4nc2/e09NXrF/PuFiurPvMr47qHqYzrPF
35
+ MKLC1g==
36
+ -----END CERTIFICATE-----
11
37
 
12
- date: 2009-12-15 00:00:00 -06:00
38
+ date: 2010-09-23 00:00:00 -05:00
13
39
  default_executable:
14
40
  dependencies: []
15
41
 
16
- description: Easy navigation menu gem for Ruby on Rails
42
+ description: Simple navigation menu gem for Ruby on Rails
17
43
  email: mexpolk@gmail.com
18
44
  executables: []
19
45
 
@@ -44,23 +70,30 @@ rdoc_options:
44
70
  require_paths:
45
71
  - lib
46
72
  required_ruby_version: !ruby/object:Gem::Requirement
73
+ none: false
47
74
  requirements:
48
75
  - - ">="
49
76
  - !ruby/object:Gem::Version
77
+ hash: 3
78
+ segments:
79
+ - 0
50
80
  version: "0"
51
- version:
52
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
+ none: false
53
83
  requirements:
54
84
  - - ">="
55
85
  - !ruby/object:Gem::Version
86
+ hash: 11
87
+ segments:
88
+ - 1
89
+ - 2
56
90
  version: "1.2"
57
- version:
58
91
  requirements: []
59
92
 
60
93
  rubyforge_project: simple_navigation
61
- rubygems_version: 1.3.5
94
+ rubygems_version: 1.3.7
62
95
  signing_key:
63
96
  specification_version: 3
64
- summary: Easy navigation menu gem for Ruby on Rails
97
+ summary: Simple navigation menu gem for Ruby on Rails
65
98
  test_files: []
66
99
 
metadata.gz.sig ADDED
@@ -0,0 +1 @@
1
+ t0�K���8��'4�4��k>��Q��j�οl���Y�wz��&����^L�ln��5w�;�%UB͈%�Aݯ$�A� qT��~�봶���"�i�U~��&.��0�Px<e�n��RX�h{�b��� ��(2�&Z����