Description:
updated to rails 2.3.4, removed bluecloth, use 'rdiscount'
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@414 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r194:150cfc9ed87b - - 2 files changed: 4 inserted, 4 deleted
@@ -37,74 +37,74 | |||||
|
37 | def run |
|
37 | def run |
|
38 | load_initializer |
|
38 | load_initializer |
|
39 | Rails::Initializer.run(:set_load_path) |
|
39 | Rails::Initializer.run(:set_load_path) |
|
40 | end |
|
40 | end |
|
41 | end |
|
41 | end |
|
42 |
|
42 | ||
|
43 | class VendorBoot < Boot |
|
43 | class VendorBoot < Boot |
|
44 | def load_initializer |
|
44 | def load_initializer |
|
45 | require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" |
|
45 | require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" |
|
46 | Rails::Initializer.run(:install_gem_spec_stubs) |
|
46 | Rails::Initializer.run(:install_gem_spec_stubs) |
|
47 | Rails::GemDependency.add_frozen_gem_path |
|
47 | Rails::GemDependency.add_frozen_gem_path |
|
48 | end |
|
48 | end |
|
49 | end |
|
49 | end |
|
50 |
|
50 | ||
|
51 | class GemBoot < Boot |
|
51 | class GemBoot < Boot |
|
52 | def load_initializer |
|
52 | def load_initializer |
|
53 | self.class.load_rubygems |
|
53 | self.class.load_rubygems |
|
54 | load_rails_gem |
|
54 | load_rails_gem |
|
55 | require 'initializer' |
|
55 | require 'initializer' |
|
56 | end |
|
56 | end |
|
57 |
|
57 | ||
|
58 | def load_rails_gem |
|
58 | def load_rails_gem |
|
59 | if version = self.class.gem_version |
|
59 | if version = self.class.gem_version |
|
60 | gem 'rails', version |
|
60 | gem 'rails', version |
|
61 | else |
|
61 | else |
|
62 | gem 'rails' |
|
62 | gem 'rails' |
|
63 | end |
|
63 | end |
|
64 | rescue Gem::LoadError => load_error |
|
64 | rescue Gem::LoadError => load_error |
|
65 | $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.) |
|
65 | $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.) |
|
66 | exit 1 |
|
66 | exit 1 |
|
67 | end |
|
67 | end |
|
68 |
|
68 | ||
|
69 | class << self |
|
69 | class << self |
|
70 | def rubygems_version |
|
70 | def rubygems_version |
|
71 | Gem::RubyGemsVersion rescue nil |
|
71 | Gem::RubyGemsVersion rescue nil |
|
72 | end |
|
72 | end |
|
73 |
|
73 | ||
|
74 | def gem_version |
|
74 | def gem_version |
|
75 | if defined? RAILS_GEM_VERSION |
|
75 | if defined? RAILS_GEM_VERSION |
|
76 | RAILS_GEM_VERSION |
|
76 | RAILS_GEM_VERSION |
|
77 | elsif ENV.include?('RAILS_GEM_VERSION') |
|
77 | elsif ENV.include?('RAILS_GEM_VERSION') |
|
78 | ENV['RAILS_GEM_VERSION'] |
|
78 | ENV['RAILS_GEM_VERSION'] |
|
79 | else |
|
79 | else |
|
80 | parse_gem_version(read_environment_rb) |
|
80 | parse_gem_version(read_environment_rb) |
|
81 | end |
|
81 | end |
|
82 | end |
|
82 | end |
|
83 |
|
83 | ||
|
84 | def load_rubygems |
|
84 | def load_rubygems |
|
|
85 | + min_version = '1.3.2' | ||
|
85 | require 'rubygems' |
|
86 | require 'rubygems' |
|
86 | - min_version = '1.3.1' |
|
||
|
87 | unless rubygems_version >= min_version |
|
87 | unless rubygems_version >= min_version |
|
88 | $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.) |
|
88 | $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.) |
|
89 | exit 1 |
|
89 | exit 1 |
|
90 | end |
|
90 | end |
|
91 |
|
91 | ||
|
92 | rescue LoadError |
|
92 | rescue LoadError |
|
93 | $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org) |
|
93 | $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org) |
|
94 | exit 1 |
|
94 | exit 1 |
|
95 | end |
|
95 | end |
|
96 |
|
96 | ||
|
97 | def parse_gem_version(text) |
|
97 | def parse_gem_version(text) |
|
98 | $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/ |
|
98 | $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/ |
|
99 | end |
|
99 | end |
|
100 |
|
100 | ||
|
101 | private |
|
101 | private |
|
102 | def read_environment_rb |
|
102 | def read_environment_rb |
|
103 | File.read("#{RAILS_ROOT}/config/environment.rb") |
|
103 | File.read("#{RAILS_ROOT}/config/environment.rb") |
|
104 | end |
|
104 | end |
|
105 | end |
|
105 | end |
|
106 | end |
|
106 | end |
|
107 | end |
|
107 | end |
|
108 |
|
108 | ||
|
109 | # All that for this: |
|
109 | # All that for this: |
|
110 | Rails.boot! |
|
110 | Rails.boot! |
@@ -1,93 +1,93 | |||||
|
1 | # Be sure to restart your web server when you modify this file. |
|
1 | # Be sure to restart your web server when you modify this file. |
|
2 |
|
2 | ||
|
3 | # Uncomment below to force Rails into production mode when |
|
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 |
|
4 | # you don't control web/app server and can't set it the proper way |
|
5 | # ENV['RAILS_ENV'] ||= 'production' |
|
5 | # ENV['RAILS_ENV'] ||= 'production' |
|
6 |
|
6 | ||
|
7 | # Specifies gem version of Rails to use when vendor/rails is not present |
|
7 | # Specifies gem version of Rails to use when vendor/rails is not present |
|
8 |
- RAILS_GEM_VERSION = '2.3. |
|
8 | + RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION |
|
9 |
|
9 | ||
|
10 | # Bootstrap the Rails environment, frameworks, and default configuration |
|
10 | # Bootstrap the Rails environment, frameworks, and default configuration |
|
11 | require File.join(File.dirname(__FILE__), 'boot') |
|
11 | require File.join(File.dirname(__FILE__), 'boot') |
|
12 |
|
12 | ||
|
13 | Rails::Initializer.run do |config| |
|
13 | Rails::Initializer.run do |config| |
|
14 | # Settings in config/environments/* take precedence over those specified here |
|
14 | # Settings in config/environments/* take precedence over those specified here |
|
15 |
|
15 | ||
|
16 | # Skip frameworks you're not going to use (only works if using vendor/rails) |
|
16 | # Skip frameworks you're not going to use (only works if using vendor/rails) |
|
17 | # config.frameworks -= [ :action_web_service, :action_mailer ] |
|
17 | # config.frameworks -= [ :action_web_service, :action_mailer ] |
|
18 |
|
18 | ||
|
19 | # Only load the plugins named here, by default all plugins in vendor/plugins are loaded |
|
19 | # Only load the plugins named here, by default all plugins in vendor/plugins are loaded |
|
20 | # config.plugins = %W( exception_notification ssl_requirement ) |
|
20 | # config.plugins = %W( exception_notification ssl_requirement ) |
|
21 |
|
21 | ||
|
22 | # Add additional load paths for your own custom dirs |
|
22 | # Add additional load paths for your own custom dirs |
|
23 | # config.load_paths += %W( #{RAILS_ROOT}/extras ) |
|
23 | # config.load_paths += %W( #{RAILS_ROOT}/extras ) |
|
24 |
|
24 | ||
|
25 | # Force all environments to use the same logger level |
|
25 | # Force all environments to use the same logger level |
|
26 | # (by default production uses :info, the others :debug) |
|
26 | # (by default production uses :info, the others :debug) |
|
27 | # config.log_level = :debug |
|
27 | # config.log_level = :debug |
|
28 |
|
28 | ||
|
29 | # Use the database for sessions instead of the file system |
|
29 | # Use the database for sessions instead of the file system |
|
30 | # (create the session table with 'rake db:sessions:create') |
|
30 | # (create the session table with 'rake db:sessions:create') |
|
31 | config.action_controller.session_store = :active_record_store |
|
31 | config.action_controller.session_store = :active_record_store |
|
32 |
|
32 | ||
|
33 | # Use SQL instead of Active Record's schema dumper when creating the test database. |
|
33 | # Use SQL instead of Active Record's schema dumper when creating the test database. |
|
34 | # This is necessary if your schema can't be completely dumped by the schema dumper, |
|
34 | # This is necessary if your schema can't be completely dumped by the schema dumper, |
|
35 | # like if you have constraints or database-specific column types |
|
35 | # like if you have constraints or database-specific column types |
|
36 | # config.active_record.schema_format = :sql |
|
36 | # config.active_record.schema_format = :sql |
|
37 |
|
37 | ||
|
38 | # Activate observers that should always be running |
|
38 | # Activate observers that should always be running |
|
39 | # config.active_record.observers = :cacher, :garbage_collector |
|
39 | # config.active_record.observers = :cacher, :garbage_collector |
|
40 |
|
40 | ||
|
41 | # Make Active Record use UTC-base instead of local time |
|
41 | # Make Active Record use UTC-base instead of local time |
|
42 | config.time_zone = 'UTC' |
|
42 | config.time_zone = 'UTC' |
|
43 |
|
43 | ||
|
44 | # Setting locales |
|
44 | # Setting locales |
|
45 |
- config.i18n.default_locale = ' |
|
45 | + config.i18n.default_locale = 'en' |
|
46 |
|
46 | ||
|
47 | # See Rails::Configuration for more options |
|
47 | # See Rails::Configuration for more options |
|
48 |
|
48 | ||
|
49 | # ------------- |
|
49 | # ------------- |
|
50 | # Required gems |
|
50 | # Required gems |
|
51 | # ------------- |
|
51 | # ------------- |
|
52 | config.gem "haml" |
|
52 | config.gem "haml" |
|
53 | config.gem "tmail" |
|
53 | config.gem "tmail" |
|
54 |
- config.gem " |
|
54 | + config.gem "rdiscount", :lib => "rdiscount" |
|
55 |
|
55 | ||
|
56 | # NOTES on rspec: if you wan to test with rspec, you have to install |
|
56 | # NOTES on rspec: if you wan to test with rspec, you have to install |
|
57 | # rspec yourself, just call: [sudo] gem install rspec-rails |
|
57 | # rspec yourself, just call: [sudo] gem install rspec-rails |
|
58 |
|
58 | ||
|
59 | end |
|
59 | end |
|
60 |
|
60 | ||
|
61 | # Add new inflection rules using the following format |
|
61 | # Add new inflection rules using the following format |
|
62 | # (all these examples are active by default): |
|
62 | # (all these examples are active by default): |
|
63 | # Inflector.inflections do |inflect| |
|
63 | # Inflector.inflections do |inflect| |
|
64 | # inflect.plural /^(ox)$/i, '\1en' |
|
64 | # inflect.plural /^(ox)$/i, '\1en' |
|
65 | # inflect.singular /^(ox)en/i, '\1' |
|
65 | # inflect.singular /^(ox)en/i, '\1' |
|
66 | # inflect.irregular 'person', 'people' |
|
66 | # inflect.irregular 'person', 'people' |
|
67 | # inflect.uncountable %w( fish sheep ) |
|
67 | # inflect.uncountable %w( fish sheep ) |
|
68 | # end |
|
68 | # end |
|
69 |
|
69 | ||
|
70 | # Add new mime types for use in respond_to blocks: |
|
70 | # Add new mime types for use in respond_to blocks: |
|
71 | # Mime::Type.register "text/richtext", :rtf |
|
71 | # Mime::Type.register "text/richtext", :rtf |
|
72 | # Mime::Type.register "application/x-mobile", :mobile |
|
72 | # Mime::Type.register "application/x-mobile", :mobile |
|
73 |
|
73 | ||
|
74 | # Include your application configuration below |
|
74 | # Include your application configuration below |
|
75 |
|
75 | ||
|
76 | # These are where inputs and outputs of test requests are stored |
|
76 | # These are where inputs and outputs of test requests are stored |
|
77 | TEST_REQUEST_INPUT_FILE_DIR = RAILS_ROOT + '/data/test_request/input' |
|
77 | TEST_REQUEST_INPUT_FILE_DIR = RAILS_ROOT + '/data/test_request/input' |
|
78 | TEST_REQUEST_OUTPUT_FILE_DIR = RAILS_ROOT + '/data/test_request/output' |
|
78 | TEST_REQUEST_OUTPUT_FILE_DIR = RAILS_ROOT + '/data/test_request/output' |
|
79 |
|
79 | ||
|
80 | # To use ANALYSIS MODE, provide the testcases/testruns breakdown, |
|
80 | # To use ANALYSIS MODE, provide the testcases/testruns breakdown, |
|
81 | # and the directory of the grading result (usually in judge's dir). |
|
81 | # and the directory of the grading result (usually in judge's dir). |
|
82 | TASK_GRADING_INFO_FILENAME = RAILS_ROOT + '/config/tasks.yml' |
|
82 | TASK_GRADING_INFO_FILENAME = RAILS_ROOT + '/config/tasks.yml' |
|
83 | GRADING_RESULT_DIR = '/home/thailandoi/ytopc/judge/result' |
|
83 | GRADING_RESULT_DIR = '/home/thailandoi/ytopc/judge/result' |
|
84 |
|
84 | ||
|
85 | # Uncomment so that configuration is read only once when the server is loaded |
|
85 | # Uncomment so that configuration is read only once when the server is loaded |
|
86 | # Configuration.enable_caching |
|
86 | # Configuration.enable_caching |
|
87 |
|
87 | ||
|
88 | # Uncomment so that the system validates user e-mails |
|
88 | # Uncomment so that the system validates user e-mails |
|
89 | # VALIDATE_USER_EMAILS = true |
|
89 | # VALIDATE_USER_EMAILS = true |
|
90 |
|
90 | ||
|
91 | # Uncomment so that Apache X-Sendfile is used when delivering files |
|
91 | # Uncomment so that Apache X-Sendfile is used when delivering files |
|
92 | # (e.g., in /tasks/view). |
|
92 | # (e.g., in /tasks/view). |
|
93 | # USE_APACHE_XSENDFILE = true |
|
93 | # USE_APACHE_XSENDFILE = true |
You need to be logged in to leave comments.
Login now