diff options
author | Christian Johansen <christian@gitorious.org> | 2011-05-27 12:56:54 (GMT) |
---|---|---|
committer | Christian Johansen <christian@gitorious.org> | 2011-05-27 12:56:54 (GMT) |
commit | edf6fe21bf5eca24e95bfa5061af9c17f8d6e1d7 (patch) | |
tree | 08e33589c38a7923f50171a00ef46f332a4a29d7 /data | |
parent | d119275fdfd292a86c2dd7e3a4fa9574f7c9c40a (diff) |
Properly set up load path and configure the messaging module in the post receive hook
Diffstat (limited to 'data')
-rw-r--r-- | data/hooks/messaging.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/data/hooks/messaging.rb b/data/hooks/messaging.rb index f2a59d1..3ed7900 100644 --- a/data/hooks/messaging.rb +++ b/data/hooks/messaging.rb @@ -17,17 +17,20 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. #++ +print "=> Syncing Gitorious... " +RAILS_ENV = ENV['RAILS_ENV'] || "production" +RAILS_ROOT = File.join(File.dirname(__FILE__), "..", "..") + +$: << File.join(RAILS_ROOT, "lib") require 'rubygems' require 'yaml' require 'gitorious/messaging' -print "=> Syncing Gitorious... " -RAILS_ENV = ENV['RAILS_ENV'] || "production" - if !defined?(GitoriousConfig) - conf = YAML::load_file(File.join(File.dirname(__FILE__), "..", "..", "config", "gitorious.yml")) - GitoriousConfig = conf[RAILS_ENV] - Gitorious::Messaging.configure(config) + conf = YAML::load_file(File.join(RAILS_ROOT, "config", "gitorious.yml")) + GitoriousConfig = conf[RAILS_ENV] + Gitorious::Messaging.load_adapter(GitoriousConfig["messaging_adapter"]) + Gitorious::Messaging.configure_publisher(GitoriousConfig["messaging_adapter"]) end class Publisher |