Sha256: e3ab9aa8968371a8261e47ee2f56cd79e9ab157c5092f33a82355dc880a008ea

Contents?: true

Size: 814 Bytes

Versions: 1

Compression:

Stored size: 814 Bytes

Contents

# encoding: utf-8

module GithubCLI
  # The API class is the main entry point for creating GithubCLI APIs.
  class API

    ENDPOINT = ''

    @@api = nil

    class << self

      attr_reader :config

      def github_api
        @@api ||= begin
          @@api = configure_api
        end
      end

      def configure_api
        @@api = Github.new
        @@api.oauth_token = GithubCLI.config['oauth_token']
        @@api.basic_auth  = GithubCLI.config['basic_auth']
        @@api
      end

      def output(format=:table, &block)
        response =  block.call
        formatter = Formatter.new response, :format => format
        formatter.render_output
      end

    end

    class All
      def initialize(params)
        puts Github::Repos.new.all params
      end
    end

  end # API
end # GithubCLI

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
github_cli-0.4.2 lib/github_cli/api.rb