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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82fc02c3ba2a1713203ac34aa76bd025ae9fb4cf04139c74b7e9dadb055d8005
4
- data.tar.gz: 9204eb4ce2e142b989266e7079942f70d13f0051bdeee1618715ef8608eec8c0
3
+ metadata.gz: 5310277ac8adfa21b11145be6a0ca34b198a9407e8186eb1a54ac5af7da4b685
4
+ data.tar.gz: fff3d483dbf41ef774a4a3a5f30d6abc72c55919d6516c03dec8d1dfdb0f4c19
5
5
  SHA512:
6
- metadata.gz: 5c01a4894fa0830e67d55ef0d90d4a67163765896993d52637d31a26f16eb15215c0ac40797be6bd65958f8a52a1019a343c95551f38a7d2abbf01a222b35963
7
- data.tar.gz: 4430b1433977028919dcc33c67225746cf23f08f8ec5520af821dc7997adcaf3f3a793e19ec79fa289ff39b06457015207fde16f2fabe21cec8aec3bf83df991
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
- watch { generate }
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 |file, event|
51
- yield unless event == :deleted
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
 
@@ -1,5 +1,5 @@
1
1
  module Victor
2
2
  module CLI
3
- VERSION = "0.3.2"
3
+ VERSION = "0.3.4"
4
4
  end
5
5
  end
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.2
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-06-19 00:00:00.000000000 Z
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: '1.1'
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: '1.1'
27
+ version: '2.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: nokogiri
30
30
  requirement: !ruby/object:Gem::Requirement