tree_html 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +2 -0
- data/lib/tree_html/version.rb +1 -1
- data/lib/tree_html.rb +6 -0
- data/tree_html.gemspec +2 -2
- metadata +11 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38b6feffd5a7b44acca5b51ac501b4de6a714d5eda38700d867b1d7a345b145b
|
4
|
+
data.tar.gz: 1efb12cbe56fe1c97b658e086f7f639d82ad2190198b6868262b341964ab3fad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 281f428f38623f6b4ba961348073a1f4e9fe1a9e7f2204a857efe6950974c15a854ac2426de0b471b1d843e55a9d33fadda75302e7c8b9fceecbe399aab34769
|
7
|
+
data.tar.gz: 2279a74ba2795b54a6347edbd51b95b355a45645777020135a74b84979d7eaff05a1943537554cdcf9f9accdc39e82e9aca81439a0b233de933039d780f12f5e
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -22,6 +22,8 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
In Node class, `include TreeHtml`, then implement `label_for_tree_html` and `children_for_tree_html`, then 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
24
|
|
25
|
+
By Default, any object can be leaf, and renders as `to_s`.
|
26
|
+
|
25
27
|
You may overwrite `data_for_tree_html`, `head_js_for_tree_html`, `body_js_for_tree_html`, `css_for_tree_html` to specify your own style.
|
26
28
|
|
27
29
|
In generated html, hover a branch and press `f`/`u` to fold/unfold it's children, press `p`/`n` to jump to it's previous/next sibling branch. You may change these function keys in `body_js_for_tree_html`.
|
data/lib/tree_html/version.rb
CHANGED
data/lib/tree_html.rb
CHANGED
@@ -9,6 +9,12 @@ module TreeHtml
|
|
9
9
|
Css = File.read File.expand_path('../tree_html/tree_html.css', __FILE__)
|
10
10
|
Js = Dir.glob("#{File.expand_path(__dir__)}/tree_html/*.js").map{|f| File.read f }.join(';')
|
11
11
|
|
12
|
+
class ::Object
|
13
|
+
def li_for_tree_html
|
14
|
+
"<li>#{NO_CHECKBOX}<a>#{to_s}</a></li>"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
12
18
|
def tree_html
|
13
19
|
"<ul class='tree-html'>#{li_for_tree_html}</ul>"
|
14
20
|
end
|
data/tree_html.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_development_dependency "bundler", "
|
24
|
-
spec.add_development_dependency "rake", "
|
23
|
+
spec.add_development_dependency "bundler", ">= 2.2.33"
|
24
|
+
spec.add_development_dependency "rake", ">= 12.3.3"
|
25
25
|
spec.add_development_dependency "minitest", "~> 5.0"
|
26
26
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ken
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.2.33
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.2.33
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 12.3.3
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 12.3.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,8 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
|
-
|
96
|
-
rubygems_version: 2.7.6
|
95
|
+
rubygems_version: 3.1.6
|
97
96
|
signing_key:
|
98
97
|
specification_version: 4
|
99
98
|
summary: generate plain css tree structure
|