module Ragoon

Constants

VERSION

Public Class Methods

default_options() click to toggle source
# File lib/ragoon.rb, line 17
def self.default_options
  {
    endpoint: ENV['GAROON_ENDPOINT'] || raise_option_error('endpoint'),
    username: ENV['GAROON_USERNAME'] || raise_option_error('username'),
    password: ENV['GAROON_PASSWORD'] || raise_option_error('password'),
    version:  ENV['GAROON_VERSION']  || 4,
    retry:    ENV['GAROON_RETRY']    || 10,
    skip_verify_ssl: !!ENV['SKIP_VERIFY_SSL'] || false,
  }
end
raise_option_error(type) click to toggle source
# File lib/ragoon.rb, line 28
def self.raise_option_error(type)
  raise "must specify garoon_#{type} by ENV or `./.secret_options`."
end

Private Class Methods

secret_options() click to toggle source
# File lib/ragoon.rb, line 34
def self.secret_options
  if @@secret_options.empty?
    if File.exist?('./.secret_options')
      @@secret_options = eval(File.read('./.secret_options'))
    else
      @@secret_options = default_options
    end
  end
  @@secret_options
end