X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=config%2Fapplication.rb;h=b82accdaad739e28df3fce763a1e22737dff0de3;hp=3e62c6137cfb0b2dcecedbfb3e7e646a834cf654;hb=HEAD;hpb=51cd7e7b2880be5f284350669cd7d0f0bb97d757 diff --git a/config/application.rb b/config/application.rb index 3e62c613..b82accda 100644 --- a/config/application.rb +++ b/config/application.rb @@ -4,11 +4,10 @@ require File.expand_path('../boot', __FILE__) require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" -require "active_resource/railtie" require "sprockets/railtie" # require "rails/test_unit/railtie" require 'digest/md5' - +$: << './lib' if defined?(Bundler) # If you precompile assets before deploying to production, use this line Bundler.require(*Rails.groups(:assets => %w(development test))) @@ -17,7 +16,7 @@ if defined?(Bundler) end module Pettanr - VERSION = '0.6.2' + VERSION = '0.7.0' class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers @@ -39,6 +38,7 @@ config.assets.initialize_on_precompile = false # config.time_zone = 'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + I18n.enforce_available_locales = false config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s] config.i18n.default_locale = :ja @@ -54,61 +54,22 @@ 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 += Dir["#{config.root}/lib/validators/*", "#{config.root}/lib/editor/*", "#{config.root}/lib/manifest/*"] config.autoload_paths += %W(#{config.root}/lib/validators) - def self.licenses=(ary) - @@licenses = ary - end - - def self.licenses - @@licenses || {} - end - - def self.speech_balloons=(ary) - @@speech_balloons = ary - end - - def self.speech_balloons - @@speech_balloons || {} - end - - def self.writing_formats=(ary) - @@writing_formats = ary - end - - def self.writing_formats - @@writing_formats || {} - end - - def self.elements=(ary) - @@elements = ary - end - - def self.elements - @@elements || {} - end end -end -Pettanr::Application.licenses = YAML.load(open(Rails.root + 'config/license.yml').read) -Pettanr::Application.speech_balloons = YAML.load(open(Rails.root + 'config/speech_balloon.yml').read) -Pettanr::Application.writing_formats = YAML.load(open(Rails.root + 'config/writing_format.yml').read) -Pettanr::Application.elements = YAML.load(open(Rails.root + 'config/element.yml').read) -MagicNumber = YAML.load(open(Rails.root + 'config/magic_number.yml').read) -MagicNumber['test_layout'] = if File.exist? Rails.root + 'config/test_layout' - 'test' -else - false end -MagicNumber['profile'] = JSON.parse(open(Rails.root + 'config/profile.json').read).first[1] #strip profile body + y = YAML.load(open(Rails.root + 'config/picture_io.yml').read) require y[Rails.env]["adapter"] pio = PictureIO.const_get y[Rails.env]["io"] +host_dir = y[Rails.env]["host_dir"] 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"] + config.original_picture_io = pio.new host_dir, y[Rails.env]["original_picture"] + config.resource_picture_io = pio.new host_dir, y[Rails.env]["resource_picture"] + config.picture_io = pio.new host_dir, y[Rails.env]["picture"] + config.system_picture_io = pio.new host_dir, y[Rails.env]["system_picture"] end module ActiveRecord class Forbidden < ActiveRecordError @@ -119,5 +80,7 @@ module Pettanr TestLayout = false class BadRequest < StandardError end + class NotWork < StandardError + end end