OSDN Git Service

temp
[pettanr/pettanr.git] / config / application.rb
index 3e3c7cc..dee52ea 100644 (file)
@@ -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.4'
+  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
@@ -39,8 +40,8 @@ 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.
-    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
-    # config.i18n.default_locale = :de
+    config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
+    config.i18n.default_locale = :ja
 
     # Configure the default encoding used in templates for Ruby 1.9.
     config.encoding = "utf-8"
@@ -55,19 +56,71 @@ config.assets.initialize_on_precompile = false
     config.assets.version = '1.0'
     
     config.autoload_paths += %W(#{config.root}/lib/validators)
+=begin 
     
     def self.licenses=(ary)
       @@licenses = ary
     end
     
     def self.licenses
-      @@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
+    
+    def self.manifest=(arg)
+      @@manifest = Pettanr::Manifest.new arg
+    end
+    
+    def self.manifest
+      @@manifest
+    end
+  end
   
+  def manifest
+    Application::manifest
   end
+  
 end
+  
+=begin 
 Pettanr::Application.licenses = YAML.load(open(Rails.root + 'config/license.yml').read)
-MagicNumber = YAML.load(open(Rails.root + 'config/magic_number.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)
+=end
+Pettanr::Application.manifest = 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
+
 y = YAML.load(open(Rails.root + 'config/picture_io.yml').read)
 require y[Rails.env]["adapter"]
 pio = PictureIO.const_get y[Rails.env]["io"]
@@ -82,3 +135,11 @@ module ActiveRecord
   end
 end
 
+module Pettanr
+  TestLayout = false
+  class BadRequest < StandardError
+  end
+  class NotWork < StandardError
+  end
+end
+