Top Level Namespace
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
66 67 68 69 |
# File 'lib/parallel_run.rb', line 66 def output content, pname, flow = "" start = "#{pname}::#{flow}".ljust([:padding_size]) puts "[#{start} #{Time.now.strftime($options[:time_format])}] #{content}" end |
#replace(s, value, k) ⇒ Object
71 72 73 74 75 76 77 |
# File 'lib/parallel_run.rb', line 71 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 |