OSDN Git Service

t#29400
[pettanr/pettanr.git] / config / application.rb
index b4c8ec5..3e3c7cc 100644 (file)
@@ -7,6 +7,7 @@ require "action_mailer/railtie"
 require "active_resource/railtie"
 require "sprockets/railtie"
 # require "rails/test_unit/railtie"
+require 'digest/md5'
 
 if defined?(Bundler)
   # If you precompile assets before deploying to production, use this line
@@ -16,6 +17,7 @@ if defined?(Bundler)
 end
 
 module Pettanr
+  VERSION = '0.4'
   class Application < Rails::Application
     # Settings in config/environments/* take precedence over those specified here.
     # Application configuration should go into files in config/initializers
@@ -52,9 +54,31 @@ config.assets.initialize_on_precompile = false
     # Version of your assets, change this if you want to expire all your assets
     config.assets.version = '1.0'
     
-    config.autoload_paths += %W(#{config.root}/lib/validators)\r
+    config.autoload_paths += %W(#{config.root}/lib/validators)
+    
+    def self.licenses=(ary)
+      @@licenses = ary
+    end
+    
+    def self.licenses
+      @@licenses
+    end
+  
   end
 end
-class ActiveRecord::Forbidden < ActiveRecord::ActiveRecordError\r
+Pettanr::Application.licenses = YAML.load(open(Rails.root + 'config/license.yml').read)
+MagicNumber = YAML.load(open(Rails.root + 'config/magic_number.yml').read)
+y = YAML.load(open(Rails.root + 'config/picture_io.yml').read)
+require y[Rails.env]["adapter"]
+pio = PictureIO.const_get y[Rails.env]["io"]
+PictureIO.setup do |config|
+  config.original_picture_io = pio.new y[Rails.env]["original_picture"]
+  config.resource_picture_io = pio.new y[Rails.env]["resource_picture"]
+  config.picture_io = pio.new y[Rails.env]["picture"]
+  config.system_picture_io = pio.new y[Rails.env]["system_picture"]
 end
-\r
+module ActiveRecord
+  class Forbidden < ActiveRecordError
+  end
+end
+