Class: RubyTapasDownloader::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/ruby_tapas_downloader/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.download_long_descriptionObject

Long description for download action



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ruby_tapas_downloader/cli.rb', line 10

def self.download_long_description
  env_vars = RubyTapasDownloader::Config::CONFIG_KEYS.join(',')
  <<-LONG_DESC
To download you need to be authenticated, you have tree options:

- Pass the params described before

- Use `ruby-tapas-downloader configure`

- Pass/export env vars: #{ env_vars }
  LONG_DESC
end

Instance Method Details

#configureObject



54
55
56
57
58
# File 'lib/ruby_tapas_downloader/cli.rb', line 54

def configure
  RubyTapasDownloader::Config.update(
    email: email, password: password, download_path: download_path
  )
end

#downloadObject



41
42
43
44
45
46
47
# File 'lib/ruby_tapas_downloader/cli.rb', line 41

def download
  create_agent
  
  fetch_feed
  create_catalog
  download_catalog
end