Sha256: afda7744a56ebb8ceb554786b0630e435b6e94fbe8e0c8a102896b77f738538b

Contents?: true

Size: 1.8 KB

Versions: 1

Compression:

Stored size: 1.8 KB

Contents

VersionCake.setup do |config|
  # Versioned Resources
  # Define what server resources are supported, deprecated or obsolete
  # Resources listed are priority based upon creation. To version all
  # resources you can define a catch all at the bottom of the block.
  config.resources do |r|
    # r.resource uri_regex, obsolete, deprecated, supported
    r.resource %r{.*}, [], [], (1..5)
  end

  # Extraction Strategies
  # Define how you will accept version from the request.
  #
  # Defaults to all:
  #   [:http_accept_parameter, :http_header, :request_parameter, :path_parameter, :query_parameter]
  #
  # Custom strategy example:
  #   You can create your own extraction strategy by giving a proc or class that responds to execute:
  # ```
  #     lambda {|request| request.headers["HTTP_X_MY_VERSION"] }
  # ```
  # or
  # ```
  # class ExtractorStrategy
  #   def execute(request)
  #     request.headers["HTTP_X_MY_VERSION"]
  #   end
  # end
  # ```
  # config.extraction_strategy = [:http_accept_parameter, :http_header, :request_parameter, :path_parameter, :query_parameter]

  # Version when no version in present in the request. If none is specified then it will error
  config.missing_version = 5

  # Set the version key that clients will send example: `API-VERSION: 5`, api_version=2
  # config.version_key = 'api_version'

  # Enable Rails versioned filename mapping
  # config.rails_view_versioning = true

  # Response Strategies
  # Define how (if at all) to include the version in the response. Similar to how to retrieve the
  # version, you can set where it will be in the response. For example, the `http_header_strategy`
  # will include it the response header under the key configured in `config.version_key`.
  #
  # Defaults to none
  #
  # config.response_strategy = [] # [:http_content_type, :http_header]
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
versioncake-3.1.0 lib/generators/templates/versioncake.rb