html_fn 0.3.1 → 0.3.2

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
  SHA256:
3
- metadata.gz: 17102465634775d6835f13de6bc0ca28a3d01e689a4debd729a7799cd2c97b87
4
- data.tar.gz: 505c7de48f41cd4b047299f0975d3a8ca472e36ac0581ac4e380313f813d7f72
3
+ metadata.gz: fdefc6f385851e6d11a2d4be052f3b8a0fce71d5617eaaeeb543a6ed5a034d38
4
+ data.tar.gz: eed2a499f44f734e4f38c0432b8874fd2218a07e2c68868800aefa4fc6f0b513
5
5
  SHA512:
6
- metadata.gz: 45f42fcc367a4fa79c396509b68b58ee6c6a910c24dd1cb8ac30306a6f53e874ac3443bda70abecec13de000ce911366349c2ae87e08b4828c38f3b069b79814
7
- data.tar.gz: e019528fdecb6c4c5d811d3f58e7225ec6d772be366cdda5e2bd9233b5884e4234acd862c3459a71840c1e4326f904f7d629a8aca673e81c6a5dc4865019edc0
6
+ metadata.gz: ef20c9fe79087a710d28c926d916faa8e097ec8aa3184fc9505df7dbcadb56f6d81f77ae3fbd9a1791db7457a7b642052d31d424902ff39d5185bf9f608361b7
7
+ data.tar.gz: d4adb6673030a814918e7f65ad83175e623ea2ec7b2410183a10cdc6379f98d41199c8e67f01bfeb6d5467c030bf849671c5d94fab7a29400a1056ea949bae5a
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- html_fn (0.3.1)
4
+ html_fn (0.3.2)
5
5
  fn_reader
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- fn_reader (0.1.0)
10
+ fn_reader (0.2.0)
11
11
  minitest (5.11.3)
12
12
  rake (13.0.3)
13
13
 
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # HtmlFn
2
2
 
3
- DSL for building HTML without using metaprogram magic.
4
-
3
+ DSL for building HTML without using metaprogram magic.
5
4
 
6
5
  ## Installation
7
6
 
@@ -22,32 +21,29 @@ Or install it yourself as:
22
21
  ## Usage
23
22
 
24
23
  ```ruby
25
- require 'htlm_fp'
26
-
24
+ require 'html_fn'
27
25
 
28
- include HttpFp
29
- include HttpFp::Attributes
26
+ include HtmlFn
27
+ include HtmlFn::Attributes
30
28
 
31
-
32
- my_table =
29
+ my_table =
33
30
  table.([class_.("table")]).(
34
- [thead.([]).(
35
- [tr.([]).(
36
- [th.([]).([text.("Name")]),
37
- th.([]).([text.("Age")])]
38
- )]
39
-
40
- ),
41
- tbody.([]).(
42
- [tr.([]).([
43
- td.([]).([text.("Martin")]),
44
- td.([]).([text.("34")]),
45
- ])]
46
- )]
47
- )
31
+ [thead.([]).(
32
+ [tr.([]).(
33
+ [th.([]).([text.("Name")]),
34
+ th.([]).([text.("Age")])]
35
+ )]
36
+
37
+ ),
38
+ tbody.([]).(
39
+ [tr.([]).([
40
+ td.([]).([text.("Martin")]),
41
+ td.([]).([text.("34")]),
42
+ ])]
43
+ )]
44
+ )
48
45
  ```
49
46
 
50
-
51
47
  Note that the html will not be formated. If you want to format it, you can use a function as such:
52
48
 
53
49
  ```ruby
@@ -1,3 +1,3 @@
1
1
  module HtmlFn
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
data/lib/html_fn.rb CHANGED
@@ -3,16 +3,14 @@ require "fn_reader"
3
3
  require "html_fn/attributes"
4
4
 
5
5
  module HtmlFn
6
- fn_reader :tag, :table, :thead, :tr, :th, :td, :tbody, :text, :headers, :row, :html_table,
7
- :node, :table, :thead, :th, :td, :th, :tbody, :div
8
-
9
- @@node = -> tag, attrs, elems {
6
+ fn_reader :node, :div, :table, :thead, :tr, :th, :td, :tbody, :text
7
+ @@node = ->tag, attrs, elems {
10
8
  <<EOF
11
9
  <#{tag} #{Attributes.attrs_to_s.(attrs)}>#{elems.join("\n")}</#{tag}>
12
10
  EOF
13
11
  }.curry
14
12
 
15
- @@text = -> a { [a.to_s] }
13
+ @@text = ->a { [a.to_s] }
16
14
 
17
15
  @@script = node.(:script)
18
16
  @@table = node.(:table)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html_fn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Chabot
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-24 00:00:00.000000000 Z
11
+ date: 2023-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.1.4
111
+ rubygems_version: 3.4.6
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Bunch of lamdas for building Html