Module: GitHub

Defined in:
lib/git_hub.rb,
lib/git_hub/api.rb,
lib/git_hub/base.rb,
lib/git_hub/repo.rb,
lib/git_hub/user.rb,
lib/git_hub/commit.rb

Defined Under Namespace

Classes: Api, Base, Commit, Repo, User

Constant Summary collapse

LIBPATH =

:stopdoc:

::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
PATH =
::File.dirname(LIBPATH) + ::File::SEPARATOR
API =
Api.instance

Class Method Summary collapse

Class Method Details

.libpath(*args) ⇒ Object

Returns the library path for the module. If any arguments are given, they will be joined to the end of the libray path using File.join.



13
14
15
# File 'lib/git_hub.rb', line 13

def self.libpath( *args )
  args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
end

.path(*args) ⇒ Object

Returns the path for the module. If any arguments are given, they will be joined to the end of the path using File.join.



21
22
23
# File 'lib/git_hub.rb', line 21

def self.path( *args )
  args.empty? ? PATH : ::File.join(PATH, args.flatten)
end

.require_all_libs_relative_to(fname) ⇒ Object

Utility method used to require all files ending in .rb that lie in the directory below this file that has the same name as the filename passed in. Optionally, a specific directory name can be passed in such that the filename does not have to be equivalent to the directory.



30
31
32
33
# File 'lib/git_hub.rb', line 30

def self.require_all_libs_relative_to( fname )
  ruby_files = ::File.expand_path(::File.join(::File.dirname(fname), '**', '*.rb'))
  Dir.glob(ruby_files).sort.each {|rb| require rb}
end