2
0
mirror of https://github.com/moebooru/moebooru synced 2025-08-31 14:05:14 +00:00

Preparation for rails 3

This commit is contained in:
Edho Arief
2012-05-08 04:30:49 +00:00
parent 369dcb7f2c
commit 1a25bcc3d1
4 changed files with 125 additions and 34 deletions

View File

@@ -1,6 +1,6 @@
source 'http://rubygems.org'
gem 'rails', '~> 2.3.0'
gem 'rails', '~> 3.0.0'
gem 'pg'
gem 'html5'
gem 'diff-lcs'

View File

@@ -1,50 +1,95 @@
GEM
remote: http://rubygems.org/
specs:
actionmailer (2.3.14)
actionpack (= 2.3.14)
actionpack (2.3.14)
activesupport (= 2.3.14)
rack (~> 1.1.0)
activerecord (2.3.14)
activesupport (= 2.3.14)
activeresource (2.3.14)
activesupport (= 2.3.14)
activesupport (2.3.14)
builder (3.0.0)
abstract (1.0.0)
actionmailer (3.0.12)
actionpack (= 3.0.12)
mail (~> 2.2.19)
actionpack (3.0.12)
activemodel (= 3.0.12)
activesupport (= 3.0.12)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.5.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)
daemons (1.1.8)
diff-lcs (1.1.3)
erubis (2.6.6)
abstract (>= 1.0.0)
exception_notification (2.3.3.0)
gchartrb (0.8)
geoip (1.1.2)
hoe (3.0.4)
hoe (3.0.5)
rake (~> 0.8)
hpricot (0.8.6)
html5 (0.10.0)
chardet (>= 0.9.0)
hoe (>= 1.2.0)
json (1.7.0)
i18n (0.5.0)
json (1.7.1)
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)
mime-types (1.18)
newrelic_rpm (3.3.4.1)
pg (0.13.2)
rack (1.1.3)
rails (2.3.14)
actionmailer (= 2.3.14)
actionpack (= 2.3.14)
activerecord (= 2.3.14)
activeresource (= 2.3.14)
activesupport (= 2.3.14)
rake (>= 0.8.3)
polyglot (0.3.3)
rack (1.2.5)
rack-mount (0.6.14)
rack (>= 1.0.0)
rack-test (0.5.7)
rack (>= 1.0)
rails (3.0.12)
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)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
redhillonrails_core (1.2.0)
activerecord (>= 2)
repeated_auto_complete (0.1.3)
sitemap_generator (3.1.1)
builder
thor (0.14.6)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.33)
unicorn (4.3.1)
kgio (~> 2.6)
rack
@@ -67,7 +112,7 @@ DEPENDENCIES
mime-types
newrelic_rpm
pg
rails (~> 2.3.0)
rails (~> 3.0.0)
redhillonrails_core
repeated_auto_complete
sitemap_generator

39
config/application.rb Normal file
View 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

View File

@@ -1,13 +1,20 @@
ActionController::Routing::Routes.draw do |map|
map.resources :advertisements, :member => { :redirect => :get }, :collection => { :update_multiple => :post }
map.root :controller => 'static', :action => 'index'
map.connect 'post/show/:id/:tag_title', :controller => 'post', :action => 'show', :requirements => {:id => /\d+/}
map.connect 'pool/zip/:id/:filename', :controller => 'pool', :action => 'zip', :requirements => {:id => /\d+/, :filename => /.*/}
map.connect ':controller/:action/:id.:format', :requirements => {:id => /[-\d]+/}
map.connect ':controller/:action/:id', :requirements => {:id => /[-\d]+/}
map.connect ':controller/:action.:format'
map.connect ':controller/:action'
Moebooru::Application.routes.draw do
resources :advertisements do
collection do
post :update_multiple
end
member do
get :redirect
end
end
map.connect 'histogram', :controller => 'post', :action => 'histogram'
map.connect 'download', :controller => 'post', :action => 'download'
match '/' => 'static#index'
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