Sha256: 09468c4f09071e89c90d9e5ecdf5fd1fdb3d39b79dbfcdd4fbf2a7ca99d9e7af

Contents?: true

Size: 1.53 KB

Versions: 13

Compression:

Stored size: 1.53 KB

Contents

require 'bootstrap'

module Shipit
  class Engine < ::Rails::Engine
    isolate_namespace Shipit

    paths['app/models'] << 'app/serializers' << 'app/serializers/concerns'

    initializer 'shipit.config' do |app|
      Rails.application.routes.default_url_options[:host] = Shipit.host
      Shipit::Engine.routes.default_url_options[:host] = Shipit.host
      Pubsubstub.redis_url = Shipit.redis_url.to_s

      app.config.assets.paths << Emoji.images_path
      app.config.assets.precompile += %w(
        favicon.ico
        task.js
        shipit.js
        shipit.css
        shipit_bs.js
        shipit_bs.css
      )
      app.config.assets.precompile << proc do |path|
        path =~ %r{\Aplugins/[\-\w]+\.(js|css)\Z}
      end
      app.config.assets.precompile << proc do |path|
        path.start_with?('emoji/') && path.end_with?('.png')
      end

      ActionDispatch::ExceptionWrapper.rescue_responses[Shipit::TaskDefinition::NotFound.name] = :not_found

      ActiveModel::Serializer._root = false
      ActiveModel::ArraySerializer._root = false
      ActiveModel::Serializer.include(Engine.routes.url_helpers)

      if Shipit.github_oauth_credentials
        OmniAuth::Strategies::GitHub.configure path_prefix: '/github/auth'
        app.middleware.use OmniAuth::Builder do
          provider(
            :github,
            Shipit.github_oauth_id,
            Shipit.github_oauth_secret,
            scope: 'email,repo_deployment',
            client_options: Shipit.github_oauth_options,
          )
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
shipit-engine-0.20.1 lib/shipit/engine.rb
shipit-engine-0.20.0 lib/shipit/engine.rb
shipit-engine-0.19.0 lib/shipit/engine.rb
shipit-engine-0.18.1 lib/shipit/engine.rb
shipit-engine-0.18.0 lib/shipit/engine.rb
shipit-engine-0.17.0 lib/shipit/engine.rb
shipit-engine-0.16.0 lib/shipit/engine.rb
shipit-engine-0.15.0 lib/shipit/engine.rb
shipit-engine-0.14.0 lib/shipit/engine.rb
shipit-engine-0.13.0 lib/shipit/engine.rb
shipit-engine-0.12.1 lib/shipit/engine.rb
shipit-engine-0.12.0 lib/shipit/engine.rb
shipit-engine-0.11.0 lib/shipit/engine.rb