Sha256: e77ed592951ef193c24e48cbc72b78699e86e5bb3d7245909906966c20cfeeac

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

require 'nokogiri'
require 'rest-client'
require 'time'

require 'ragoon/version'
require 'ragoon/xml'
require 'ragoon/error'
require 'ragoon/client'
require 'ragoon/services'
require 'ragoon/services/schedule'
require 'ragoon/services/notification'
require 'ragoon/services/workflow'

module Ragoon
  @@secret_options = {}

  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,
    }
  end

  def self.raise_option_error(type)
    raise "must specify garoon_#{type} by ENV or `./.secret_options`."
  end

  private

  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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ragoon-1.1.0 lib/ragoon.rb