Sha256: 056882ba93cafb49adb62144042e3578e1af8f88ae32e45d25cb2c3fe4f4c369

Contents?: true

Size: 854 Bytes

Versions: 5

Compression:

Stored size: 854 Bytes

Contents

# frozen_string_literal: true

module SwaggerDocsGenerator
  # # Generator Rails
  #
  # Create a initializer for rails application
  class InitializerGenerator < Rails::Generators::Base
    desc 'Generate a initializer for Swagger Docs Generator'
    INITIALIZER = <<-INIT
  # frozen_string_literal: true

  if Rails.env.doc?
    SwaggerDocsGenerator.configure do |config|
      config.swagger = '2.2.4'        # Swagger version used
      config.base_path = '/'          # Base to API
      config.host = 'localhost:3000'  # Host api
    end

    SwaggerDocsGenerator.configure_info do |info|
      info.title = 'API example.com'  # Title to API
      info.version = 'v1'             # Version to API
    end
  end
    INIT

    # Create initializer
    def copy_initializer
      initializer 'swagger_docs_generator.rb', INITIALIZER
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
swagger_docs_generator-0.5.1 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.5.0.pre.42 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.4.0 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.3.6 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.3.6.pre.34 lib/generators/swagger_docs_generator/initializer_generator.rb