module Octokit::Preview

Default setup options for preview features

Constants

PREVIEW_TYPES

Public Instance Methods

ensure_api_media_type(type, options) click to toggle source
# File lib/octokit/preview.rb, line 33
def ensure_api_media_type(type, options)
  if options[:accept].nil?
    options[:accept] = PREVIEW_TYPES[type]
    warn_preview(type)
  end
  options
end
warn_preview(type) click to toggle source
# File lib/octokit/preview.rb, line 41
    def warn_preview(type)
      octokit_warn <<-EOS
WARNING: The preview version of the #{type.to_s.capitalize} API is not yet suitable for production use.
You can avoid this message by supplying an appropriate media type in the 'Accept' request
header.
EOS
    end