enable 11.4, redirect developer version to wiki
[opensuse:software-o-o.git] / config / environment.rb
1 # Be sure to restart your web server when you modify this file.
2
3 # Uncomment below to force Rails into production mode when 
4 # you don't control web/app server and can't set it the proper way
5 # ENV['RAILS_ENV'] ||= 'production'
6
7 # Specifies gem version of Rails to use when vendor/rails is not present
8 RAILS_GEM_VERSION = '>=2.3.5' unless defined? RAILS_GEM_VERSION
9
10 # Bootstrap the Rails environment, frameworks, and default configuration
11 require File.join(File.dirname(__FILE__), 'boot')
12
13 require "#{RAILS_ROOT}/lib/common/libxmlactivexml"
14 require 'custom_logger'
15
16 Rails::Initializer.run do |config|
17   # Settings in config/environments/* take precedence over those specified here
18   
19   # Skip frameworks you're not going to use (only works if using vendor/rails)
20   # config.frameworks -= [ :action_web_service, :action_mailer ]
21
22   # Only load the plugins named here, by default all plugins in vendor/plugins are loaded
23   # config.plugins = %W( exception_notification ssl_requirement )
24
25   # Add additional load paths for your own custom dirs
26   # config.load_paths += %W( #{RAILS_ROOT}/extras )
27
28   # Force all environments to use the same logger level 
29   # (by default production uses :info, the others :debug)
30   config.log_level = :debug
31
32   # Use SQL instead of Active Record's schema dumper when creating the test database.
33   # This is necessary if your schema can't be completely dumped by the schema dumper, 
34   # like if you have constraints or database-specific column types
35   # config.active_record.schema_format = :sql
36
37   # Activate observers that should always be running
38   # config.active_record.observers = :cacher, :garbage_collector
39
40   # Make Active Record use UTC-base instead of local time
41   # config.active_record.default_timezone = :utc
42   
43   # See Rails::Configuration for more options
44
45   config.gem 'libxml-ruby'
46   config.gem 'gettext_rails'
47   config.gem 'daemons'
48   config.gem 'delayed_job'
49
50   config.logger = NiceLogger.new(config.log_path)
51
52   config.cache_store = :compressed_mem_cache_store, 'localhost:11211', {:namespace => 'software'}
53
54 end
55
56 # Include your application configuration below
57
58 # remove static cache files
59 %w{developer 111 112}.each { |release|
60    FileUtils.rm_rf "#{RAILS_ROOT}/public/" + release
61 }
62
63 ActiveXML::Base.config do |conf|
64   conf.setup_transport do |map|
65     map.default_server :rest, API_HOST
66     map.connect :project, 'rest:///source/:name/_meta',
67       :all => 'rest:///source/'
68     map.connect :package, 'rest:///source/:project/:name/_meta',
69       :all => 'rest:///source/:project/'
70     map.connect :pattern, 'rest:///source/:project/_pattern/:name',
71       :all => 'rest:///source/:project/_pattern'
72     map.connect :published,'rest:///published/:project/:repository/:arch/:name?:view'
73     map.connect :seeker, 'rest:///search?match=:match',
74       :project => 'rest:///search/project/id?match=:match',
75       :package => 'rest:///search/package/id?match=:match',
76       :pattern => 'rest:///search/published/pattern/id?match=:match',
77       :binary => 'rest:///search/published/binary/id?match=:match'
78   end
79   conf.transport_for(:project).set_additional_header("X-Username", ICHAIN_USER)
80 end
81
82 LANGUAGES = %w{en}
83 Dir.glob("#{RAILS_ROOT}/locale/*/LC_MESSAGES/software.mo").each { |file|
84    lang = file.gsub(/^.*locale\/([^\/]*)\/.*$/, '\\1')
85    lang = lang.gsub(/_/,'-')
86    LANGUAGES << lang
87 }