judges 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/judges +1 -1
- data/judges.gemspec +2 -2
- data/lib/judges/commands/test.rb +2 -1
- data/lib/judges/commands/update.rb +3 -1
- data/lib/judges/fb/if_absent.rb +1 -1
- data/test/fb/test_if_absent.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e7ff33d6367a36af90626c45f6ba74195f2e5383bf5f6f30c2888e5ba02eb07
|
4
|
+
data.tar.gz: b8032fc55743542a488d478cb4eb4dab78b979c2aec60ad6fbbeca3c53eceb5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02cb9fee069f3ed10bfad753df016b20b2e1736a66ad9ab633e309f5ae99d5e8445d92f4e909ac826bf95f6cf8b73f3eb2e07968cd38129738e918dcd8f972aa
|
7
|
+
data.tar.gz: a097276735f3a2f5226061f807c82cb97920aa3ad27e660dc9d7328489dab28692dd0a772a8529a078ffdcc175a145a059b1441206e9f8d9378751ed9b9e3b1c
|
data/bin/judges
CHANGED
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.
|
29
|
+
s.version = '0.0.20'
|
30
30
|
s.license = 'MIT'
|
31
31
|
s.summary = 'Command-Line Tool for a Factbase'
|
32
32
|
s.description = '
|
@@ -42,7 +42,7 @@ Gem::Specification.new do |s|
|
|
42
42
|
s.rdoc_options = ['--charset=UTF-8']
|
43
43
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
44
44
|
s.add_runtime_dependency 'backtrace', '~> 0.3'
|
45
|
-
s.add_runtime_dependency 'factbase', '~>0.0.
|
45
|
+
s.add_runtime_dependency 'factbase', '~>0.0.17'
|
46
46
|
s.add_runtime_dependency 'gli', '~>2.21'
|
47
47
|
s.add_runtime_dependency 'loog', '~>0.2'
|
48
48
|
s.add_runtime_dependency 'nokogiri', '~> 1.10'
|
data/lib/judges/commands/test.rb
CHANGED
@@ -23,6 +23,7 @@
|
|
23
23
|
require 'nokogiri'
|
24
24
|
require 'factbase'
|
25
25
|
require 'backtrace'
|
26
|
+
require 'factbase/looged'
|
26
27
|
require_relative '../../judges'
|
27
28
|
require_relative '../../judges/to_rel'
|
28
29
|
require_relative '../../judges/packs'
|
@@ -89,7 +90,7 @@ class Judges::Test
|
|
89
90
|
end
|
90
91
|
end
|
91
92
|
end
|
92
|
-
pack.run(fb, Judges::Options.new(yaml['options']))
|
93
|
+
pack.run(Factbase::Looged.new(fb, @loog), Judges::Options.new(yaml['options']))
|
93
94
|
xml = Nokogiri::XML.parse(fb.to_xml)
|
94
95
|
yaml['expected'].each do |xp|
|
95
96
|
raise "#{pack.script} doesn't match '#{xp}':\n#{xml}" if xml.xpath(xp).empty?
|
@@ -21,6 +21,7 @@
|
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
23
|
require 'backtrace'
|
24
|
+
require 'factbase/looged'
|
24
25
|
require_relative '../../judges'
|
25
26
|
require_relative '../../judges/to_rel'
|
26
27
|
require_relative '../../judges/packs'
|
@@ -42,6 +43,7 @@ class Judges::Update
|
|
42
43
|
raise "The directory is absent: #{dir.to_rel}" unless File.exist?(dir)
|
43
44
|
impex = Judges::Impex.new(@loog, args[1])
|
44
45
|
fb = impex.import(strict: false)
|
46
|
+
fb = Factbase::Looged.new(fb, @loog)
|
45
47
|
options = Judges::Options.new(opts['option'])
|
46
48
|
@loog.debug("The following options provided:\n\t#{options.to_s.gsub("\n", "\n\t")}")
|
47
49
|
packs = Judges::Packs.new(dir, @loog)
|
@@ -65,7 +67,7 @@ class Judges::Update
|
|
65
67
|
errors = []
|
66
68
|
diff = 0
|
67
69
|
done = packs.each_with_index do |p, i|
|
68
|
-
@loog.info("Running #{p.
|
70
|
+
@loog.info("👍 Running #{p.name} (##{i}) at #{p.dir.to_rel}...")
|
69
71
|
before = fb.size
|
70
72
|
begin
|
71
73
|
p.run(fb, options)
|
data/lib/judges/fb/if_absent.rb
CHANGED
@@ -27,7 +27,7 @@ def if_absent(fb)
|
|
27
27
|
attrs = {}
|
28
28
|
f = Judges::Accumulator.new(attrs)
|
29
29
|
yield f
|
30
|
-
q = attrs.map { |k, v| "(eq #{k} #{v})" }.join(' ')
|
30
|
+
q = attrs.map { |k, v| "(eq #{k} '#{v}')" }.join(' ')
|
31
31
|
return unless fb.query("(and #{q})").each.to_a.empty?
|
32
32
|
n = fb.insert
|
33
33
|
attrs.each { |k, v| n.send("#{k}=", v) }
|
data/test/fb/test_if_absent.rb
CHANGED
@@ -33,9 +33,9 @@ require_relative '../../lib/judges/fb/if_absent'
|
|
33
33
|
class TestIfAbsent < Minitest::Test
|
34
34
|
def test_ignores
|
35
35
|
fb = Factbase.new
|
36
|
-
fb.insert.foo =
|
36
|
+
fb.insert.foo = 'hello dude'
|
37
37
|
n = if_absent(fb) do |f|
|
38
|
-
f.foo =
|
38
|
+
f.foo = 'hello dude'
|
39
39
|
end
|
40
40
|
assert(n.nil?)
|
41
41
|
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.
|
4
|
+
version: 0.0.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.0.
|
33
|
+
version: 0.0.17
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.0.
|
40
|
+
version: 0.0.17
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: gli
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|