Sha256: 412b574dc90885896b1bbe6f7f0acae3ace0b2987c72d62cd2b10a1c06532cbe

Contents?: true

Size: 1.42 KB

Versions: 2

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.3.0".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

2 entries across 2 versions & 2 rubygems

Version Path
opsb-octopussy-0.3.0 lib/octopussy.rb
octopussy-0.3.0 lib/octopussy.rb