Sha256: 7dd086d8c1148b092c4653e6be9041c36db887c29e2672998396fb50bc8cbae1

Contents?: true

Size: 438 Bytes

Versions: 11

Compression:

Stored size: 438 Bytes

Contents

module Octokit
  class Client
    module Authentication
      def authentication
        if login && token
          {:login => "#{login}/token", :password => token}
        elsif login && password
          {:login => login, :password => password}
        else
          {}
        end
      end

      def authenticated?
        !authentication.empty?
      end

      def oauthed?
        !oauth_token.nil?
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
octokit-0.6.3 lib/octokit/client/authentication.rb
octokit-0.6.2 lib/octokit/client/authentication.rb
hybridgroup-octokit-0.6.3 lib/octokit/client/authentication.rb
hybridgroup-octokit-0.6.2 lib/octokit/client/authentication.rb
hybridgroup-octokit-0.6.1 lib/octokit/client/authentication.rb
xn-octokit-0.6.1 lib/octokit/client/authentication.rb
octokit-0.6.1 lib/octokit/client/authentication.rb
octokit-0.6.0 lib/octokit/client/authentication.rb
octokit-0.5.2 lib/octokit/client/authentication.rb
octokit-0.5.1 lib/octokit/client/authentication.rb
octokit-0.5.0 lib/octokit/client/authentication.rb