Class: Object

Inherits:
BasicObject
Defined in:
lib/core/object.rb

Instance Method Summary collapse

Instance Method Details

#pool(name = nil, &block) ⇒ Object



3
4
5
# File 'lib/core/object.rb', line 3

def pool(name=nil, &block)
  @@pool ||= PoolParty::Pool.new(name, &block)
end


11
12
13
14
15
# File 'lib/core/object.rb', line 11

def print_msg(msg_arr)
  msg_arr.each do |line|
    puts line
  end
end

#progress_bar_until(msg = nil, &block) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/core/object.rb', line 17

def progress_bar_until(msg=nil, &block)
  print "#{msg}" if msg
  loop do
    if block.call
      break
    else
      $stdout.print "."
      $stdout.flush
      sleep 1
    end
  end
  print " OK" if msg
  puts "" if msg
end

#reset!Object



7
8
9
# File 'lib/core/object.rb', line 7

def reset!
  @@pool = nil
end