lib/rgot/common.rb in rgot-1.1.0 vs lib/rgot/common.rb in rgot-1.2.0
- old
+ new
@@ -1,14 +1,16 @@
+# frozen_string_literal: true
+
require 'thread'
require 'pathname'
module Rgot
class Common
attr_accessor :output
def initialize
- @output = ""
+ @output = "".dup
@failed = false
@skipped = false
@finished = false
@start = Rgot.now
@mutex = Mutex.new
@@ -98,10 +100,11 @@
# internal_log -> synchronize -> internal_log -> other log -> running method
c = caller[4]
path = c.sub(/:.*/, '')
line = c.match(/:(\d+?):/)[1]
relative_path = Pathname.new(path).relative_path_from(Pathname.new(Dir.pwd)).to_s
- "\t#{relative_path}:#{line}: #{str}\n"
+ # Every line is indented at least 4 spaces.
+ " #{relative_path}:#{line}: #{str}\n"
end
def internal_log(msg)
@mutex.synchronize { @output << decorate(msg) }
end