Module: Octokit::Preview
- Included in:
- Client
- Defined in:
- lib/octokit/preview.rb
Overview
Default setup options for preview features
Constant Summary collapse
- PREVIEW_TYPES =
{ :branch_protection => 'application/vnd.github.loki-preview+json'.freeze, :migrations => 'application/vnd.github.wyandotte-preview+json'.freeze, :licenses => 'application/vnd.github.drax-preview+json'.freeze, :source_imports => 'application/vnd.github.barred-rock-preview'.freeze, }
Instance Method Summary collapse
Instance Method Details
#ensure_api_media_type(type, options) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/octokit/preview.rb', line 13 def ensure_api_media_type(type, ) if [:accept].nil? [:accept] = PREVIEW_TYPES[type] warn_preview(type) end end |
#warn_preview(type) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/octokit/preview.rb', line 21 def warn_preview(type) 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 |