lib/cistern/coverage.rb in cistern-2.2.3 vs lib/cistern/coverage.rb in cistern-2.2.4
- old
+ new
@@ -1,12 +1,15 @@
module Cistern::Coverage
-
unless Kernel.respond_to? :caller_locations
abort <<-ABORT
Cannot enable Cistern coverage reporting
-Your ruby version ruby is: #{RUBY_VERSION rescue 'unknown'}
+Your ruby version ruby is: #{begin
+ RUBY_VERSION
+ rescue
+ 'unknown'
+ end}
`Kernel` does not have the required method `caller_locations`
Try a newer ruby (should be > 2.0)
ABORT
end
@@ -16,19 +19,18 @@
enum = caller_locations.each
call = nil
# seek to the first entry from within `file`
- while(call = enum.next) do
+ while (call = enum.next)
break if call.path.end_with? file
end
# seek to the first entry thats not within `file`
- while(call = enum.next) do
+ while (call = enum.next)
break unless call.path.end_with? file
end
# the call location that called in to `file`
call
end
-
end