Module: Jeka::Console
- Defined in:
- lib/jeka/console.rb
Class Method Summary collapse
- ._show(p, t, o, s) ⇒ Object
- .add_algorithms(dir) ⇒ Object
- .build ⇒ Object
- .run(n = 1, output = "analysis.jeka") ⇒ Object
- .test ⇒ Object
Class Method Details
._show(p, t, o, s) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/jeka/console.rb', line 35 def self._show(p, t, o, s) case t when :step p = p.to_s while p.length < 3 p = " " + p end puts "[#{p}%] #{o}" when :output if s o = o.join if o.length > 0 puts o end end when :test puts " > #{o}" when :error o = o.join if o.length > 0 puts o end error = true when :done if error puts "[100%] Some error occurs..." else puts "[100%] Done!" end end end |
.add_algorithms(dir) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/jeka/console.rb', line 4 def self.add_algorithms(dir) Jeka::Algorithm.reset ok = false Dir.glob(dir).each do |d| ok = true load d end ok end |
.build ⇒ Object
21 22 23 24 25 26 |
# File 'lib/jeka/console.rb', line 21 def self.build error = false Jeka::Algorithm.build_all do |p, t, o| self._show(p, t, o, true) end end |