Dir.open(‘Logs’) do |dir|
dir.each do |file|
puts file
File.open(file).each_line do |entry|
puts entry
if /Test Condition Passed/ =~ entry
passcount += 1
#puts “passcount reached”
elsif /Test Condition Failed/ =~ entry
failcount += 1
#puts “failcount reached”
end
end
end
end
the above piece of code when I run it from eclipse generates this error:
C:/workspace/CV_Auto/grapher.rb:10:in initialize': Permission denied - . (Errno::EACCES) from C:/workspace/CV_Auto/grapher.rb:10:in
open’
from C:/workspace/CV_Auto/grapher.rb:10
from C:/workspace/CV_Auto/grapher.rb:8:in each' from C:/workspace/CV_Auto/grapher.rb:8 from C:/workspace/CV_Auto/grapher.rb:7:in
open’
from C:/workspace/CV_Auto/grapher.rb:7
I’m perhaps being dim (not the first time), but can’t see where I’m
going wrong?