Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate DownloadService and change fias:download task #22

Open
ghost opened this issue May 14, 2019 · 1 comment
Open

Deprecate DownloadService and change fias:download task #22

ghost opened this issue May 14, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented May 14, 2019

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
Copy link
Author

ghost commented May 14, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants