Fix import paths
* DownloadManager was moved to downloaders/ * import_data task now uses the PostDeployment version of DataImporter
This commit is contained in:
parent
3c8b4fdcce
commit
9255cce58e
3 changed files with 33 additions and 5 deletions
28
lib/granblue/downloaders/download_manager.rb
Normal file
28
lib/granblue/downloaders/download_manager.rb
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Granblue
|
||||
module Downloaders
|
||||
class DownloadManager
|
||||
class << self
|
||||
def download_for_object(type, granblue_id, test_mode: false, verbose: false, storage: :both)
|
||||
downloader_options = {
|
||||
test_mode: test_mode,
|
||||
verbose: verbose,
|
||||
storage: storage
|
||||
}
|
||||
|
||||
case type
|
||||
when 'character'
|
||||
CharacterDownloader.new(granblue_id, **downloader_options).download
|
||||
when 'weapon'
|
||||
WeaponDownloader.new(granblue_id, **downloader_options).download
|
||||
when 'summon'
|
||||
SummonDownloader.new(granblue_id, **downloader_options).download
|
||||
else
|
||||
log_info "Unknown object type: #{type}" if verbose || test_mode
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -6,7 +6,7 @@ require_relative '../granblue/downloaders/character_downloader'
|
|||
require_relative '../granblue/downloaders/weapon_downloader'
|
||||
require_relative '../granblue/downloaders/summon_downloader'
|
||||
require_relative '../granblue/downloaders/elemental_weapon_downloader'
|
||||
require_relative '../granblue/download_manager'
|
||||
require_relative '../granblue/downloaders/download_manager'
|
||||
|
||||
module PostDeployment
|
||||
class ImageDownloader
|
||||
|
|
@ -19,9 +19,9 @@ module PostDeployment
|
|||
}.freeze
|
||||
|
||||
SUPPORTED_TYPES = {
|
||||
'character' => Granblue::Downloader::CharacterDownloader,
|
||||
'summon' => Granblue::Downloader::SummonDownloader,
|
||||
'weapon' => Granblue::Downloader::WeaponDownloader
|
||||
'character' => Granblue::Downloaders::CharacterDownloader,
|
||||
'summon' => Granblue::Downloaders::SummonDownloader,
|
||||
'weapon' => Granblue::Downloaders::WeaponDownloader
|
||||
}.freeze
|
||||
|
||||
def initialize(test_mode:, verbose:, storage:, new_records:, updated_records:)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace :granblue do
|
|||
Dir[Rails.root.join('lib', 'granblue', '**', '*.rb')].each { |file| require file }
|
||||
|
||||
test_mode = ENV['TEST'] == 'true'
|
||||
importer = Granblue::DataImporter.new(test_mode: test_mode)
|
||||
importer = Granblue::PostDeployment::DataImporter.new(test_mode: test_mode)
|
||||
importer.process_all_files
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue