html-native 0.3.2 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0f5b72fda7cb3ea69d2faeeb693995f9637d130c4fe420eaf2af485241ba1e3
4
- data.tar.gz: c4cf23530a4dee5e13044668701ee4f8cd66f60a37bf80e357a74fb5fc107570
3
+ metadata.gz: ed3076751962fc9a51ff463fbe86f2716fc06522f838def97ba375270ca81099
4
+ data.tar.gz: b03dca13fa0ff38781755ab1912cb3890fa8f2210b1cbb2bc9cb5de8f469a6fa
5
5
  SHA512:
6
- metadata.gz: 8049b8dc8c076e6ea8b0850faa4fa1aa3bd2801e6a41c100fbbfef4c6410cd2a4717df2dd16c8f7e47d21d68452ae4c1db756b3b36786fed1f832f82b947b26d
7
- data.tar.gz: bdc4844740e7fb6c3f491da49731a1bd2adfee5158a9ddaeb12988a2468070eac22358e3d866e61f377be7eaef1eb1e3e10bf58b952addef0f999a6dc9bb9cd3
6
+ metadata.gz: 3a55f9561c6e3cc998e3616bf685a0ff5700284bfe3a68c08cc1b9583e6f2daadd9c48cb7f448abf3479f16024f29906d6f3b70ca7a99289f566a2a1a02ed2e5
7
+ data.tar.gz: a184b3ddfe8cd71beb7fcb30b9ef460ca16ea9874c53b056b3ee67ffa9292c8ee6a4fb457a02d1f7b2640f0de4349a0e78fa6fbfe480ff2a43acbb49df2da416
data/lib/html-native.rb CHANGED
@@ -3,7 +3,7 @@ require "html-native/builder"
3
3
  require "html-native/logic"
4
4
 
5
5
  module HTMLComponent
6
-
6
+
7
7
  # Generates generation methods for each HTML5-valid tag. These methods have the
8
8
  # name of the tag. Note that this interferes with the builtin `p` method.
9
9
  TAG_LIST.each do |tag|
@@ -22,6 +22,16 @@ module HTMLComponent
22
22
  Builder.new("<!DOCTYPE #{type}>")
23
23
  end
24
24
 
25
+ def _label(attrs = {}, &block)
26
+ attrs ||= {}
27
+ if block
28
+ body = block.call
29
+ Builder.new("<label#{attributes_list(:label, attrs)}>") + body + "</label>"
30
+ else
31
+ Builder.new("<label#{attributes_list(:label, attrs)}/>")
32
+ end
33
+ end
34
+
25
35
  # Creates a module that encompasses the given block in an HTMLComponent
26
36
  # context. This gives access to methods in the block as though the block was
27
37
  # declared as the `render` function in a module extending HTMLComponent
@@ -17,7 +17,7 @@ module HTMLComponent
17
17
  :canvas, :noscript, :script,
18
18
  :del, :ins,
19
19
  :caption, :col, :colgroup, :table, :tbody, :td, :tfoot, :th, :thead, :tr,
20
- :button, :datalist, :fieldset, :form, :input, :label, :legend, :meter, :optgroup,
20
+ :button, :datalist, :fieldset, :form, :input, :legend, :meter, :optgroup,
21
21
  :option, :output, :progress, :select, :textarea,
22
22
  :details, :dialog, :menu, :summary,
23
23
  :slot, :template
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-native
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kellen Watt