mirror of
https://github.com/moebooru/moebooru
synced 2025-09-04 16:05:11 +00:00
Preparation for rails 3
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -1,6 +1,6 @@
|
|||||||
source 'http://rubygems.org'
|
source 'http://rubygems.org'
|
||||||
|
|
||||||
gem 'rails', '~> 2.3.0'
|
gem 'rails', '~> 3.0.0'
|
||||||
gem 'pg'
|
gem 'pg'
|
||||||
gem 'html5'
|
gem 'html5'
|
||||||
gem 'diff-lcs'
|
gem 'diff-lcs'
|
||||||
|
89
Gemfile.lock
89
Gemfile.lock
@@ -1,50 +1,95 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: http://rubygems.org/
|
remote: http://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (2.3.14)
|
abstract (1.0.0)
|
||||||
actionpack (= 2.3.14)
|
actionmailer (3.0.12)
|
||||||
actionpack (2.3.14)
|
actionpack (= 3.0.12)
|
||||||
activesupport (= 2.3.14)
|
mail (~> 2.2.19)
|
||||||
rack (~> 1.1.0)
|
actionpack (3.0.12)
|
||||||
activerecord (2.3.14)
|
activemodel (= 3.0.12)
|
||||||
activesupport (= 2.3.14)
|
activesupport (= 3.0.12)
|
||||||
activeresource (2.3.14)
|
builder (~> 2.1.2)
|
||||||
activesupport (= 2.3.14)
|
erubis (~> 2.6.6)
|
||||||
activesupport (2.3.14)
|
i18n (~> 0.5.0)
|
||||||
builder (3.0.0)
|
rack (~> 1.2.5)
|
||||||
|
rack-mount (~> 0.6.14)
|
||||||
|
rack-test (~> 0.5.7)
|
||||||
|
tzinfo (~> 0.3.23)
|
||||||
|
activemodel (3.0.12)
|
||||||
|
activesupport (= 3.0.12)
|
||||||
|
builder (~> 2.1.2)
|
||||||
|
i18n (~> 0.5.0)
|
||||||
|
activerecord (3.0.12)
|
||||||
|
activemodel (= 3.0.12)
|
||||||
|
activesupport (= 3.0.12)
|
||||||
|
arel (~> 2.0.10)
|
||||||
|
tzinfo (~> 0.3.23)
|
||||||
|
activeresource (3.0.12)
|
||||||
|
activemodel (= 3.0.12)
|
||||||
|
activesupport (= 3.0.12)
|
||||||
|
activesupport (3.0.12)
|
||||||
|
arel (2.0.10)
|
||||||
|
builder (2.1.2)
|
||||||
chardet (0.9.0)
|
chardet (0.9.0)
|
||||||
daemons (1.1.8)
|
daemons (1.1.8)
|
||||||
diff-lcs (1.1.3)
|
diff-lcs (1.1.3)
|
||||||
|
erubis (2.6.6)
|
||||||
|
abstract (>= 1.0.0)
|
||||||
exception_notification (2.3.3.0)
|
exception_notification (2.3.3.0)
|
||||||
gchartrb (0.8)
|
gchartrb (0.8)
|
||||||
geoip (1.1.2)
|
geoip (1.1.2)
|
||||||
hoe (3.0.4)
|
hoe (3.0.5)
|
||||||
rake (~> 0.8)
|
rake (~> 0.8)
|
||||||
hpricot (0.8.6)
|
hpricot (0.8.6)
|
||||||
html5 (0.10.0)
|
html5 (0.10.0)
|
||||||
chardet (>= 0.9.0)
|
chardet (>= 0.9.0)
|
||||||
hoe (>= 1.2.0)
|
hoe (>= 1.2.0)
|
||||||
json (1.7.0)
|
i18n (0.5.0)
|
||||||
|
json (1.7.1)
|
||||||
kgio (2.7.4)
|
kgio (2.7.4)
|
||||||
|
mail (2.2.19)
|
||||||
|
activesupport (>= 2.3.6)
|
||||||
|
i18n (>= 0.4.0)
|
||||||
|
mime-types (~> 1.16)
|
||||||
|
treetop (~> 1.4.8)
|
||||||
memcache-client (1.8.5)
|
memcache-client (1.8.5)
|
||||||
mime-types (1.18)
|
mime-types (1.18)
|
||||||
newrelic_rpm (3.3.4.1)
|
newrelic_rpm (3.3.4.1)
|
||||||
pg (0.13.2)
|
pg (0.13.2)
|
||||||
rack (1.1.3)
|
polyglot (0.3.3)
|
||||||
rails (2.3.14)
|
rack (1.2.5)
|
||||||
actionmailer (= 2.3.14)
|
rack-mount (0.6.14)
|
||||||
actionpack (= 2.3.14)
|
rack (>= 1.0.0)
|
||||||
activerecord (= 2.3.14)
|
rack-test (0.5.7)
|
||||||
activeresource (= 2.3.14)
|
rack (>= 1.0)
|
||||||
activesupport (= 2.3.14)
|
rails (3.0.12)
|
||||||
rake (>= 0.8.3)
|
actionmailer (= 3.0.12)
|
||||||
|
actionpack (= 3.0.12)
|
||||||
|
activerecord (= 3.0.12)
|
||||||
|
activeresource (= 3.0.12)
|
||||||
|
activesupport (= 3.0.12)
|
||||||
|
bundler (~> 1.0)
|
||||||
|
railties (= 3.0.12)
|
||||||
|
railties (3.0.12)
|
||||||
|
actionpack (= 3.0.12)
|
||||||
|
activesupport (= 3.0.12)
|
||||||
|
rake (>= 0.8.7)
|
||||||
|
rdoc (~> 3.4)
|
||||||
|
thor (~> 0.14.4)
|
||||||
raindrops (0.8.0)
|
raindrops (0.8.0)
|
||||||
rake (0.9.2.2)
|
rake (0.9.2.2)
|
||||||
|
rdoc (3.12)
|
||||||
|
json (~> 1.4)
|
||||||
redhillonrails_core (1.2.0)
|
redhillonrails_core (1.2.0)
|
||||||
activerecord (>= 2)
|
activerecord (>= 2)
|
||||||
repeated_auto_complete (0.1.3)
|
repeated_auto_complete (0.1.3)
|
||||||
sitemap_generator (3.1.1)
|
sitemap_generator (3.1.1)
|
||||||
builder
|
builder
|
||||||
|
thor (0.14.6)
|
||||||
|
treetop (1.4.10)
|
||||||
|
polyglot
|
||||||
|
polyglot (>= 0.3.1)
|
||||||
|
tzinfo (0.3.33)
|
||||||
unicorn (4.3.1)
|
unicorn (4.3.1)
|
||||||
kgio (~> 2.6)
|
kgio (~> 2.6)
|
||||||
rack
|
rack
|
||||||
@@ -67,7 +112,7 @@ DEPENDENCIES
|
|||||||
mime-types
|
mime-types
|
||||||
newrelic_rpm
|
newrelic_rpm
|
||||||
pg
|
pg
|
||||||
rails (~> 2.3.0)
|
rails (~> 3.0.0)
|
||||||
redhillonrails_core
|
redhillonrails_core
|
||||||
repeated_auto_complete
|
repeated_auto_complete
|
||||||
sitemap_generator
|
sitemap_generator
|
||||||
|
39
config/application.rb
Normal file
39
config/application.rb
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# Put this in config/application.rb
|
||||||
|
require File.expand_path('../boot', __FILE__)
|
||||||
|
|
||||||
|
require 'rails/all'
|
||||||
|
|
||||||
|
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
||||||
|
|
||||||
|
module Moebooru
|
||||||
|
class Application < Rails::Application
|
||||||
|
config.autoload_paths += [config.root.join('lib')]
|
||||||
|
config.encoding = 'utf-8'
|
||||||
|
# Skip frameworks you're not going to use
|
||||||
|
config.frameworks -= [:action_web_service]
|
||||||
|
|
||||||
|
# Add additional load paths for your own custom dirs
|
||||||
|
config.autoload_paths += ["#{Rails.root}/app/models/post", "#{Rails.root}/app/models/post/image_store"]
|
||||||
|
|
||||||
|
# Force all environments to use the same logger level
|
||||||
|
# (by default production uses :info, the others :debug
|
||||||
|
#config.log_level = :info
|
||||||
|
|
||||||
|
# Enable page/fragment caching by setting a file-based store
|
||||||
|
# (remember to create the caching directory and make it readable to the application)
|
||||||
|
# config.action_controller.fragment_cache_store = :file_store, "#{Rails.root}/cache"
|
||||||
|
|
||||||
|
# Activate observers that should always be running
|
||||||
|
# config.active_record.observers = :cacher, :garbage_collector
|
||||||
|
|
||||||
|
# Make Active Record use UTC-base instead of local time
|
||||||
|
# config.active_record.default_timezone = :utc
|
||||||
|
|
||||||
|
# Use Active Record's schema dumper instead of SQL when creating the test database
|
||||||
|
# (enables use of different database adapters for development and test environments)
|
||||||
|
config.active_record.schema_format = :sql
|
||||||
|
|
||||||
|
#testing new relic
|
||||||
|
# config.gem "newrelic_rpm"
|
||||||
|
end
|
||||||
|
end
|
@@ -1,13 +1,20 @@
|
|||||||
ActionController::Routing::Routes.draw do |map|
|
Moebooru::Application.routes.draw do
|
||||||
map.resources :advertisements, :member => { :redirect => :get }, :collection => { :update_multiple => :post }
|
resources :advertisements do
|
||||||
map.root :controller => 'static', :action => 'index'
|
collection do
|
||||||
map.connect 'post/show/:id/:tag_title', :controller => 'post', :action => 'show', :requirements => {:id => /\d+/}
|
post :update_multiple
|
||||||
map.connect 'pool/zip/:id/:filename', :controller => 'pool', :action => 'zip', :requirements => {:id => /\d+/, :filename => /.*/}
|
end
|
||||||
map.connect ':controller/:action/:id.:format', :requirements => {:id => /[-\d]+/}
|
member do
|
||||||
map.connect ':controller/:action/:id', :requirements => {:id => /[-\d]+/}
|
get :redirect
|
||||||
map.connect ':controller/:action.:format'
|
end
|
||||||
map.connect ':controller/:action'
|
|
||||||
|
end
|
||||||
|
|
||||||
map.connect 'histogram', :controller => 'post', :action => 'histogram'
|
match '/' => 'static#index'
|
||||||
map.connect 'download', :controller => 'post', :action => 'download'
|
match 'post/show/:id/:tag_title' => 'post#show', :constraints => { :id => /\d+/ }
|
||||||
|
match 'pool/zip/:id/:filename' => 'pool#zip', :constraints => { :id => /\d+/, :filename => /.*/ }
|
||||||
|
match '/:controller(/:action(/:id))'
|
||||||
|
match ':controller/:action.:format' => '#index'
|
||||||
|
match ':controller/:action' => '#index'
|
||||||
|
match 'histogram' => 'post#histogram'
|
||||||
|
match 'download' => 'post#download'
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user