Sha256: c39bc50c5c2f42e1a31f9ebc003005f8c7d2d532d4ab74d55d4709589ce6a6fa

Contents?: true

Size: 1.45 KB

Versions: 13

Compression:

Stored size: 1.45 KB

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

require 'gooddata/connection'

require_relative '../environment/environment'

GoodData::Environment.load

module GoodData
  module Helpers
    module ConnectionHelper
      include GoodData::Environment::ConnectionHelper

      class << self
        # Creates connection using default credentials or supplied one
        #
        # @param [String] username Optional username
        # @param [String] password Optional password
        def create_default_connection(username = GoodData::Environment::ConnectionHelper::DEFAULT_USERNAME, password = GoodData::Environment::ConnectionHelper::DEFAULT_PASSWORD)
          GoodData.connect(username, password, :server => GoodData::Environment::ConnectionHelper::DEFAULT_SERVER, :verify_ssl => OpenSSL::SSL::VERIFY_NONE)
        end

        def 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 create_private_connection
          username = ENV['GD_GEM_USER'] || DEFAULT_USERNAME
          password = ENV['GD_GEM_PASSWORD'] || DEFAULT_PASSWORD

          GoodData.connect(username, password)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gooddata-1.1.0-java spec/helpers/connection_helper.rb
gooddata-1.1.0 spec/helpers/connection_helper.rb
gooddata-1.0.2-java spec/helpers/connection_helper.rb
gooddata-1.0.2 spec/helpers/connection_helper.rb
gooddata-1.0.1 spec/helpers/connection_helper.rb
gooddata-1.0.1-java spec/helpers/connection_helper.rb
gooddata-1.0.0-java spec/helpers/connection_helper.rb
gooddata-1.0.0 spec/helpers/connection_helper.rb
gooddata-0.6.54 spec/helpers/connection_helper.rb
gooddata-0.6.53 spec/helpers/connection_helper.rb
gooddata-0.6.52 spec/helpers/connection_helper.rb
gooddata-0.6.51 spec/helpers/connection_helper.rb
gooddata-0.6.50 spec/helpers/connection_helper.rb