Sha256: 9c2eb2668f9e3f6cd944e9cac30f6d6fb73bea9598e148da789b3e2b9692dc84

Contents?: true

Size: 1 KB

Versions: 11

Compression:

Stored size: 1 KB

Contents

require 'gooddata/connection'

module ConnectionHelper
  GD_PROJECT_TOKEN = ENV["GD_PROJECT_TOKEN"]

  DEFAULT_USERNAME = "svarovsky+gem_tester@gooddata.com"
  DEFAULT_PASSWORD = "jindrisska"
  DEFAULT_DOMAIN = 'gooddata-tomas-svarovsky'
  DEFAULT_USER_URL = '/gdc/account/profile/3cea1102d5584813506352a2a2a00d95'

  # Creates connection using default credentials or supplied one
  #
  # @param [String] username Optional username
  # @param [String] password Optional password
  def self.create_default_connection(username = DEFAULT_USERNAME, password = DEFAULT_PASSWORD)
    GoodData::connect(username, password)
  end

  def self.disconnect
    conn = GoodData.connection.connection
    GoodData.disconnect
    puts conn.stats_table
  end

  # Creates connection using environment varibles GD_GEM_USER and GD_GEM_PASSWORD
  def self.create_private_connection
    username = ENV['GD_GEM_USER'] || DEFAULT_USERNAME
    password = ENV['GD_GEM_PASSWORD'] || DEFAULT_PASSWORD

    GoodData::connect(username, password)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
gooddata-0.6.18 spec/helpers/connection_helper.rb
gooddata-0.6.17 spec/helpers/connection_helper.rb
gooddata-0.6.16 spec/helpers/connection_helper.rb
gooddata-0.6.15 spec/helpers/connection_helper.rb
gooddata-0.6.14 spec/helpers/connection_helper.rb
gooddata-0.6.13 spec/helpers/connection_helper.rb
gooddata-0.6.12 spec/helpers/connection_helper.rb
gooddata-0.6.11 spec/helpers/connection_helper.rb
gooddata-0.6.10 spec/helpers/connection_helper.rb
gooddata-0.6.9 spec/helpers/connection_helper.rb
gooddata-0.6.8 spec/helpers/connection_helper.rb