Sha256: 0b77dd5628193f961ecf403877a2412ba284c8c6dc611958cfdee66fd95a4790

Contents?: true

Size: 629 Bytes

Versions: 5

Compression:

Stored size: 629 Bytes

Contents

require 'singleton'

module PhoneGap
  module Build
    class Credentials

      include Singleton

      attr_reader :username, :password, :token, :config
      attr_writer :token

      def set(credentials)
        @username = credentials[:username]
        @password = credentials[:password]
        @token = credentials[:token]
        self
      end

      def load
        config_file = File.expand_path('../../../../config/phonegap.yml', __FILE__)
        if File.exists? config_file
          @config = YAML::load_file(config_file)
          @token = @config['token']
        end
        self
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
phone_gap-build-0.6.1 lib/phone_gap/build/credentials.rb
phone_gap-build-0.6.0 lib/phone_gap/build/credentials.rb
phone_gap-build-0.5.1 lib/phone_gap/build/credentials.rb
phone_gap-build-0.5.0 lib/phone_gap/build/credentials.rb
phone_gap-build-0.4.0 lib/phone_gap/build/credentials.rb