dirtree 0.2.0 → 0.3.0
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 +4 -4
- data/README.md +2 -0
- data/exe/dirtree +21 -1
- data/lib/dirtree/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dab1916c1ed6f532cea1b66c6ec5f6485342cfb8
|
4
|
+
data.tar.gz: da89e771d354d425ac016a407997b73d4caef95b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27971ec983be71a799a7e304d660f9834be1f7c4c0dc0ad831a31414cf272c9f8437dae1358547a31cf3b0e46f8b0771c72105935642084773faf6c2d2c07f4c
|
7
|
+
data.tar.gz: 5ce9c49b082bc5aa8b3909e1183cd36a0808504558cf8881cd67ab0d30d8e3298f5bf8f440e506387a0fdfd1330e5b4ee6026412c52fa20f968f0a9ff67c98f3
|
data/README.md
CHANGED
@@ -20,7 +20,9 @@ Dirtree visualizes an list of file paths into a tree graph, printed as HTML page
|
|
20
20
|
Usage: dirtree [options]... [file]...
|
21
21
|
-v, --version Print version
|
22
22
|
-h, --help Show this help text
|
23
|
+
-l, --local-dependencies Use saved JavaScript libraries instead of downloading them
|
23
24
|
-o, --output=File.html Specify a path to write output, if not specified output will be printed to STDOUT
|
25
|
+
-t, --template=TemplateName Specify the template name, available templates ["circles", "tree"]
|
24
26
|
|
25
27
|
|
26
28
|
## Examples
|
data/exe/dirtree
CHANGED
@@ -3,6 +3,7 @@ require 'dirtree'
|
|
3
3
|
require 'optparse'
|
4
4
|
require 'json'
|
5
5
|
require 'erb'
|
6
|
+
require 'open-uri'
|
6
7
|
|
7
8
|
templates_dir = File.join(File.dirname(__FILE__), '..', 'templates')
|
8
9
|
templates = Dir.open(templates_dir).map do |file|
|
@@ -34,10 +35,19 @@ OptionParser.new do |opts|
|
|
34
35
|
exit
|
35
36
|
end
|
36
37
|
|
38
|
+
opts.on(
|
39
|
+
'-l',
|
40
|
+
'--local-dependencies',
|
41
|
+
'Use saved JavaScript libraries instead of downloading them'
|
42
|
+
) do
|
43
|
+
options[:local_dependencies] = true
|
44
|
+
end
|
45
|
+
|
37
46
|
opts.on(
|
38
47
|
'-oFile.html',
|
39
48
|
'--output=File.html',
|
40
|
-
'Specify a path to write output,
|
49
|
+
'Specify a path to write output, if
|
50
|
+
not specified output will be printed to STDOUT'
|
41
51
|
) do |value|
|
42
52
|
options[:output] = value
|
43
53
|
end
|
@@ -62,6 +72,16 @@ template = File.read(File.expand_path(template_file))
|
|
62
72
|
tree = root.as_json
|
63
73
|
result = ERB.new(template).result binding
|
64
74
|
|
75
|
+
if options[:local_dependencies]
|
76
|
+
result.gsub! %r{(<script src="(.+)"><\/script>)} do
|
77
|
+
injection = '<script>'
|
78
|
+
injection << open($2).read
|
79
|
+
injection << '</script>'
|
80
|
+
|
81
|
+
injection
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
65
85
|
if options.key?(:output)
|
66
86
|
File.write(options[:output], result)
|
67
87
|
else
|
data/lib/dirtree/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dirtree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emad Elsaid
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
requirements: []
|
80
80
|
rubyforge_project:
|
81
|
-
rubygems_version: 2.6.
|
81
|
+
rubygems_version: 2.6.12
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: display list of file paths as an interactive tree
|