Sha256: 1910a184efab2f3e88e6b7a658fba98dba66bf42d0c697cc0654f2c30f128fbe

Contents?: true

Size: 716 Bytes

Versions: 4

Compression:

Stored size: 716 Bytes

Contents

module WestfieldSwagger
  class Engine < ::Rails::Engine
    isolate_namespace WestfieldSwagger

    config.generators do |g|
      g.test_framework :rspec
      g.assets false
      g.helper false
    end

    initializer 'static assets' do |app|
      app.middleware.use(
        ::ActionDispatch::Static,
        "#{root}/public"
      )
    end
  end

  DEFAULT_API_VERSION = '1'

  def self.api_version
    if ENV.include? 'SWAGGER_API_VERSION'
      ENV['SWAGGER_API_VERSION'].to_s
    elsif Rails.application.config.respond_to? :api_version
      Rails.application.config.api_version.to_s
    else
      DEFAULT_API_VERSION
    end
  end

  def self.path_for(version)
    "/swagger/#{version}.json"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
westfield_swagger-1.2.6 lib/westfield_swagger/engine.rb
westfield_swagger-1.2.5 lib/westfield_swagger/engine.rb
westfield_swagger-1.2.4 lib/westfield_swagger/engine.rb
westfield_swagger-1.2.3 lib/westfield_swagger/engine.rb