lib/aranha/parsers/source_address/file.rb in aranha-parsers-0.21.0 vs lib/aranha/parsers/source_address/file.rb in aranha-parsers-0.22.0

- old
+ new

@@ -8,11 +8,11 @@ class File < ::Aranha::Parsers::SourceAddress::HttpGet SCHEME = 'file://' class << self def valid_source?(source) - source.to_s.start_with?(SCHEME + '/', '/') + source.to_s.start_with?("#{SCHEME}/", '/') end end def initialize(source) super source.to_s.gsub(/\A#{Regexp.quote(SCHEME)}/, '') @@ -21,10 +21,10 @@ def url "#{SCHEME}#{source}" end def content - ::File.open(source, &:read) + ::File.read(source) end end end end end