Class: Judges::Join

Inherits:
Object show all
Defined in:
lib/judges/commands/join.rb

Overview

Join.

Author

Yegor Bugayenko (yegor256@gmail.com)

Copyright

Copyright © 2024 Yegor Bugayenko

License

MIT

Instance Method Summary collapse

Constructor Details

#initialize(loog) ⇒ Join

Returns a new instance of Join.



32
33
34
# File 'lib/judges/commands/join.rb', line 32

def initialize(loog)
  @loog = loog
end

Instance Method Details

#run(_opts, args) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/judges/commands/join.rb', line 36

def run(_opts, args)
  raise 'Exactly two arguments required' unless args.size == 2
  master = Judges::Impex.new(@loog, args[0])
  slave = Judges::Impex.new(@loog, args[1])
  elapsed(@loog) do
    fb = master.import
    slave.import_to(fb)
    master.export(fb)
    throw :'Two factbases joined'
  end
end