Sha256: 4d642d9bd865e9ac38364f9f0b1ded2a6852f5ba19548b245f87418b20d001d6

Contents?: true

Size: 1016 Bytes

Versions: 12

Compression:

Stored size: 1016 Bytes

Contents

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

require 'nokogiri'
require 'rest-client'

module Ragoon
  @@secret_options = {}

  def self.garoon_endpoint
    ENV['GAROON_ENDPOINT'] || secret_options[:garoon_endpoint] || raise_option_error('endpoint')
  end

  def self.garoon_username
    ENV['GAROON_USERNAME'] || secret_options[:garoon_username] || raise_option_error('username')
  end

  def self.garoon_password
    ENV['GAROON_PASSWORD'] || secret_options[:garoon_password] || raise_option_error('password')
  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?
      raise '`./.secret_options` is required.' unless File.exists?('./.secret_options')
      @@secret_options = eval(File.read('./.secret_options'))
    end
    @@secret_options
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ragoon-0.5.2 lib/ragoon.rb
ragoon-0.5.1 lib/ragoon.rb
ragoon-0.5.0 lib/ragoon.rb
ragoon-0.4.3 lib/ragoon.rb
ragoon-0.4.2 lib/ragoon.rb
ragoon-0.4.1 lib/ragoon.rb
ragoon-0.4.0 lib/ragoon.rb
ragoon-0.3.1 lib/ragoon.rb
ragoon-0.3.0 lib/ragoon.rb
ragoon-0.2.2 lib/ragoon.rb
ragoon-0.2.1 lib/ragoon.rb
ragoon-0.2.0 lib/ragoon.rb