Sha256: b18cc3f72a682a506bf15ce6ce59401b68bf9536d5408afce8f97051be9ec957

Contents?: true

Size: 739 Bytes

Versions: 1

Compression:

Stored size: 739 Bytes

Contents

#
# This code handles the creation of the github client with or without an auth token
#
# This class smells of :reek:UtilityFunction
class GithubListerCore
    class << self
        #
        # Everything from here is private
        #

        private

        #
        # Initialise the client and set auto_paginate to true
        #
        def init_client(options = {})
            validate_options(options)

            token = get_option(options, :token)
            client = if token
                         Octokit::Client.new(:access_token => token)
                     else
                         Octokit::Client.new
                     end
            client.auto_paginate = true
            client
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
github-lister-core-0.1.8 lib/github-lister-core/client.rb