Try to debug linux spec on travis
This commit is contained in:
parent
905c32dcc9
commit
18cb3471af
@ -42,6 +42,7 @@ module Guard
|
|||||||
|
|
||||||
def start_reactor
|
def start_reactor
|
||||||
return if ENV["GUARD_ENV"] == 'test'
|
return if ENV["GUARD_ENV"] == 'test'
|
||||||
|
p "start_reactor"
|
||||||
Thread.new do
|
Thread.new do
|
||||||
loop do
|
loop do
|
||||||
if @changed_files != [] && !@locked
|
if @changed_files != [] && !@locked
|
||||||
@ -86,6 +87,8 @@ module Guard
|
|||||||
last_event = @last_event.dup
|
last_event = @last_event.dup
|
||||||
update_last_event
|
update_last_event
|
||||||
files = potentially_modified_files(dirs, options).select { |path| file_modified?(path, last_event) }
|
files = potentially_modified_files(dirs, options).select { |path| file_modified?(path, last_event) }
|
||||||
|
p "modified_files"
|
||||||
|
p files
|
||||||
relativize_paths(files)
|
relativize_paths(files)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -143,13 +146,25 @@ module Guard
|
|||||||
# Depending on the filesystem, mtime is probably only precise to the second, so round
|
# Depending on the filesystem, mtime is probably only precise to the second, so round
|
||||||
# both values down to the second for the comparison.
|
# both values down to the second for the comparison.
|
||||||
def file_modified?(path, last_event)
|
def file_modified?(path, last_event)
|
||||||
|
p path
|
||||||
|
p last_event.to_i
|
||||||
|
p File.ctime(path).to_i
|
||||||
if File.ctime(path).to_i == last_event.to_i
|
if File.ctime(path).to_i == last_event.to_i
|
||||||
file_content_modified?(path, sha1_checksum(path))
|
p "File.ctime == last_event"
|
||||||
|
res = file_content_modified?(path, sha1_checksum(path))
|
||||||
|
p res.to_s
|
||||||
|
res
|
||||||
elsif File.ctime(path).to_i > last_event.to_i
|
elsif File.ctime(path).to_i > last_event.to_i
|
||||||
|
p "File.ctime > last_event"
|
||||||
set_sha1_checksums_hash(path, sha1_checksum(path))
|
set_sha1_checksums_hash(path, sha1_checksum(path))
|
||||||
|
p "true"
|
||||||
true
|
true
|
||||||
|
else
|
||||||
|
p "false"
|
||||||
|
false
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
|
p "false"
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -4,6 +4,6 @@ require 'guard/listeners/polling'
|
|||||||
describe Guard::Polling do
|
describe Guard::Polling do
|
||||||
subject { Guard::Polling }
|
subject { Guard::Polling }
|
||||||
|
|
||||||
it_should_behave_like "a listener that reacts to #on_change"
|
it_should_behave_like "a listener that reacts to #on_change", 2
|
||||||
it_should_behave_like "a listener scoped to a specific directory"
|
it_should_behave_like "a listener scoped to a specific directory"
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user