Class: Feedlrop::Cli

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

Class Method Summary collapse

Class Method Details

.setupObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/feedlrop/cli.rb', line 5

def self.setup
  token = ENV.fetch("FEEDLY_DEVELOPER_ACCESS_TOKEN", nil)
  user_id = ENV.fetch("FEEDLER_USE_ID", nil)
  env = ENV.fetch("ENV", nil)
  # env ||= "development"
  env ||= "production"

  hash = {
    'db_dir' => Arxutils_Sqlite3::Config::DB_DIR,
    'migrate_dir' => Arxutils_Sqlite3::Config::MIGRATE_DIR,
    'config_dir' => Arxutils_Sqlite3::Config::CONFIG_DIR,
    "dbconfig" => Arxutils_Sqlite3::Config::DBCONFIG_SQLITE3,
    'env' => env,
    'log_fname' => Arxutils_Sqlite3::Config::DATABASELOG,
    'output_dir' => ::Feedlrop::OUTPUT_DIR,
    'pstore_dir' =>  ::Feedlrop::PSTORE_DIR,
  }

  [token, user_id, hash]
end