rosa-build/config/initializers/load_config.rb

19 lines
786 B
Ruby
Raw Normal View History

2012-01-30 20:39:34 +00:00
# -*- encoding : utf-8 -*-
2011-03-10 21:48:15 +00:00
APP_CONFIG = YAML.load_file("#{Rails.root}/config/application.yml")[Rails.env]
require 'modules'
# Setup Smart HTTP GRack
require 'grack'
config = {:project_root => File.join(APP_CONFIG['root_path'], 'git_projects'), :git_path => 'git', :upload_pack => true, :receive_pack => true}
# Rosa::Application.config.middleware.insert_before 0, ::Grack::Handler, config
Rosa::Application.config.middleware.insert_after ::Rails::Rack::Logger, ::Grack::Handler, config
Rosa::Application.config.middleware.insert_before ::Grack::Handler, ::Grack::Auth
# Grit::Git.git_timeout = 60
Dir[Rails.root.join("lib/ext/**/*.rb")].each {|f| require f}
# add rpm spec as mime type for *.spec files
MIME::Types.add(MIME::Type.from_array(["text/x-rpm-spec", ['spec'], '8bit']))