prepare 0.27.0 (#598)

- updates dependencies
- makes rubocop 0.48 happy
This commit is contained in:
peter scholz 2017-03-28 11:15:33 +02:00 committed by GitHub
parent 7b18dc9a2b
commit 1ede5c4f7f
111 changed files with 153 additions and 44 deletions

View File

@ -20,3 +20,6 @@ Metrics/MethodLength:
Style/IndentHash:
EnforcedStyle: consistent
Style/FileName:
Enabled: false

View File

@ -48,15 +48,9 @@ Style/ClassVars:
Style/Documentation:
Enabled: false
# Offense count: 5
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts.
Style/FileName:
Style/MixinGrouping:
Exclude:
- 'lib/grape-swagger.rb'
- 'spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb'
- 'spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb'
- 'spec/swagger_v2/api_swagger_v2_type-format_spec.rb'
- 'spec/swagger_v2/grape-swagger_spec.rb'
- spec/**/*
# Offense count: 1
# Cop supports --auto-correct.

View File

@ -10,7 +10,7 @@ after_success:
- bundle exec danger
rvm:
- 2.4.0
- 2.4.1
- 2.3.3
env:

View File

@ -2,6 +2,16 @@
#### Features
* Your contribution here.
#### Fixes
* Your contribution here.
### 0.27.0 (March 27, 2014)
#### Features
* [#583](https://github.com/ruby-grape/grape-swagger/pull/583): Issue #582: document file response - [@LeFnord](https://github.com/LeFnord).
* [#588](https://github.com/ruby-grape/grape-swagger/pull/588): Allow extension keys in Info object - [@mattyr](https://github.com/mattyr).
* [#589](https://github.com/ruby-grape/grape-swagger/pull/589): Allow overriding tag definitions in Info object - [@mattyr](https://github.com/mattyr).
@ -17,7 +27,7 @@
* Your contribution here.
### 0.26.1 (February 3, 2014)
### 0.26.1 (February 3, 2017)
#### Features

View File

@ -1 +1,3 @@
# frozen_string_literal: true
danger.import_dangerfile(gem: 'ruby-grape-danger')

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
source 'http://rubygems.org'
ruby RUBY_VERSION
@ -24,11 +25,12 @@ group :development, :test do
gem 'rake'
gem 'rdoc'
gem 'rspec', '~> 3.0'
gem 'rubocop', '~> 0.46'
gem 'rubocop', '~> 0.47'
end
group :test do
gem 'coveralls', require: false
gem 'grape-entity'
gem 'grape-entity', '~>0.5'
gem 'grape-swagger-entity'
gem 'ruby-grape-danger', '~> 0.1.1', require: false
gem 'simplecov', require: false

View File

@ -49,14 +49,9 @@ grape-swagger | swagger spec | grape | grape-entity | represen
--------------|--------------|-------------------------|--------------|---------------|
0.10.5 | 1.2 | >= 0.10.0 ... <= 0.14.0 | < 0.5.0 | n/a |
0.11.0 | 1.2 | >= 0.16.2 | < 0.5.0 | n/a |
0.20.1 | 2.0 | >= 0.12.0 ... <= 0.14.0 | <= 0.5.1 | n/a |
0.20.3 | 2.0 | >= 0.12.0 ... ~> 0.16.2 | ~> 0.5.1 | n/a |
0.21.0 | 2.0 | >= 0.12.0 ... <= 0.16.2 | <= 0.5.1 | >= 2.4.1 |
0.23.0 | 2.0 | >= 0.12.0 ... <= 0.17.0 | <= 0.5.1 | >= 2.4.1 |
0.24.0 | 2.0 | >= 0.12.0 ... <= 0.18.0 | <= 0.5.1 | >= 2.4.1 |
0.25.0 | 2.0 | >= 0.14.0 ... <= 0.18.0 | <= 0.5.2 | >= 2.4.1 |
0.25.2 | 2.0 | >= 0.14.0 ... <= 0.18.0 | <= 0.6.0 | >= 2.4.1 |
0.26.0 | 2.0 | >= 0.16.2 | <= 0.6.1 | >= 2.4.1 |
0.27.0 | 2.0 | >= 0.16.2 | => 0.5.0 | >= 2.4.1 |
<a name="swagger-spec" />
## Swagger-Spec

View File

@ -18,4 +18,4 @@ RSpec::Core::RakeTask.new(:spec)
require 'rubocop/rake_task'
RuboCop::RakeTask.new(:rubocop)
task default: [:spec, :rubocop]
task default: %i(spec rubocop)

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
require 'grape-swagger/version'

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'grape'
require 'grape-swagger/version'
@ -107,7 +108,7 @@ module Grape
ns.options[:swagger][:nested] != false
end
parent_standalone_namespaces = standalone_namespaces.reject { |ns_name, _| !name.start_with?(ns_name) }
parent_standalone_namespaces = standalone_namespaces.select { |ns_name, _| name.start_with?(ns_name) }
# add only to the main route
# if the namespace is not within any other namespace appearing as standalone resource
# rubocop:disable Style/Next

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'grape-swagger/doc_methods/status_codes'
require 'grape-swagger/doc_methods/produces_consumes'
require 'grape-swagger/doc_methods/data_type'
@ -38,7 +39,7 @@ module GrapeSwagger
class_variables_from(options)
if formatter
[:format, :default_format, :default_error_formatter].each do |method|
%i(format default_format default_error_formatter).each do |method|
send(method, formatter)
end
end

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class BuildModelDefinition

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class DataType

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class Extensions

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class Headers

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class MoveParams
@ -197,7 +198,7 @@ module GrapeSwagger
end
def property_keys
[:type, :format, :description, :minimum, :maximum, :items]
%i(type format description minimum maximum items)
end
def deletable?(param)

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class OperationId

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class OptionalObject

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class ParseParams

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class PathString

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class ProducesConsumes

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class StatusCodes

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class TagNameDescription

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class Version

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'active_support'
require 'active_support/core_ext/string/inflections.rb'
@ -148,7 +149,7 @@ module Grape
mime_types = GrapeSwagger::DocMethods::ProducesConsumes.call(format)
route_mime_types = [:formats, :content_types, :produces].map do |producer|
route_mime_types = %i(formats content_types produces).map do |producer|
possible = route.options[producer]
GrapeSwagger::DocMethods::ProducesConsumes.call(possible) if possible.present?
end.flatten.compact.uniq
@ -161,7 +162,7 @@ module Grape
if route.settings[:description] && route.settings[:description][:consumes]
format = route.settings[:description][:consumes]
end
mime_types = GrapeSwagger::DocMethods::ProducesConsumes.call(format) if [:post, :put].include?(method)
mime_types = GrapeSwagger::DocMethods::ProducesConsumes.call(format) if %i(post put).include?(method)
mime_types
end

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
module Errors
class UnregisteredParser < StandardError; end

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
class ModelParsers
include Enumerable

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'rake'
require 'rake/tasklib'
require 'rack/test'

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
VERSION = '0.26.1'
VERSION = '0.27.0'
end

View File

@ -1,5 +1,6 @@
# encoding: utf-8
# frozen_string_literal: true
require 'spec_helper'
describe 'describing versions' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe '#427 nested entity given as string' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'definition names' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe '#532 allow custom format' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe '#533 specify status codes' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe '#537 enum values spec' do
@ -6,7 +7,7 @@ describe '#537 enum values spec' do
Class.new(Grape::API) do
namespace :issue_537 do
class Spec < Grape::Entity
expose :enum_property, documentation: { values: [:foo, :bar] }
expose :enum_property, documentation: { values: %i(foo bar) }
expose :enum_property_default, documentation: { values: %w(a b c), default: 'c' }
expose :own_format, documentation: { format: 'log' }
end

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe '#539 post params given as array' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe '#542 array of type in post params' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe '#553 array of type in post/put params' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe '#572 is_array is applied to all possible responses' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe '#579 put / post parameters spec' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe '#582 respond with a file' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe '#587 process route with parameters delimited by dash' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe GrapeSwagger::DocMethods::DataType do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe Grape::Endpoint do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe GrapeSwagger::DocMethods::Extensions do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe GrapeSwagger::ModelParsers do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe GrapeSwagger::DocMethods::MoveParams do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe GrapeSwagger::Rake::OapiTasks do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: false
require 'spec_helper'
describe GrapeSwagger::DocMethods::OperationId do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe GrapeSwagger::DocMethods::OptionalObject do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe GrapeSwagger::DocMethods::ParseParams do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe GrapeSwagger::DocMethods::PathString do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe GrapeSwagger::DocMethods::ProducesConsumes do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe GrapeSwagger::DocMethods::TagNameDescription do
@ -7,7 +8,7 @@ describe GrapeSwagger::DocMethods::TagNameDescription do
subject { described_class.send(:build_memo, tag) }
specify do
expect(subject.keys).to eql [:name, :description]
expect(subject.keys).to eql %i(name description)
expect(subject).to eql(
name: tag,
description: "Operations about #{tag.pluralize}"

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe GrapeSwagger::DocMethods::Version do
@ -8,7 +9,7 @@ describe GrapeSwagger::DocMethods::Version do
describe 'grape 0.16.2 version' do
let(:version) { '[:v1, :v2]' }
it { is_expected.to be_a Array }
it { is_expected.to eql [:v1, :v2] }
it { is_expected.to eql %i(v1 v2) }
end
describe 'newer grape versions' do
@ -19,9 +20,9 @@ describe GrapeSwagger::DocMethods::Version do
end
describe 'as Array' do
let(:version) { [:v1, :v2] }
let(:version) { %i(v1 v2) }
it { is_expected.to be_a Array }
it { is_expected.to eql [:v1, :v2] }
it { is_expected.to eql %i(v1 v2) }
end
end
end

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'simplecov'
require 'coveralls'

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
class EmptyClass
end

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
class GrapeVersion
class << self
def current_version

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
module GrapeSwagger
class MockParser
attr_reader :model

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
RSpec.shared_context 'entity swagger example' do
before :all do
module Entities

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
RSpec.shared_context 'mock swagger example' do
before :all do
module Entities

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'representable/json'
RSpec.shared_context 'representable swagger example' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
RSpec.shared_context 'namespace example' do
before :all do
module TheApi

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
RSpec.shared_context 'the api paths/defs' do
let(:paths) do
{

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'body parameter definitions' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'definitions/models' do

View File

@ -1,24 +1,25 @@
# frozen_string_literal: true
require 'spec_helper'
def details
<<-DETAILS
# Burgers in Heaven
# Burgers in Heaven
> A burger doesn't come for free
> A burger doesn't come for free
If you want to reserve a burger in heaven, you have to do
some crazy stuff on earth.
If you want to reserve a burger in heaven, you have to do
some crazy stuff on earth.
```
def do_good
puts 'help people'
end
```
```
def do_good
puts 'help people'
end
```
* _Will go to Heaven:_ Probably
* _Will go to Hell:_ Probably not
DETAILS
* _Will go to Heaven:_ Probably
* _Will go to Hell:_ Probably not
DETAILS
end
describe 'details' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'extensions' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'format, content_type' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'global configuration stuff' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'document hash and array' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'headers' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'hide documentation path' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'hidden flag enables a single endpoint parameter to be excluded from the documentation' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'swagger spec v2.0' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'swagger spec v2.0' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'moving body/formData Params to definitions' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `header`' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `header`' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'additional parameter settings' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'response' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'swagger spec v2.0' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
# mapping of parameter types

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'Boolean Params' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
# require 'grape_version'

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'details' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'Grape::Endpoint#path_and_definitions' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'Errors' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'Float Params' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'Form Params' do
@ -34,7 +35,7 @@ describe 'Form Params' do
params do
requires :id, type: Integer, desc: 'id of item'
requires :name, type: String, desc: 'name of item'
optional :conditions, type: Symbol, desc: 'conditions of item', values: [:one, :two]
optional :conditions, type: Symbol, desc: 'conditions of item', values: %i(one two)
end
post '/items/:id' do
{}

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe Grape::API do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'a hide mounted api' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'host in the swagger_doc' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'docs mounted separately from api' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'namespace tags check while using prefix and version' do
@ -7,7 +8,7 @@ describe 'namespace tags check while using prefix and version' do
before :all do
module TheApi
class NamespaceApi < Grape::API
version [:v1, :v2]
version %i(v1 v2)
end
class CascadingVersionApi < Grape::API

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'namespace tags check' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'namespace' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'a nicknamed mounted api' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'an operation id api' do

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'Params Multi Types' do

Some files were not shown because too many files have changed in this diff Show More