Load all of the extensions.
# File lib/hglib/extension.rb, line 17
def self::load_all
# :TODO: Allow gem extensions?
extdir = Pathname( __FILE__ ).dirname + 'extension'
Pathname.glob( extdir + '*.rb' ).each do |extpath|
self.log.debug "Loading extensions from %s" % [ extpath ]
require( extpath )
end
end
Define one or more commands that should be attached to the Hglib
module.
# File lib/hglib/extension.rb, line 39
def global_commands( &block )
raise LocalJumpError, "no block given" unless block
mod = Module.new
mod.class_eval( &block )
Hglib.extend( mod )
end
Define one or more commands that should be attached to Repo
objects.
# File lib/hglib/extension.rb, line 28
def repo_commands( &block )
raise LocalJumpError, "no block given" unless block
mod = Module.new
mod.class_eval( &block )
Hglib::Repo.include( mod )
end