victor-cli 0.3.2 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/victor/cli/commands/render.rb +14 -3
- data/lib/victor/cli/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5310277ac8adfa21b11145be6a0ca34b198a9407e8186eb1a54ac5af7da4b685
|
4
|
+
data.tar.gz: fff3d483dbf41ef774a4a3a5f30d6abc72c55919d6516c03dec8d1dfdb0f4c19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1001b0a3ccd0d48944f3abf93956acf8e524c71e2dd81a9b39dd0ee415197f8ebcf9b29f2f2cada4bef4cba7e910b2865e671ffa7ff2c8cb1b1f28ab3fb65a1e
|
7
|
+
data.tar.gz: 0d3e77e6cd44a095f5d7d45d7130ea2fd685bda224e1d31d1739eb60580216a90ab6be253ca8ae4cbad9ec70f8e57a9e9fdcbdbf50ca6d2c8045982c146fc014
|
@@ -18,11 +18,12 @@ module Victor
|
|
18
18
|
param "SVG_FILE", "Output SVG file. Leave empty to write to stdout"
|
19
19
|
|
20
20
|
example "victor render input.rb output.svg"
|
21
|
+
example "victor render input.rb output.svg --watch"
|
21
22
|
example "victor render input.rb --template minimal"
|
22
23
|
|
23
24
|
def run
|
24
25
|
if args['--watch']
|
25
|
-
|
26
|
+
watch_and_generate
|
26
27
|
else
|
27
28
|
generate
|
28
29
|
end
|
@@ -47,8 +48,18 @@ module Victor
|
|
47
48
|
|
48
49
|
def watch
|
49
50
|
say "Watching #{ruby_file} for changes"
|
50
|
-
file_watcher.watch do |
|
51
|
-
|
51
|
+
file_watcher.watch do |changes|
|
52
|
+
changes.each do |path, event|
|
53
|
+
yield unless event == :deleted
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def watch_and_generate
|
59
|
+
watch do
|
60
|
+
generate
|
61
|
+
rescue Exception => e
|
62
|
+
say! "!undred!#{e.class}!txtrst!\n#{e.message}"
|
52
63
|
end
|
53
64
|
end
|
54
65
|
|
data/lib/victor/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: victor-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-10-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: filewatcher
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '2.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '2.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: nokogiri
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|