activemenu 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51d11e38637d249f618d8dbf23bece1b45ae651a
4
- data.tar.gz: 6807d881dd022660e1da7ef9c9dc54580bc7d04d
3
+ metadata.gz: b8558f5943cf6c95a8b783b3295c5282d861dcb9
4
+ data.tar.gz: b4a62ed3d275d52ee36dc612806523791b15448f
5
5
  SHA512:
6
- metadata.gz: 037342b6f525a12049b8a5c47755ed2d9b850fb9bfa0604da17b3abce1f4ff6b8c061c296d619c0d1e20211076ac57ede3920dc8df11468935912feb654d028e
7
- data.tar.gz: 84e5c66118e5cf2d2fdd87bd314e1d696575cbc99a52c5a6b198a325aca51be0a1bdbcfc611bea727f87cb524a703d4730823fede5e32dcfe8fc78d9a1a4f165
6
+ metadata.gz: 75825a780ecba66a6c04f6f42f559f1ccdab68873a541d9e175f430bca0424806b005eabaf214e0189a8a1004bd8a502076d933da6e82fbc100c50650b3b2da3
7
+ data.tar.gz: 705f75e65f15ea546ad8ad315d4db989a1e2f74b09155a6eeb771fa512736eec2f0037f8c7a81828115518af88dde30c139b6d829825dc5b26bdaf0007caa72c
data/README.md CHANGED
@@ -68,7 +68,7 @@ These options are write to a hash, that you can use with other gem to render it.
68
68
 
69
69
  To facilitate the creating of menus, there are some methods to help you organize the options standard.
70
70
 
71
- ### tag(tag_name=nil)
71
+ ### tag(value=nil)
72
72
  You can set the tag for the menu element or can retrieve it.
73
73
  ```ruby
74
74
  @menu = ActiveMenu::get(:my_menu)
@@ -78,14 +78,16 @@ You can set the tag for the menu element or can retrieve it.
78
78
  @menu.tag # --> :div
79
79
  ```
80
80
 
81
+ ### text()
82
+
81
83
  ### Nested menus
82
84
  ```ruby
83
- @menu = ActiveMenu::Menu.new(:mainmenu, 'http://example.com')
84
- # def initialize(id, href = nil, content=nil, submenus=[], parent=nil, &block) .... yield(self) if block_given?
85
- @menu.submenu(:mysubmenu, "test") do |sm|
86
- sm.content = 'My submenu'
87
- sm.submenu(:mysubsubmenu, 'test 2') do |ssm|
88
- ssm.content == 'My subsubmenu'
85
+ @menu = ActiveMenu::Menu.new(:mainmenu, href: 'http://example.com')
86
+ # def initialize(id, options={}, &block) .... yield(self) if block_given?
87
+ @menu.submenu(:mysubmenu, href: "test") do |sm|
88
+ sm.text 'My submenu'
89
+ sm.submenu(:mysubsubmenu, href:'test 2') do |ssm|
90
+ ssm.text 'My subsubmenu'
89
91
  end
90
92
  end
91
93
  # Let's improve this DSL, contribute please.
@@ -25,10 +25,6 @@ class ActiveMenu::Menu
25
25
  end
26
26
  end
27
27
 
28
- def text=(value)
29
- self.text(value)
30
- end
31
-
32
28
  def href(value = nil)
33
29
  if value.nil?
34
30
  @options[:href]
@@ -36,12 +32,7 @@ class ActiveMenu::Menu
36
32
  value = value.to_sym
37
33
  @options[:href] = value
38
34
  end
39
- end
40
-
41
- def href=(value)
42
- self.href(value)
43
- end
44
-
35
+ end
45
36
 
46
37
  def tag(value=nil)
47
38
  if value.nil?
@@ -1,3 +1,3 @@
1
1
  module ActiveMenu
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -40,7 +40,7 @@ describe ActiveMenu::Menu do
40
40
  it 'have a flexible DSL for menus' do
41
41
  @menu.submenu(:mysubmenu, text: "test") do |sm|
42
42
  @sm = sm
43
- sm.text = 'My submenu'
43
+ sm.text 'My submenu'
44
44
  sm.submenu(:mysubsubmenu, text: 'test 2') do |ssm|
45
45
  @ssm = ssm
46
46
  ssm.text == 'My subsubmenu'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemenu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadjow Medeiros Leão
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-04 00:00:00.000000000 Z
11
+ date: 2013-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler