From f983fe1e2296b0bb08510914a3cebb7cae036f59 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Tue, 28 Jun 2011 17:04:28 -0700 Subject: [PATCH] added a mechanism to load user-local command extensions --- lib/github.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/github.rb b/lib/github.rb index 92718f6f..199597f2 100644 --- a/lib/github.rb +++ b/lib/github.rb @@ -67,6 +67,10 @@ def activate(args) Dir[BasePath + '/commands/*.rb'].each do |command| load command end + # load user local extensions + Dir[ENV['HOME']+ '/.github-gem/commands/*.rb'].each do |command| + load command + end invoke(args.shift, *args) end @@ -146,7 +150,7 @@ def debug? end def load(file) - file[0] =~ /^\// ? path = file : path = BasePath + "/commands/#{File.basename(file)}" + file =~ /^\// ? path = file : path = BasePath + "/commands/#{File.basename(file)}" data = File.read(path) GitHub.module_eval data, path end