Sha256: 317b097e6e1e986996ae0715805e9a2022cf3ffc5e28c3ddcd376a8fad8bc52a

Contents?: true

Size: 593 Bytes

Versions: 2

Compression:

Stored size: 593 Bytes

Contents

require 'netrc'

module Nuvado
  module Backend
    class TokenStore
      def self.read_token
        if OS.unix?
          user, token = Netrc.read[API_END_POINT]
          token
        else
          raise SystemExitException.new("Sorry, your platform is not supported")
        end
      end

      def self.write_token(user, pass)
        if OS.unix?
          dotnetrc = Netrc.read
          dotnetrc[API_END_POINT] = user, pass
          dotnetrc.save
        else
          raise SystemExitException.new("Sorry, your platform is not supported")
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nuvado-1.0.0.rc2 lib/nuvado/backend/token_store.rb
nuvado-1.0.0.rc1 lib/nuvado/backend/token_store.rb