Class: RubyTapasDownloader::CLI

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

Overview

The Command Line Interface for Ruby Tapas Downloader.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.download_long_descriptionObject

Long description for download action



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

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



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

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

#downloadObject



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

def download
  create_agent
  
  fetch_feed
  create_catalog
  download_catalog
end