judges 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c525e90c9ec78d8d7b745c026e07d033427b6193e185bd28d2edc153f254c863
4
- data.tar.gz: bff22a2e3f8d9813261f76df90a7087454e393e66f997822717422d4ddfdc084
3
+ metadata.gz: fe5a5448e7e30ad547e467c6493f793b9148ea9cfea8317406902d53b4f7a270
4
+ data.tar.gz: 36b9e68a0797bb79118c51b68b56a2740b5ace3eaae26ed83af97b38f2f80cbc
5
5
  SHA512:
6
- metadata.gz: 7a490f1f175fdf0e663ae3f104c2901b86eed9e6d9b16192e59829802a821ae0cec67dc9a72400d7d40f2be228e3c8323508c8e7a210c1f562db0055d4e1a762
7
- data.tar.gz: 3ec540d2d05fae0b620a3ee89ac4c1dad8d06cd3387cca7a4076490b9710bedcece3a373500208517ac47f0d14469444c60c783f810227045e7ae831a404aaa5
6
+ metadata.gz: 4601b3a1361db40b6b5c4a4d718f47016299583155933ca2168471f0c94de92e81ee9328831b99203b81faa6a872f9ac745bdaaba77ff159513161b32c7a316c
7
+ data.tar.gz: ed839d853ee202832dc23572b52059ea00f1992e148740bc55ade1ec951d4a03759b6f4359e85c1efbb57029a69328f60df5de28d6fed70e548f852586ce88ab
data/Gemfile.lock CHANGED
@@ -8,8 +8,10 @@ PATH
8
8
  gli (~> 2.21)
9
9
  iri (~> 0.8)
10
10
  loog (~> 0.2)
11
+ moments (~> 0.3)
11
12
  nokogiri (~> 1.10)
12
13
  retries (~> 0.0)
14
+ tago (~> 0.0)
13
15
  typhoeus (~> 1.3)
14
16
 
15
17
  GEM
@@ -85,7 +87,7 @@ GEM
85
87
  erubi (1.12.0)
86
88
  ethon (0.16.0)
87
89
  ffi (>= 1.15.0)
88
- factbase (0.0.44)
90
+ factbase (0.0.48)
89
91
  json (~> 2.7)
90
92
  loog (~> 0.2)
91
93
  nokogiri (~> 1.10)
@@ -114,6 +116,7 @@ GEM
114
116
  loog (0.5.1)
115
117
  mini_mime (1.1.5)
116
118
  minitest (5.23.1)
119
+ moments (0.3.0)
117
120
  multi_test (1.1.0)
118
121
  mutex_m (0.2.0)
119
122
  net-ping (2.0.8)
@@ -131,7 +134,7 @@ GEM
131
134
  racc (~> 1.4)
132
135
  nokogiri (1.16.5-x86_64-linux)
133
136
  racc (~> 1.4)
134
- parallel (1.24.0)
137
+ parallel (1.25.1)
135
138
  parser (3.3.2.0)
136
139
  ast (~> 2.4.1)
137
140
  racc
@@ -139,7 +142,7 @@ GEM
139
142
  stringio
140
143
  public_suffix (5.0.5)
141
144
  racc (1.8.0)
142
- rack (3.0.11)
145
+ rack (3.1.0)
143
146
  rack-session (2.0.0)
144
147
  rack (>= 3.0.0)
145
148
  rack-test (2.1.0)
@@ -170,8 +173,8 @@ GEM
170
173
  reline (0.5.8)
171
174
  io-console (~> 0.5)
172
175
  retries (0.0.5)
173
- rexml (3.2.8)
174
- strscan (>= 3.0.9)
176
+ rexml (3.3.0)
177
+ strscan
175
178
  rspec-core (3.13.0)
176
179
  rspec-support (~> 3.13.0)
177
180
  rspec-expectations (3.13.0)
@@ -202,9 +205,9 @@ GEM
202
205
  unicode-display_width (>= 2.4.0, < 3.0)
203
206
  rubocop-ast (1.31.3)
204
207
  parser (>= 3.3.1.0)
205
- rubocop-capybara (2.20.0)
208
+ rubocop-capybara (2.21.0)
206
209
  rubocop (~> 1.41)
207
- rubocop-factory_bot (2.25.1)
210
+ rubocop-factory_bot (2.26.0)
208
211
  rubocop (~> 1.41)
209
212
  rubocop-performance (1.21.0)
210
213
  rubocop (>= 1.48.1, < 2.0)
@@ -214,7 +217,7 @@ GEM
214
217
  rubocop-capybara (~> 2.17)
215
218
  rubocop-factory_bot (~> 2.22)
216
219
  rubocop-rspec_rails (~> 2.28)
217
- rubocop-rspec_rails (2.28.3)
220
+ rubocop-rspec_rails (2.29.0)
218
221
  rubocop (~> 1.40)
219
222
  ruby-progressbar (1.13.0)
220
223
  simplecov (0.22.0)
@@ -228,8 +231,9 @@ GEM
228
231
  simplecov_json_formatter (0.1.4)
229
232
  stringio (3.1.0)
230
233
  strscan (3.1.0)
231
- sys-uname (1.2.3)
234
+ sys-uname (1.3.0)
232
235
  ffi (~> 1.1)
236
+ tago (0.0.1)
233
237
  thor (1.3.1)
234
238
  typhoeus (1.4.1)
235
239
  ethon (>= 0.9.0)
data/bin/judges CHANGED
@@ -64,6 +64,8 @@ class App
64
64
  c.flag([:'max-cycles'], default_value: 8, type: Integer)
65
65
  c.desc 'Stay quiet even if some judges fail'
66
66
  c.switch([:q, :quiet], default_value: false)
67
+ c.desc 'Use default logging facility'
68
+ c.switch([:log], default_value: true)
67
69
  c.action do |global, options, args|
68
70
  require_relative '../lib/judges/commands/update'
69
71
  Judges::Update.new(loog).run(options, args)
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.7.0'
29
+ s.version = '0.8.0'
30
30
  s.license = 'MIT'
31
31
  s.summary = 'Command-Line Tool for a Factbase'
32
32
  s.description =
@@ -48,8 +48,10 @@ Gem::Specification.new do |s|
48
48
  s.add_runtime_dependency 'gli', '~>2.21'
49
49
  s.add_runtime_dependency 'iri', '~>0.8'
50
50
  s.add_runtime_dependency 'loog', '~>0.2'
51
+ s.add_runtime_dependency 'moments', '~>0.3'
51
52
  s.add_runtime_dependency 'nokogiri', '~>1.10'
52
53
  s.add_runtime_dependency 'retries', '~>0.0'
54
+ s.add_runtime_dependency 'tago', '~>0.0'
53
55
  s.add_runtime_dependency 'typhoeus', '~>1.3'
54
56
  s.metadata['rubygems_mfa_required'] = 'true'
55
57
  end
@@ -45,7 +45,7 @@ class Judges::Update
45
45
  raise "The directory is absent: #{dir.to_rel}" unless File.exist?(dir)
46
46
  impex = Judges::Impex.new(@loog, args[1])
47
47
  fb = impex.import(strict: false)
48
- fb = Factbase::Looged.new(fb, @loog)
48
+ fb = Factbase::Looged.new(fb, @loog) if opts['log']
49
49
  before = fb.size
50
50
  options = Judges::Options.new(opts['option'])
51
51
  @loog.debug("The following options provided:\n\t#{options.to_s.gsub("\n", "\n\t")}")
@@ -87,7 +87,7 @@ class Judges::Update
87
87
  elapsed(@loog) do
88
88
  c = one_judge(fb, p, global, options)
89
89
  churn += c
90
- throw :"👍 The judge #{p.name} modified #{c} facts"
90
+ throw :"👍 The judge #{p.name} modified #{c.zero? ? 'no' : c} facts"
91
91
  end
92
92
  rescue StandardError, SyntaxError => e
93
93
  @loog.warn(Backtrace.new(e))
@@ -20,6 +20,8 @@
20
20
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  # SOFTWARE.
22
22
 
23
+ require 'tago'
24
+
23
25
  def elapsed(loog)
24
26
  start = Time.now
25
27
  begin
@@ -27,6 +29,6 @@ def elapsed(loog)
27
29
  rescue UncaughtThrowError => e
28
30
  tag = e.tag
29
31
  throw e unless tag.is_a?(Symbol)
30
- loog.info("#{tag} in #{format('%.02f', Time.now - start)}s")
32
+ loog.info("#{tag} in #{start.ago}")
31
33
  end
32
34
  end
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.7.0'
28
+ VERSION = '0.8.0'
29
29
  end
@@ -41,7 +41,7 @@ class TestPrint < Minitest::Test
41
41
  Judges::Print.new(Loog::NULL).run({ format: 'yaml', auto: true }, [f])
42
42
  y = File.join(d, 'base.yaml')
43
43
  assert(File.exist?(y))
44
- assert_equal(1, YAML.load_file(y)['facts'].size)
44
+ assert_equal(1, YAML.load_file(y).size)
45
45
  end
46
46
  end
47
47
 
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.7.0
4
+ version: 0.8.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-10 00:00:00.000000000 Z
11
+ date: 2024-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.2'
97
+ - !ruby/object:Gem::Dependency
98
+ name: moments
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.3'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.3'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: nokogiri
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +136,20 @@ dependencies:
122
136
  - - "~>"
123
137
  - !ruby/object:Gem::Version
124
138
  version: '0.0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: tago
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.0'
125
153
  - !ruby/object:Gem::Dependency
126
154
  name: typhoeus
127
155
  requirement: !ruby/object:Gem::Requirement