Sha256: 1b72f847cb1ffca67842802b6d04e0867276017d79b5ec32598827a4c69247dd

Contents?: true

Size: 1.16 KB

Versions: 13

Compression:

Stored size: 1.16 KB

Contents

class TestCredentials

    @@aws_access_key_id = nil
    @@aws_secret_access_key = nil
    @@account_number = nil
    @@config = nil

    def self.config
        @@config
    end

    def self.aws_access_key_id
        @@aws_access_key_id
    end

    def self.aws_access_key_id=(newval)
        @@aws_access_key_id = newval
    end

    def self.account_number
        @@account_number
    end

    def self.account_number=(newval)
        @@account_number = newval
    end

    def self.aws_secret_access_key
        @@aws_secret_access_key
    end

    def self.aws_secret_access_key=(newval)
        @@aws_secret_access_key = newval
    end

    require 'yaml'

    def self.get_credentials
        #Dir.chdir do
        begin

            Dir.chdir(File.expand_path("~/.test_configs")) do
                credentials = YAML::load(File.open("aws.yml"))
                @@config = credentials
                self.aws_access_key_id = credentials["amazon"]["access_key"]
                self.aws_secret_access_key = credentials["amazon"]["secret_key"]
            end
        rescue Exception => e
            puts "#{e.message}"
            raise e
        end
        #end
    end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
aws-2.10.2 test/test_credentials.rb
aws-2.10.0 test/test_credentials.rb
aws-2.9.1 test/test_credentials.rb
aws-2.4.5 test/test_credentials.rb
aws-2.4.4 test/test_credentials.rb
aws-2.4.3 test/test_credentials.rb
aws-2.4.2 test/test_credentials.rb
aws-2.4.1 test/test_credentials.rb
aws-2.4.0 test/test_credentials.rb
aws-2.3.34 test/test_credentials.rb
aws-2.3.32 test/test_credentials.rb
aws-2.3.31 test/test_credentials.rb
aws-2.3.30 test/test_credentials.rb