Class: PrelandsRails::CreateSimpleSource::Upload

Inherits:
Object
  • Object
show all
Includes:
Interactor, Interactor::Contracts, AbstractInteractor, Base
Defined in:
lib/prelands_rails/create_simple_source/upload.rb,
lib/prelands_rails/create_simple_source/upload/uploader.rb

Overview

Загрузит на aws скомпилированные html, icon.ico, index.js и содержимое директории images/

Defined Under Namespace

Classes: Uploader

Instance Method Summary collapse

Methods included from AbstractInteractor

#call

Instance Method Details

#actObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/prelands_rails/create_simple_source/upload.rb', line 35

def act
  context.bucket_names.each do |bucket_name|
    images_files.map do |file_name, file_path|
      @uploader.upload_file file_name, file_path, bucket_name
    end

    compiled_html_files.map do |file_name, content|
      @uploader.upload_content file_name, content, bucket_name
    end

    @uploader.upload_content 'index.js', context.files_content['index.js'], bucket_name
  end

  del_tmp_files
  context.uploaded_images = images_files
end