judges 0.8.0 → 0.9.0

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: fe5a5448e7e30ad547e467c6493f793b9148ea9cfea8317406902d53b4f7a270
4
- data.tar.gz: 36b9e68a0797bb79118c51b68b56a2740b5ace3eaae26ed83af97b38f2f80cbc
3
+ metadata.gz: 29aaf4f403a8df4007afa115bfbf0afd09f42ab8ad493536599944e84ed2b82e
4
+ data.tar.gz: 5c5dc615c168c150c908589f0f775144d4117003129a07515dd252f2ba622c22
5
5
  SHA512:
6
- metadata.gz: 4601b3a1361db40b6b5c4a4d718f47016299583155933ca2168471f0c94de92e81ee9328831b99203b81faa6a872f9ac745bdaaba77ff159513161b32c7a316c
7
- data.tar.gz: ed839d853ee202832dc23572b52059ea00f1992e148740bc55ade1ec951d4a03759b6f4359e85c1efbb57029a69328f60df5de28d6fed70e548f852586ce88ab
6
+ metadata.gz: 642b71de17e43f5000b052dca656a3d374288f021f3fc1e7b75a7a095a50c9084ff3874e9c03bc954df8feb9eeac5482d5aaab35b869db6e879d2204a30e6427
7
+ data.tar.gz: 146de657cb25b3e5ab88cf2444b6876c2dabc3be82eba3525a3c4115ede82dc366da5a51c6e9c32ea97aa3af57e6aab514756033d9e1cd3f9ad28b7ad23f99f9
@@ -31,7 +31,7 @@ jobs:
31
31
  name: test
32
32
  strategy:
33
33
  matrix:
34
- os: [ubuntu-20.04, macos-12, windows-2022]
34
+ os: [ubuntu-20.04, macos-12]
35
35
  ruby: [3.2]
36
36
  runs-on: ${{ matrix.os }}
37
37
  steps:
data/Gemfile CHANGED
@@ -30,7 +30,7 @@ gem 'rake', '13.2.1', require: false
30
30
  gem 'rspec-rails', '6.1.2', require: false
31
31
  gem 'rubocop', '1.64.1', require: false
32
32
  gem 'rubocop-performance', '1.21.0', require: false
33
- gem 'rubocop-rspec', '2.31.0', require: false
33
+ gem 'rubocop-rspec', '3.0.1', require: false
34
34
  gem 'simplecov', '0.22.0', require: false
35
35
  gem 'simplecov-cobertura', '2.1.0', require: false
36
36
  gem 'webmock', '3.23.1', require: false
data/Gemfile.lock CHANGED
@@ -87,10 +87,11 @@ GEM
87
87
  erubi (1.12.0)
88
88
  ethon (0.16.0)
89
89
  ffi (>= 1.15.0)
90
- factbase (0.0.48)
90
+ factbase (0.0.50)
91
91
  json (~> 2.7)
92
92
  loog (~> 0.2)
93
93
  nokogiri (~> 1.10)
94
+ tago (~> 0.0)
94
95
  yaml (~> 0.3)
95
96
  ffi (1.17.0-aarch64-linux-gnu)
96
97
  ffi (1.17.0-arm-linux-gnu)
@@ -135,14 +136,14 @@ GEM
135
136
  nokogiri (1.16.5-x86_64-linux)
136
137
  racc (~> 1.4)
137
138
  parallel (1.25.1)
138
- parser (3.3.2.0)
139
+ parser (3.3.3.0)
139
140
  ast (~> 2.4.1)
140
141
  racc
141
142
  psych (5.1.2)
142
143
  stringio
143
144
  public_suffix (5.0.5)
144
145
  racc (1.8.0)
145
- rack (3.1.0)
146
+ rack (3.1.3)
146
147
  rack-session (2.0.0)
147
148
  rack (>= 3.0.0)
148
149
  rack-test (2.1.0)
@@ -170,7 +171,7 @@ GEM
170
171
  rdoc (6.7.0)
171
172
  psych (>= 4.0.0)
172
173
  regexp_parser (2.9.2)
173
- reline (0.5.8)
174
+ reline (0.5.9)
174
175
  io-console (~> 0.5)
175
176
  retries (0.0.5)
176
177
  rexml (3.3.0)
@@ -205,20 +206,11 @@ GEM
205
206
  unicode-display_width (>= 2.4.0, < 3.0)
206
207
  rubocop-ast (1.31.3)
207
208
  parser (>= 3.3.1.0)
208
- rubocop-capybara (2.21.0)
209
- rubocop (~> 1.41)
210
- rubocop-factory_bot (2.26.0)
211
- rubocop (~> 1.41)
212
209
  rubocop-performance (1.21.0)
213
210
  rubocop (>= 1.48.1, < 2.0)
214
211
  rubocop-ast (>= 1.31.1, < 2.0)
215
- rubocop-rspec (2.31.0)
216
- rubocop (~> 1.40)
217
- rubocop-capybara (~> 2.17)
218
- rubocop-factory_bot (~> 2.22)
219
- rubocop-rspec_rails (~> 2.28)
220
- rubocop-rspec_rails (2.29.0)
221
- rubocop (~> 1.40)
212
+ rubocop-rspec (3.0.1)
213
+ rubocop (~> 1.61)
222
214
  ruby-progressbar (1.13.0)
223
215
  simplecov (0.22.0)
224
216
  docile (~> 1.1)
@@ -233,7 +225,7 @@ GEM
233
225
  strscan (3.1.0)
234
226
  sys-uname (1.3.0)
235
227
  ffi (~> 1.1)
236
- tago (0.0.1)
228
+ tago (0.0.2)
237
229
  thor (1.3.1)
238
230
  typhoeus (1.4.1)
239
231
  ethon (>= 0.9.0)
@@ -267,7 +259,7 @@ DEPENDENCIES
267
259
  rspec-rails (= 6.1.2)
268
260
  rubocop (= 1.64.1)
269
261
  rubocop-performance (= 1.21.0)
270
- rubocop-rspec (= 2.31.0)
262
+ rubocop-rspec (= 3.0.1)
271
263
  simplecov (= 0.22.0)
272
264
  simplecov-cobertura (= 2.1.0)
273
265
  webmock (= 3.23.1)
data/bin/judges CHANGED
@@ -51,6 +51,7 @@ class App
51
51
  loog = Loog::VERBOSE
52
52
  end
53
53
  loog.debug("judges #{Judges::VERSION}")
54
+ loog.debug("facbase #{Factbase::VERSION}")
54
55
  true
55
56
  end
56
57
 
@@ -146,6 +147,8 @@ class App
146
147
  c.flag([:lib])
147
148
  c.desc 'Stay quiet even if some tests fail or simply no tests executed?'
148
149
  c.switch([:quiet], default_value: false)
150
+ c.desc 'Use default logging facility'
151
+ c.switch([:log], default_value: true)
149
152
  c.action do |global, options, args|
150
153
  require_relative '../lib/judges/commands/test'
151
154
  Judges::Test.new(loog).run(options, args)
@@ -12,7 +12,7 @@ Feature: Update
12
12
  Then Stdout contains "foo → "
13
13
  Then Stdout contains "bar → "
14
14
  Then Stdout contains "1 judge(s) processed"
15
- Then Stdout contains "Update finished in 3 cycle(s), +3 fact(s)"
15
+ Then Stdout contains "Update finished in 3 cycle(s), modified 3/0 fact(s)"
16
16
  And Exit code is zero
17
17
 
18
18
  Scenario: Simple run of a few judges, with a lib
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.8.0'
29
+ s.version = '0.9.0'
30
30
  s.license = 'MIT'
31
31
  s.summary = 'Command-Line Tool for a Factbase'
32
32
  s.description =
@@ -123,7 +123,9 @@ class Judges::Test
123
123
  end
124
124
  options = Judges::Options.new(opts['option']) + Judges::Options.new(yaml['options'])
125
125
  (1..(opts['runs'] || yaml['runs'] || 1)).each do
126
- judge.run(Factbase::Looged.new(fb, @loog), {}, {}, options)
126
+ fbx = fb
127
+ fbx = Factbase::Looged.new(fb, @loog) if opts['log']
128
+ judge.run(fbx, {}, {}, options)
127
129
  end
128
130
  xpaths = yaml['expected']
129
131
  return if xpaths.nil?
@@ -46,20 +46,21 @@ class Judges::Update
46
46
  impex = Judges::Impex.new(@loog, args[1])
47
47
  fb = impex.import(strict: false)
48
48
  fb = Factbase::Looged.new(fb, @loog) if opts['log']
49
- before = fb.size
50
49
  options = Judges::Options.new(opts['option'])
51
50
  @loog.debug("The following options provided:\n\t#{options.to_s.gsub("\n", "\n\t")}")
52
51
  judges = Judges::Judges.new(dir, opts['lib'], @loog)
53
52
  c = 0
53
+ churn = Judges::Churn.new(0, 0)
54
54
  elapsed(@loog) do
55
55
  loop do
56
56
  c += 1
57
57
  if c > 1
58
58
  @loog.info("\n\nStarting cycle ##{c}#{opts['max-cycles'] ? " (out of #{opts['max-cycles']})" : ''}...")
59
59
  end
60
- churn = cycle(opts, judges, fb, options)
60
+ delta = cycle(opts, judges, fb, options)
61
+ churn += delta
61
62
  impex.export(fb)
62
- if churn.zero?
63
+ if delta.zero?
63
64
  @loog.info("The update cycle ##{c} has made no changes to the factbase, let's stop")
64
65
  break
65
66
  end
@@ -67,9 +68,9 @@ class Judges::Update
67
68
  @loog.info("Too many cycles already, as set by --max-cycles=#{opts['max-cycles']}, breaking")
68
69
  break
69
70
  end
70
- @loog.info("At the cycle #{c}, the factbase was modified by #{churn} fact(s)")
71
+ @loog.info("The cycle #{c} modified #{delta} fact(s)")
71
72
  end
72
- throw :"Update finished in #{c} cycle(s), #{format('+%d', fb.size - before)} fact(s)"
73
+ throw :"Update finished in #{c} cycle(s), modified #{churn} fact(s)"
73
74
  end
74
75
  end
75
76
 
data/lib/judges.rb CHANGED
@@ -25,5 +25,5 @@
25
25
  # Copyright:: Copyright (c) 2024 Yegor Bugayenko
26
26
  # License:: MIT
27
27
  module Judges
28
- VERSION = '0.8.0'
28
+ VERSION = '0.9.0'
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judges
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-11 00:00:00.000000000 Z
11
+ date: 2024-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace