judges 0.0.18 → 0.0.19

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: 8399b8c8623c0d099deeb50055658e072bae333b0d851cd0aaef22f441655950
4
- data.tar.gz: c8ef8e75705e8d0cf3bdb8033c054f7ac4c239566bf0cb80b6a9cc0943932986
3
+ metadata.gz: 22748b35c785164e5fef5f8a6d013d92c380e2023d9806759339a11763f51554
4
+ data.tar.gz: 9245a7682189a256d5cd2b2779c7163189e751db721d0dd0eeb54e804bb0e7ca
5
5
  SHA512:
6
- metadata.gz: 7a187a9441700826cf7b539ed264a7d80e5e749169219c62d717cee1451cd77e78f5e9a130617dd2e589ad0c13d504e27482527db2dc6b80da12561ff8d1e3e4
7
- data.tar.gz: 38c5ae3b4af2981b56d9069a794d791ea107cfae27421f12dce9b001a8ff1d60f38c972362fbd659c4e53f750b35a6192ff66b4869280510286c3d585073d0ae
6
+ metadata.gz: 0b8d102de3483627367d4f8705b5473324f469b9a9d7367bbdee224f3d1db6e37a8ed34bab345ef6930dd321f473781b69e314c53aab2e499c8f8f10916ef519
7
+ data.tar.gz: d564a60e8d813fb4b785b0e4c084012f360c920ced92138bdf0f247f3aa89e1e5ac86104f928129cc2cc24b1c705d3d7f59c2d25bd59f019a4958024e0dcaa06
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.18'
32
+ ver = '0.0.19'
33
33
 
34
34
  include GLI::App
35
35
 
@@ -59,7 +59,7 @@ command :update do |c|
59
59
  c.desc 'Options to pass to every judge'
60
60
  c.flag([:o, :option], multiple: true, arg_name: '<key=value>')
61
61
  c.desc 'Maximum number of update cycles to run'
62
- c.flag([:'max-cycles'], default_value: 8)
62
+ c.flag([:'max-cycles'], default_value: 8, type: Integer)
63
63
  c.action do |global, options, args|
64
64
  require_relative '../lib/judges/commands/update'
65
65
  Judges::Update.new(loog).run(options, args)
data/features/cli.feature CHANGED
@@ -14,15 +14,14 @@ Feature: Simple Run
14
14
  Given I make a temp directory
15
15
  Then I have a "simple/simple_judge.rb" file with content:
16
16
  """
17
- $fb.query("(eq kind 'foo')").each do |f|
18
- n = $fb.insert
19
- n.kind = 'yes!'
20
- end
17
+ n = $fb.insert
18
+ n.kind = 'yes!'
21
19
  """
22
- Then I run bin/judges with "--verbose update -o foo=1 -o bar=2 --max-cycles 2 . simple.fb"
20
+ Then I run bin/judges with "--verbose update -o foo=1 -o bar=2 --max-cycles 3 . simple.fb"
23
21
  Then Stdout contains "foo → "
24
22
  Then Stdout contains "bar → "
25
23
  Then Stdout contains "1 judges processed"
24
+ Then Stdout contains "Update finished in 3 cycles"
26
25
  And Exit code is zero
27
26
 
28
27
  Scenario: Simple test of a few judges
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.18'
29
+ s.version = '0.0.19'
30
30
  s.license = 'MIT'
31
31
  s.summary = 'Command-Line Tool for a Factbase'
32
32
  s.description = '
@@ -47,13 +47,13 @@ class Judges::Update
47
47
  packs = Judges::Packs.new(dir, @loog)
48
48
  c = 0
49
49
  loop do
50
+ c += 1
50
51
  diff = cycle(packs, fb, impex, options)
51
52
  break if diff.zero?
52
- if !opts['max-cycles'].nil? && c > opts['max-cycles']
53
+ if !opts['max-cycles'].nil? && c >= opts['max-cycles']
53
54
  @loog.info('Too many cycles already, as set by --max-cycles, breaking')
54
55
  break
55
56
  end
56
- c += 1
57
57
  @loog.info("#{diff} modifications at the cycle ##{c}")
58
58
  end
59
59
  @loog.info("Update finished in #{c} cycles")
@@ -49,8 +49,8 @@ class TestUpdate < Minitest::Test
49
49
  fb = Factbase.new
50
50
  fb.insert.foo_bar = 42
51
51
  File.binwrite(file, fb.export)
52
- File.write(File.join(d, 'foo.rb'), 'return if $fb.size > 2; $fb.insert.tt = 4')
53
- Judges::Update.new(Loog::VERBOSE).run({}, [d, file])
52
+ File.write(File.join(d, 'foo.rb'), '$fb.insert.tt = 4')
53
+ Judges::Update.new(Loog::VERBOSE).run({ 'max-cycles' => 1 }, [d, file])
54
54
  fb = Factbase.new
55
55
  fb.import(File.binread(file))
56
56
  xml = Nokogiri::XML.parse(fb.to_xml)
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.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko