tree_html 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/tree_html/version.rb +1 -1
- data/lib/tree_html.rb +6 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20504c724cbd2859c9bfc6c6235f17cabd109932adc86ed84ee60f2549e540e5
|
4
|
+
data.tar.gz: 4b2f5d2ca583f0f79d6ba403f1e566966ba3a582ae1d8a507d72c66a74d51aa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21139d38408d2be9a12e9f1e0b7396a6371568d7467d780827935248c959ada040613e0c801e8e74e5cb1f4982ad87edc6b00c98027d86b461d51ecc488c95ef
|
7
|
+
data.tar.gz: a6d3e49ee00f675c8acd0a5ee89c7555c1fb4ef8805aa82a4c89fd8d7d85814fc5bf12414173e3237b091059b0ac08a434b0cb2cf4692d8120b0563d154a5bdf
|
data/README.md
CHANGED
@@ -20,7 +20,11 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
In Node class, `include TreeHtml
|
23
|
+
In Node class, `include TreeHtml`.
|
24
|
+
|
25
|
+
Then implement `label_for_tree_html` and `children_for_tree_html` for Branch class, and `label_for_tree_html` for Leaf class.
|
26
|
+
|
27
|
+
Finally, call `tree_html` on node object to get ul/li fragment, or `tree_html_full` to get a html file with pre-defined style.
|
24
28
|
|
25
29
|
By Default, any object can be leaf, and renders as `to_s`.
|
26
30
|
|
data/lib/tree_html/version.rb
CHANGED
data/lib/tree_html.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "tree_html/version"
|
2
|
+
require "cgi"
|
2
3
|
|
3
4
|
module TreeHtml
|
4
5
|
|
@@ -11,7 +12,11 @@ module TreeHtml
|
|
11
12
|
|
12
13
|
class ::Object
|
13
14
|
def li_for_tree_html
|
14
|
-
"<li>#{NO_CHECKBOX}<a>#{
|
15
|
+
"<li>#{NO_CHECKBOX}<a>#{label_for_tree_html}</a></li>"
|
16
|
+
end
|
17
|
+
|
18
|
+
def label_for_tree_html
|
19
|
+
CGI::escapeHTML(to_s)
|
15
20
|
end
|
16
21
|
end
|
17
22
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tree_html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ken
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
|
-
rubygems_version: 3.
|
95
|
+
rubygems_version: 3.0.3
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: generate plain css tree structure
|