judges 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/zerocracy.yaml +5 -1
- data/bin/judges +2 -1
- data/judges.gemspec +1 -1
- data/lib/judges/commands/print.rb +6 -1
- data/test/commands/test_print.rb +2 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 550115852b44ae26b7af9cb776bcbf9e5b7e043579ab8eec3930854f573a6768
|
4
|
+
data.tar.gz: 7efe473542ffd401220d8e5b65d853ba144ad8ceab0273f9531e3d462e072afc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '096f25e43ee418b94ae0a2f4b3d678c170170dfda2228191a269931bcfa1150e4f50151830e1132b3282ccaa768b2129deb8f29e55faebefd0bc7c2bd5ce2700'
|
7
|
+
data.tar.gz: d3f8922eeee30008f3883a7592667ce084a1d96785c4b04c51478c028ba99aa28eaddd151ac13a1bb7a101de8cc0f05434d22edcf6bbb1691b4bb76a4bd89067
|
@@ -31,8 +31,12 @@ jobs:
|
|
31
31
|
steps:
|
32
32
|
- uses: actions/checkout@v4
|
33
33
|
- uses: zerocracy/judges-action@master
|
34
|
+
with:
|
35
|
+
factbase: recent.fb
|
36
|
+
- run: mkdir gh-pages && cp recent.yml gh-pages
|
34
37
|
- uses: JamesIves/github-pages-deploy-action@v4.6.0
|
35
38
|
with:
|
36
39
|
branch: gh-pages
|
37
|
-
folder:
|
40
|
+
folder: gh-pages/recent.yml
|
41
|
+
factbase: recent.fb
|
38
42
|
clean: true
|
data/bin/judges
CHANGED
@@ -36,7 +36,7 @@ class App
|
|
36
36
|
|
37
37
|
program_desc 'Automated executor of judges for a factbase'
|
38
38
|
|
39
|
-
version '0.0.
|
39
|
+
version '0.0.10'
|
40
40
|
|
41
41
|
desc 'Make it more verbose, logging as much as possible'
|
42
42
|
switch([:v, :verbose])
|
@@ -62,6 +62,7 @@ class App
|
|
62
62
|
command :print do |c|
|
63
63
|
c.desc 'Output format (xml, json, or yaml)'
|
64
64
|
c.flag([:format], default_value: 'yaml')
|
65
|
+
c.switch([:auto])
|
65
66
|
c.action do |global, options, args|
|
66
67
|
require_relative '../lib/judges/commands/print'
|
67
68
|
Judges::Print.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.0.
|
29
|
+
s.version = '0.0.10'
|
30
30
|
s.license = 'MIT'
|
31
31
|
s.summary = 'Command-Line Tool for a Factbase'
|
32
32
|
s.description = '
|
@@ -35,10 +35,15 @@ class Judges::Print
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def run(opts, args)
|
38
|
-
raise '
|
38
|
+
raise 'At lease one argument required' if args.empty?
|
39
39
|
f = args[0]
|
40
40
|
raise "The file is absent: #{f}" unless File.exist?(f)
|
41
41
|
o = args[1]
|
42
|
+
if o.nil?
|
43
|
+
raise 'Either provide output file name or use --auto' unless opts[:auto]
|
44
|
+
o = File.join(File.dirname(f), File.basename(f).gsub(/\.[^.]*$/, ''))
|
45
|
+
o = "#{o}.#{opts[:format]}"
|
46
|
+
end
|
42
47
|
fb = Factbase.new
|
43
48
|
fb.import(File.read(f))
|
44
49
|
@loog.info("Factbase imported from #{f} (#{File.size(f)} bytes)")
|
data/test/commands/test_print.rb
CHANGED
@@ -38,9 +38,8 @@ class TestPrint < Minitest::Test
|
|
38
38
|
fb = Factbase.new
|
39
39
|
fb.insert
|
40
40
|
File.write(f, fb.export)
|
41
|
-
|
42
|
-
|
43
|
-
puts File.read(y)
|
41
|
+
Judges::Print.new(Loog::VERBOSE).run({ format: 'yaml', auto: true }, [f])
|
42
|
+
y = File.join(d, 'base.yaml')
|
44
43
|
assert(File.exist?(y))
|
45
44
|
assert_equal(1, YAML.load_file(y)['facts'].size)
|
46
45
|
end
|