Class: Yao::Yrb::Cli

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/yao/yrb/cli.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/yao/yrb/cli.rb', line 22

def execute
  yao_setup

  if script_mode.size.positive?
    script_file = script_mode.first
    load script_file
  else
    IRB.setup(__FILE__)
    conf = IRB.conf
    conf[:AP_NAME] = 'yrb'
    conf[:IRB_NAME] = 'yrb'
    irb = IRB::Irb.new
    irb.run(conf)
  end
end

#yao_setupObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/yao/yrb/cli.rb', line 38

def yao_setup
  Yao.configure do
    auth_url              ENV['OS_AUTH_URL']
    tenant_name           ENV['OS_TENANT_NAME']
    username              ENV['OS_USERNAME']
    password              ENV['OS_PASSWORD']
    ca_cert               ENV['OS_CACERT']
    client_cert           ENV['OS_CERT']
    client_key            ENV['OS_KEY']
    region_name           ENV['OS_REGION_NAME']
    identity_api_version  ENV['OS_IDENTITY_API_VERSION']
    user_domain_name      ENV['OS_USER_DOMAIN_NAME']
    project_domain_name   ENV['OS_PROJECT_DOMAIN_NAME']
    debug                 ENV['YAO_DEBUG']
    debug_record_response ENV['YAO_DEBUG_RECORD_RESPONSE']
  end
end