Sha256: 14a6412bc28daeb07934f581e68edc354f2af8e8bdca0607b471e149fa16f59a

Contents?: true

Size: 830 Bytes

Versions: 13

Compression:

Stored size: 830 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

13 entries across 13 versions & 1 rubygems

Version Path
swagger_docs_generator-0.3.5 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.3.5.pre.31 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.3.4.pre.26 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.3.4 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.3.4.pre.23 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.3.3 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.3.2 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.3.1 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.3.0.pre.19 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.3.0.pre.18 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.2.0 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.2.0.pre.14 lib/generators/swagger_docs_generator/initializer_generator.rb
swagger_docs_generator-0.2.0.pre.13 lib/generators/swagger_docs_generator/initializer_generator.rb