alacarte 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,9 @@
1
1
  = Change Log
2
2
 
3
+ == Version 0.0.5
4
+
5
+ * Adding :wrapper html options to allow customization of the li-element.
6
+
3
7
  == Version 0.0.4
4
8
 
5
9
  * Improved documentation for the usage of :if and :unless
@@ -27,7 +27,7 @@ module AlacarteHelper
27
27
  _item << elements_for(item, current_element)
28
28
  end
29
29
 
30
- result << content_tag(:li, _item)
30
+ result << content_tag(:li, _item, item.wrapper_options)
31
31
  end
32
32
  end
33
33
 
@@ -6,7 +6,7 @@ module Alacarte
6
6
  VALID_ELEMENTS = [:link, :span]
7
7
  @@env = nil
8
8
 
9
- attr_reader :parent, :type, :name, :deep_name, :path, :as, :label, :options, :items, :block, :html_options, :group_options, :translation_key
9
+ attr_reader :parent, :type, :name, :deep_name, :path, :as, :label, :options, :items, :block, :html_options, :group_options, :wrapper_options, :translation_key
10
10
 
11
11
  # Tests if an environment was set to the Alacarte::Menu
12
12
  def self.env?
@@ -38,6 +38,7 @@ module Alacarte
38
38
  # * +:unless+ set an inverse conditions when the menu item should be valid
39
39
  # * +:html+ pass any html options that you want to be added to the menu item
40
40
  # * +:group+ when the menu item has valid children, the +group+ options are passed as the html options of the grouping element
41
+ # * +:wrapper+ pass any html options that you want to add to the wrapping li item
41
42
  def initialize(parent, type, *args, &block)
42
43
  @options = args.last.is_a?(::Hash) ? args.pop : {}
43
44
  @parent = parent
@@ -51,6 +52,7 @@ module Alacarte
51
52
  @block = block if block_given?
52
53
  @html_options = options[:html]
53
54
  @group_options = options[:group]
55
+ @wrapper_options = options[:wrapper]
54
56
 
55
57
  build
56
58
  end
@@ -1,3 +1,3 @@
1
1
  module Alacarte
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Stijn Mathysen
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-08-17 00:00:00 +02:00
17
+ date: 2011-09-06 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20