Sha256: fbfbed71066425609aa8a2ac067bfd9d11977a209e144bdf72f6b81ab1e3eb5e

Contents?: true

Size: 1.39 KB

Versions: 29

Compression:

Stored size: 1.39 KB

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2015 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::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

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
gooddata-edge-0.6.27.edge spec/helpers/connection_helper.rb
gooddata-0.6.49 spec/helpers/connection_helper.rb
gooddata-0.6.48 spec/helpers/connection_helper.rb
gooddata-0.6.47 spec/helpers/connection_helper.rb
gooddata-0.6.46 spec/helpers/connection_helper.rb
gooddata-0.6.45 spec/helpers/connection_helper.rb
gooddata-0.6.44 spec/helpers/connection_helper.rb
gooddata-0.6.43 spec/helpers/connection_helper.rb
gooddata-0.6.42 spec/helpers/connection_helper.rb
gooddata-0.6.41 spec/helpers/connection_helper.rb
gooddata-0.6.40 spec/helpers/connection_helper.rb
gooddata-0.6.39 spec/helpers/connection_helper.rb
gooddata-0.6.38 spec/helpers/connection_helper.rb
gooddata-0.6.37 spec/helpers/connection_helper.rb
gooddata-0.6.36 spec/helpers/connection_helper.rb
gooddata-0.6.35 spec/helpers/connection_helper.rb
gooddata-0.6.34 spec/helpers/connection_helper.rb
gooddata-0.6.33 spec/helpers/connection_helper.rb
gooddata-0.6.32 spec/helpers/connection_helper.rb
gooddata-0.6.31 spec/helpers/connection_helper.rb