Sha256: c800274305a464e9c353b16645130aca93ae7de4ff0057e87e0307004b7b65e0

Contents?: true

Size: 711 Bytes

Versions: 1

Compression:

Stored size: 711 Bytes

Contents

$LOAD_PATH << File.expand_path('../../lib', __FILE__)
require 'larrow/qingcloud'
require 'pry'
require 'pry-nav'
require 'simplecov'
require 'yaml'
SimpleCov.start

module Helpers
  extend self
  include Larrow

  def load_by_default
    args = read_content_as_hash
    [args[:qy_access_key_id],
     args[:qy_secret_access_key], 
     args[:zone_id]]
  end

  def read_content_as_hash
    file = "#{ENV['HOME']}/.larrow"
    fail "cannot find keyfile: #{file}" unless File.exist?(file)
    YAML.load(File.read file)['qingcloud']
  end
  
  def establish_connection
    access, secret, zone_id = load_by_default
    Qingcloud.establish_connection access, secret, zone_id
  end
end

Helpers.establish_connection

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
larrow-qingcloud-0.0.2 spec/spec_helper.rb