judges 0.0.21 → 0.0.22

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: 428132cb0468f9c9e0fb7c3a51628cfb4f8b07a0ff26493cd476f10a8461ca02
4
- data.tar.gz: 158206dab846c53314f29ed607e5789ede80e2b18c778dca09bd65ce67adaf93
3
+ metadata.gz: c7b4a80762cb37240925afe0778c87a829f891a4e5a3a3fb7f22ccc3802c1a3a
4
+ data.tar.gz: 914e85bda9dea1030a06fde8a635d1452ae73c0d3e736e8ef04164cd692df378
5
5
  SHA512:
6
- metadata.gz: c594b09ee2a9ea407344adf6e0a89f5e32f6ae2c4294810f89ac617dd9878cf3cee336ac2b3db934bfff1db68bf9b6a277d6a1b2d3afcf720fc34b58a12f73ab
7
- data.tar.gz: 298affb7b7f6882a98a52117bc7fb5270e6ed71616505891d4b71080e53131b55236fe54de2a465a91a302d4ef2b70f361630bc4536a46c1a5190d9e9442fca6
6
+ metadata.gz: 2fb32730607a2b122391447f7bd371f9b1d318d4c6be50ae1bf2d3bcd46c80561ac1ebe792824909cfa8f7fbd4edda17404e41b2510b9ab25c750fcb34f836ef
7
+ data.tar.gz: 6f6fa5d67867c3f0abb8b54e65d59aedbfa607abde5ca1336505001d35c916c8a928a4228393c2d5d22e2a341ed09afb2c199057389a966ce1f07326b7444e13
data/bin/judges CHANGED
@@ -29,7 +29,7 @@ require 'factbase'
29
29
  Encoding.default_external = Encoding::UTF_8
30
30
  Encoding.default_internal = Encoding::UTF_8
31
31
 
32
- ver = '0.0.21'
32
+ ver = '0.0.22'
33
33
 
34
34
  include GLI::App
35
35
 
@@ -60,6 +60,8 @@ command :update do |c|
60
60
  c.flag([:o, :option], multiple: true, arg_name: '<key=value>')
61
61
  c.desc 'Maximum number of update cycles to run'
62
62
  c.flag([:'max-cycles'], default_value: 8, type: Integer)
63
+ c.desc 'Stay quiet even if some judges fail'
64
+ c.switch([:q, :quiet], default_value: false)
63
65
  c.action do |global, options, args|
64
66
  require_relative '../lib/judges/commands/update'
65
67
  Judges::Update.new(loog).run(options, args)
data/features/cli.feature CHANGED
@@ -17,10 +17,10 @@ Feature: Simple Run
17
17
  n = $fb.insert
18
18
  n.kind = 'yes!'
19
19
  """
20
- Then I run bin/judges with "--verbose update -o foo=1 -o bar=2 --max-cycles 3 . simple.fb"
20
+ Then I run bin/judges with "--verbose update --quiet -o foo=1 -o bar=2 --max-cycles 3 . simple.fb"
21
21
  Then Stdout contains "foo → "
22
22
  Then Stdout contains "bar → "
23
- Then Stdout contains "1 judges processed"
23
+ Then Stdout contains "1 judge(s) processed"
24
24
  Then Stdout contains "Update finished in 3 cycles"
25
25
  And Exit code is zero
26
26
 
data/judges.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
27
27
  s.required_ruby_version = '>=3.2'
28
28
  s.name = 'judges'
29
- s.version = '0.0.21'
29
+ s.version = '0.0.22'
30
30
  s.license = 'MIT'
31
31
  s.summary = 'Command-Line Tool for a Factbase'
32
32
  s.description = '
@@ -67,7 +67,7 @@ class Judges::Update
67
67
  errors = []
68
68
  diff = 0
69
69
  done = packs.each_with_index do |p, i|
70
- @loog.info("👍 Running #{p.name} (##{i}) at #{p.dir.to_rel}...")
70
+ @loog.info("👉 Running #{p.name} (##{i}) at #{p.dir.to_rel}...")
71
71
  before = fb.size
72
72
  begin
73
73
  p.run(fb, options)
@@ -76,11 +76,15 @@ class Judges::Update
76
76
  errors << p.script
77
77
  end
78
78
  after = fb.size
79
- @loog.info("Pack #{p.dir.to_rel} added #{after - before} facts") if after > before
79
+ @loog.info("👍 Pack #{p.dir.to_rel} added #{after - before} facts") if after > before
80
80
  diff += after - before
81
81
  end
82
- @loog.info("#{done} judges processed (#{errors.size} errors)")
83
- raise "Failed to update correctly (#{errors.size} errors)" unless errors.empty?
82
+ if errors.empty?
83
+ @loog.info("👍 #{done} judge(s) processed")
84
+ else
85
+ @loog.info("❌ #{done} judge(s) processed with #{errors.size} errors")
86
+ raise "Failed to update correctly (#{errors.size} errors)" unless opts['quiet']
87
+ end
84
88
  impex.export(fb)
85
89
  diff
86
90
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judges
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko