X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=config%2Fapplication.rb;h=c31348bdca97b943a566a327d1238e490858aef8;hb=32011a831d9b226af0ee586c91ca5c5225048976;hp=78e162fbd25c9108c89cf3900679a1035da4f31c;hpb=e1aff53c708615651113f265cd7c302b65c55485;p=pettanr%2Fpettanr.git diff --git a/config/application.rb b/config/application.rb index 78e162fb..c31348bd 100644 --- a/config/application.rb +++ b/config/application.rb @@ -15,9 +15,10 @@ if defined?(Bundler) # If you want your assets lazily compiled in production, use this line # Bundler.require(:default, :assets, Rails.env) end +require "manifest" module Pettanr - VERSION = '0.6.1' + VERSION = '0.6.2' class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers @@ -56,33 +57,30 @@ config.assets.initialize_on_precompile = false config.autoload_paths += %W(#{config.root}/lib/validators) - def self.licenses=(ary) - @@licenses = ary + def self.manifest=(arg) + @@manifest = arg end - def self.licenses - @@licenses || {} + def self.manifest + @@manifest end - - def self.speech_balloons=(ary) - @@speech_balloons = ary - end - - def self.speech_balloons - @@speech_balloons || {} - end - end + end + + def manifest + Application::manifest + 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) -MagicNumber = YAML.load(open(Rails.root + 'config/magic_number.yml').read) +Pettanr::Application.manifest = Pettanr::Manifest.new JSON.parse(open(Rails.root + 'public/manifest.json').read) +MagicNumber = Pettanr::Application.manifest.magic_numbers +MagicNumber.merge! Pettanr::Application.manifest.select_items 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"] @@ -101,5 +99,7 @@ module Pettanr TestLayout = false class BadRequest < StandardError end + class NotWork < StandardError + end end