fias icon indicating copy to clipboard operation
fias copied to clipboard

Deprecate DownloadService and change fias:download task

Open ghost opened this issue 5 years ago • 1 comments

There is no need in lib/fias/import/download_service.rb anymore, you can always use URI https://fias.nalog.ru/Public/Downloads/Actual/fias_dbf.rar to fetch the latest version of FIAS.

Basically, current fias:download task can be replaced with the following:

task :download do
  puts 'https://fias.nalog.ru/Public/Downloads/Actual/fias_dbf.rar'
end

But since it barely does anything and you need to chain it with wget anyway to actually download FIAS, I propose rewriting it:

FIAS_URI = 'https://fias.nalog.ru/Public/Downloads/Actual/fias_dbf.rar'

task :download do
  sh "wget #{FIAS_URI}"
end

This way, running rake fias:download is enough to download the latest FIAS. What do you think? Should I make a PR out of this, updating README and stuff?

ghost avatar May 14 '19 17:05 ghost

Removing DownloadService also allows to remove httparty dependency, because it's used only in there.

ghost avatar May 14 '19 17:05 ghost