listify 0.0.2 → 0.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db56df7409febe4e7eca136242b96a5be612ae5e
4
- data.tar.gz: 9a2e78bcb19ebaa5c1d100a1d56ece5edcd2dc5b
3
+ metadata.gz: 611378efc5e5daac73bb837a84cd67f59ef69a5b
4
+ data.tar.gz: daba1c279974a1429abc08204d35a4e49f9505ed
5
5
  SHA512:
6
- metadata.gz: cc7e873191030fae9b8fa3a9afbe4f8200d9e901e823af3cafadc650efd67bacc6b49e567ac3bbae35f9063f898d67641d940eff644ca173fbfbdab3d8de0014
7
- data.tar.gz: 0d30d81a4e18a1eb89018065c0743d139b945f7e550434e91318a113eab3dc95ca875d200152df0d9cbacfd4cd31194a618b3f40dee3e8d014886289a7ce41cd
6
+ metadata.gz: e02c284089d2d4ebbf69ff5a5bac0f8bde3e5d2846cf099474b6ed0ee8016046a868efe902f3057ed14902567b18e9271f19bc77922fa0977e9b940eb0699596
7
+ data.tar.gz: 6aca238fa49a097dfc814b0ba4b49373b3a4129c2b782d507ddac95976e00aba429c8650f55bfca94c20f31edea8ee58161e5e501e916936e02fbb101fc0ff8b
data/lib/listify.rb CHANGED
@@ -2,6 +2,34 @@ module Listify
2
2
 
3
3
  module Helper
4
4
 
5
+ # Generate an HTML list from a ruby collection
6
+ # @param [Array, Hash{sublist_name => sublist[Array, Hash]}] collection the collection to render as a list
7
+ # @return ActiveSupport::SafeBuffer
8
+ #
9
+ # @example Simple List
10
+ # listify( ['first item', 'second item', 'third item'] )
11
+ # => "<ul>
12
+ # <li>first item</li>
13
+ # <li>second item</li>
14
+ # <li>third item</li>
15
+ # </ul>"
16
+ #
17
+ # @example Nested List
18
+ # listify( {'First Category' => ['item one', 'item two'], 'Second Category' => ['item three', 'item four'] } )
19
+ # => "<ul>
20
+ # <li>First Category
21
+ # <ul>
22
+ # <li>item one</li>
23
+ # <li>item two</li>
24
+ # </ul>
25
+ # </li>
26
+ # <li>Second Category
27
+ # <ul>
28
+ # <li>item three</li>
29
+ # <li>item four</li>
30
+ # </ul>
31
+ # </li>
32
+ # </ul>"
5
33
  def listify(collection)
6
34
  content_tag :ul do
7
35
  concat list_items_for(collection)
@@ -1,3 +1,3 @@
1
1
  module Listify
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: listify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - 'Byron Appelt '
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-11 00:00:00.000000000 Z
11
+ date: 2013-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails