Sha256: e461bb1dc2a060375eba966d96463a93f8226d80c777f24826070a62c4dec2cb

Contents?: true

Size: 1.42 KB

Versions: 1

Compression:

Stored size: 1.42 KB

Contents

require 'forwardable'

require 'httparty'
require 'hashie'
Hash.send :include, Hashie::HashExtensions

libdir = File.dirname(__FILE__)
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)

require 'octopussy/repo'
require 'octopussy/event'
require 'octopussy/client'

module Octopussy
  extend SingleForwardable
  
  VERSION = "0.2.4".freeze

  class OctopussyError < StandardError
    attr_reader :data

    def initialize(data)
      @data = data
      super
    end
  end

  class ClientError < StandardError; end
  class ServerError < OctopussyError; end
  class General     < OctopussyError; end

  class RateLimitExceeded < ClientError; end
  class Unauthorized      < ClientError; end
  class NotFound          < ClientError; end

  class Unavailable   < StandardError; end
  class InformOctopussy < StandardError; end

  def self.client; Client.new end

  # Users
  def_delegators :client, :search_users, :user, :followers, :following, :follows?, :watched

  # Issues
  def_delegators :client, :search_issues, :issues, :issue

  # Repos
  def_delegators :client, :branches, :collaborators, :contributors, :languages, :list_repos,
                 :network, :repo, :search_repos, :tags

  # Network Meta
  def_delegators :client, :network_meta, :network_data

  # Trees
  def_delegators :client, :tree, :blob, :raw
  
  # Commits
  def_delegators :client, :list_commits, :commit
  
  # Timeline
  def_delegators :client, :public_timeline
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
octopussy-0.2.4 lib/octopussy.rb