Sha256: e2b8058af58b2c1d2144b6e8f657e1a8fb3598178679da54c7ea146186ba0d15

Contents?: true

Size: 859 Bytes

Versions: 4

Compression:

Stored size: 859 Bytes

Contents

module Xing
  class Engine < ::Rails::Engine
    isolate_namespace Xing

    rake_tasks do
      load "xing/tasks/all.rake"
    end

    paths.add "lib", autoload: true

    config.generators do |g|
      g.test_framework :rspec
    end

    # The ErrorConverter leverages (abuses?) the I18n mechanism to translate
    # ActiveModel validation errors into Xing JSON resource errors.  Here we
    # need to make sure the locales file for language 'json' is loaded for
    # I18n.
    initializer 'xing errors locales path' do
      I18n.load_path += Dir[File.join(File.dirname(__FILE__), '..', 'config', 'locales', '*.{rb,yml}')]
    end

    # Set the backend subdomain if it hasn't been configured by the user.
    initializer 'set subdomain' do
      Xing.configure do |xng_config|
        xng_config.backend_subdomain ||= 'api'
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xing-backend-1.0.0.pre.beta lib/xing/engine.rb
xing-backend-0.0.25 lib/xing/engine.rb
xing-backend-0.0.23 lib/xing/engine.rb
xing-backend-0.0.22 lib/xing/engine.rb