Skip to content

Commit

Permalink
testing fix for #20
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioRuiz committed Feb 24, 2020
1 parent 81cbb61 commit 33232c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/nice_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,11 @@ def initialize(args = {})
log_filename = @log.dup
unless log_filename.start_with?(".")
if caller.first.start_with?(Dir.pwd)
folder = File.dirname(caller.first[/[^:]+/])
folder = File.dirname(caller.first.scan(/(.+):\d/).join)
else
folder = File.dirname("#{Dir.pwd}/#{caller.first[/[^:]+/]}")
folder = File.dirname("#{Dir.pwd}/#{caller.first.scan(/(.+):\d/).join}")
end
folder += "/" unless log_filename.start_with?("/")
folder += "/" unless log_filename.start_with?("/") or log_filename.start_with?(/\w+:/)
log_filename = folder + log_filename
end
require "fileutils"
Expand All @@ -389,7 +389,7 @@ def initialize(args = {})
elsif @log == :file
log_filename = "nice_http_#{Time.now.strftime("%Y-%m-%d-%H%M%S")}.log"
elsif @log == :file_run
log_filename = "#{caller.first[/[^:]+/]}.log"
log_filename = "#{caller.first.scan(/(.+):\d/).join}.log"
end
if Thread.current.name.to_s != ""
log_filename.gsub!(/\.log$/, "_#{Thread.current.name}.log")
Expand Down

0 comments on commit 33232c2

Please sign in to comment.