lib/aranha/fixtures/download.rb in aranha-0.6.0 vs lib/aranha/fixtures/download.rb in aranha-0.7.0

- old
+ new

@@ -1,7 +1,9 @@ # frozen_string_literal: true +require 'aranha/parsers/source_address' + module Aranha module Fixtures class Download attr_reader :pending @@ -42,10 +44,10 @@ Rails.logger.info "Baixando \"#{url}\"..." File.open(target, 'wb') { |file| file.write(::Aranha::Parsers::Base.new(url).content) } end def url(file) - File.read(file).strip + ::Aranha::Parsers::SourceAddress.from_file(file) end def target(file) File.expand_path(File.basename(file, '.url') + '.source.html', File.dirname(file)) end