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]
|
2011-11-15 21:58:27 +00:00
|
|
|
|
2011-11-24 21:46:19 +00:00
|
|
|
require 'modules'
|
|
|
|
|
2011-11-15 21:58:27 +00:00
|
|
|
# Setup Smart HTTP GRack
|
|
|
|
require 'grack'
|
2011-11-22 18:14:27 +00:00
|
|
|
config = {:project_root => File.join(APP_CONFIG['root_path'], 'git_projects'), :git_path => 'git', :upload_pack => true, :receive_pack => true}
|
2011-11-22 13:01:33 +00:00
|
|
|
# Rosa::Application.config.middleware.insert_before 0, ::Grack::Handler, config
|
|
|
|
Rosa::Application.config.middleware.insert_after ::Rails::Rack::Logger, ::Grack::Handler, config
|
2011-11-15 21:58:27 +00:00
|
|
|
Rosa::Application.config.middleware.insert_before ::Grack::Handler, ::Grack::Auth
|
2011-11-17 21:57:30 +00:00
|
|
|
|
2012-03-21 19:55:14 +00:00
|
|
|
Grit::Git.git_timeout = 60
|
|
|
|
# Grit.debug = true
|
|
|
|
GAP_REPO_PATH = '/tmp/gap_repo.git'
|
|
|
|
unless File.directory? GAP_REPO_PATH
|
|
|
|
Grit::Repo.init_bare(GAP_REPO_PATH)
|
|
|
|
# FileUtils.chmod "a-w", GAP_REPO_PATH
|
|
|
|
end
|
2011-12-03 00:52:19 +00:00
|
|
|
|
|
|
|
Dir[Rails.root.join("lib/ext/**/*.rb")].each {|f| require f}
|
2012-03-07 01:20:35 +00:00
|
|
|
|
|
|
|
# add rpm spec as mime type for *.spec files
|
2012-03-07 13:36:39 +00:00
|
|
|
types = [
|
|
|
|
["text/x-python", ['py'], '8bit'],
|
|
|
|
["text/x-rpm-spec", ['spec'], '8bit'],
|
|
|
|
["text/x-csrc", ['h', 'c'], '8bit'],
|
|
|
|
["text/x-c++src", ['cpp'], '8bit']
|
|
|
|
]
|
|
|
|
types.each do |type|
|
|
|
|
MIME::Types.add MIME::Type.from_array(type)
|
|
|
|
end
|
2012-03-13 15:05:33 +00:00
|
|
|
|
|
|
|
# load datatables plugin
|
|
|
|
require Rails.root.join("lib/rails_datatables")
|