Class: Krb::Download::Base

Inherits:
ApplicationService show all
Defined in:
lib/krb/download/base.rb

Overview

Download methods

Instance Method Summary collapse

Methods inherited from ApplicationService

process, #prompt, #setup_file_name, #setup_file_path, #verify_admin, #verify_production, #verify_setup

Constructor Details

#initializeBase

Returns a new instance of Base.



9
10
11
12
13
14
# File 'lib/krb/download/base.rb', line 9

def initialize
  super
  verify_setup
  verify_production
  @cmd = ::TTY::Command.new
end

Instance Method Details

#processObject



16
17
18
19
20
21
# File 'lib/krb/download/base.rb', line 16

def process
  @cmd.run('rm -rf ./content')
  @cmd.run("wget -q https://#{setup.dig('production_namespace')}.ngx.host/download -O ./content.zip")
  @cmd.run("unzip -q ./content.zip -d ./content")
  @cmd.run("rm -rf ./content/lost+found content.zip")
end