Top Level Namespace

Defined Under Namespace

Modules: Enumerable

Constant Summary collapse

DEFAULT_TIME_FORMAT =
"%H:%M:%S"
DEFAULT_PADDING_SIZE =
20

Instance Method Summary collapse

Instance Method Details

#output(content, pname, flow = "") ⇒ Object



70
71
72
73
# File 'lib/parallel_run.rb', line 70

def output content, pname, flow = ""
  start = "#{pname}::#{flow}".ljust($options[:padding_size])
  puts "[#{start} #{Time.now.strftime($options[:time_format])}] #{content}"
end

#replace(s, value, k) ⇒ Object



75
76
77
78
79
80
81
# File 'lib/parallel_run.rb', line 75

def replace s, value, k
  s = s.gsub(/%v/, value)
  s = s.gsub(/%b/, File.basename(value))
  s = s.gsub(/%d/, File.dirname(value))
  s = s.gsub(/%k/, k.to_s)
  s
end