judges 0.0.9 → 0.0.10

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: da7a3c5173e276f56441e87c312ce192650cbd0777846c5326cf7dd067bc90df
4
- data.tar.gz: fb1a4eb7b10b2fa31e29b87462bca14d26dd01c5d77ce0468148f06bfcc7de08
3
+ metadata.gz: 550115852b44ae26b7af9cb776bcbf9e5b7e043579ab8eec3930854f573a6768
4
+ data.tar.gz: 7efe473542ffd401220d8e5b65d853ba144ad8ceab0273f9531e3d462e072afc
5
5
  SHA512:
6
- metadata.gz: aaa735ed030325cdf7800c6f4c34229de7b8bbee35acb685fa6f61a3e3bdfe989522c2f3eacf356fb13c26324e258c7a26021678fa6a3aa052ea52b2141f4fc5
7
- data.tar.gz: 773bdad461b779ee18124bcab2da86142faab47cf866a6b9ee86c04e6cd42e2d5f4647d37dcfdca26dbbcc4e64531c374a08ab60adad0f2788c3dce9690c2bab
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: factbase.yml
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.9'
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.9'
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 'Exactly two arguments required' unless args.size == 2
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)")
@@ -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
- y = File.join(d, 'base.yml')
42
- Judges::Print.new(Loog::VERBOSE).run({ format: 'yaml' }, [f, y])
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
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.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko