Class: AmazonStaticSite::Worker

Inherits:
Object
  • Object
show all
Defined in:
lib/amazon_static_site/worker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file:, folder:) ⇒ Worker

Returns a new instance of Worker.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/amazon_static_site/worker.rb', line 5

def initialize(file:, folder:)
  @config   = Config.new(file: file, folder: folder)
  @service  = Service.new(config)

  puts "Starting...".yellow
  puts "  Config file: #{config.file}"
  puts "  Folder to upload: #{config.folder}"

  puts "Connecting to Amazon:".yellow
  service.run_s3

  puts "Uploading to Amazon:".yellow
  service.run_upload

  puts "Configure Cloudflare:".yellow
  service.run_cloudflare
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



3
4
5
# File 'lib/amazon_static_site/worker.rb', line 3

def config
  @config
end

#serviceObject (readonly)

Returns the value of attribute service.



3
4
5
# File 'lib/amazon_static_site/worker.rb', line 3

def service
  @service
end