From 6534b6c039326007e2143a74513fff644a80518b Mon Sep 17 00:00:00 2001 From: LeFnord Date: Sun, 18 Dec 2016 15:08:26 +0100 Subject: [PATCH] support ruby 2.4 --- .ruby-gemset | 1 - .travis.yml | 21 ++++++------------- Gemfile | 1 + README.md | 1 + Rakefile | 2 ++ grape-swagger.gemspec | 3 ++- lib/grape-swagger.rb | 1 + lib/grape-swagger/doc_methods.rb | 1 + .../doc_methods/build_model_definition.rb | 1 + lib/grape-swagger/doc_methods/data_type.rb | 1 + lib/grape-swagger/doc_methods/extensions.rb | 1 + lib/grape-swagger/doc_methods/headers.rb | 1 + lib/grape-swagger/doc_methods/move_params.rb | 1 + lib/grape-swagger/doc_methods/operation_id.rb | 1 + .../doc_methods/optional_object.rb | 1 + lib/grape-swagger/doc_methods/parse_params.rb | 1 + lib/grape-swagger/doc_methods/path_string.rb | 1 + .../doc_methods/produces_consumes.rb | 1 + lib/grape-swagger/doc_methods/status_codes.rb | 1 + .../doc_methods/tag_name_description.rb | 1 + lib/grape-swagger/endpoint.rb | 2 +- lib/grape-swagger/errors.rb | 1 + lib/grape-swagger/grape/route.rb | 1 + .../markdown/kramdown_adapter.rb | 1 + .../markdown/redcarpet_adapter.rb | 1 + lib/grape-swagger/model_parsers.rb | 1 + lib/grape-swagger/rake/oapi_tasks.rb | 1 + spec/issues/403_versions_spec.rb | 1 + spec/issues/430_entity_definitions_spec.rb | 1 + spec/lib/data_type_spec.rb | 1 + spec/lib/endpoint_spec.rb | 1 + spec/lib/extensions_spec.rb | 1 + spec/lib/model_parsers_spec.rb | 1 + spec/lib/move_params_spec.rb | 1 + spec/lib/oapi_tasks_spec.rb | 1 + spec/lib/operation_id_spec.rb | 1 + spec/lib/optional_object_spec.rb | 1 + spec/lib/path_string_spec.rb | 1 + spec/lib/produces_consumes_spec.rb | 1 + spec/markdown/kramdown_adapter_spec.rb | 1 + spec/markdown/redcarpet_adapter_spec.rb | 1 + spec/spec_helper.rb | 1 + spec/support/empty_model_parser.rb | 1 + spec/support/grape_version.rb | 1 + spec/support/mock_parser.rb | 1 + spec/support/model_parsers/entity_parser.rb | 1 + spec/support/model_parsers/mock_parser.rb | 1 + .../model_parsers/representable_parser.rb | 1 + spec/support/namespace_tags.rb | 1 + spec/support/the_paths_definitions.rb | 1 + .../api_swagger_v2_body_definitions_spec.rb | 1 + .../api_swagger_v2_definitions-models_spec.rb | 1 + spec/swagger_v2/api_swagger_v2_detail_spec.rb | 3 +++ .../api_swagger_v2_extensions_spec.rb | 1 + ...api_swagger_v2_format-content_type_spec.rb | 1 + ...pi_swagger_v2_global_configuration_spec.rb | 1 + .../api_swagger_v2_hash_and_array_spec.rb | 1 + .../swagger_v2/api_swagger_v2_headers_spec.rb | 1 + ...swagger_v2_hide_documentation_path_spec.rb | 1 + .../api_swagger_v2_hide_param_spec.rb | 1 + .../api_swagger_v2_ignore_defaults_spec.rb | 1 + .../swagger_v2/api_swagger_v2_mounted_spec.rb | 1 + ..._swagger_v2_param_type_body_nested_spec.rb | 1 + .../api_swagger_v2_param_type_body_spec.rb | 1 + .../api_swagger_v2_param_type_spec.rb | 1 + .../api_swagger_v2_request_params_fix_spec.rb | 1 + .../api_swagger_v2_response_spec.rb | 1 + spec/swagger_v2/api_swagger_v2_spec.rb | 1 + .../api_swagger_v2_type-format_spec.rb | 1 + spec/swagger_v2/boolean_params_spec.rb | 1 + spec/swagger_v2/default_api_spec.rb | 1 + .../swagger_v2/description_not_initialized.rb | 1 + .../endpoint_versioned_path_spec.rb | 1 + spec/swagger_v2/errors_spec.rb | 1 + spec/swagger_v2/float_api_spec.rb | 1 + spec/swagger_v2/form_params_spec.rb | 1 + spec/swagger_v2/grape-swagger_spec.rb | 1 + spec/swagger_v2/hide_api_spec.rb | 1 + spec/swagger_v2/host.rb | 1 + spec/swagger_v2/mounted_target_class_spec.rb | 1 + spec/swagger_v2/namespace_tags_prefix_spec.rb | 1 + spec/swagger_v2/namespace_tags_spec.rb | 1 + spec/swagger_v2/namespaced_api_spec.rb | 1 + spec/swagger_v2/nicknamed_api_spec.rb | 1 + spec/swagger_v2/param_multi_type_spec.rb | 1 + spec/swagger_v2/param_type_spec.rb | 1 + spec/swagger_v2/param_values_spec.rb | 1 + .../params_array_collection_fromat_spec.rb | 1 + spec/swagger_v2/params_array_spec.rb | 1 + spec/swagger_v2/params_hash_spec.rb | 1 + spec/swagger_v2/params_nested_spec.rb | 1 + spec/swagger_v2/reference_entity.rb | 1 + spec/swagger_v2/security_requirement_spec.rb | 1 + spec/swagger_v2/simple_mounted_api_spec.rb | 1 + spec/version_spec.rb | 1 + 95 files changed, 103 insertions(+), 18 deletions(-) delete mode 100644 .ruby-gemset diff --git a/.ruby-gemset b/.ruby-gemset deleted file mode 100644 index b2170da1..00000000 --- a/.ruby-gemset +++ /dev/null @@ -1 +0,0 @@ -grape-swagger diff --git a/.travis.yml b/.travis.yml index afeebb09..aa88487c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,32 +6,23 @@ before_install: matrix: include: - - rvm: 2.3.3 - script: - - bundle exec danger - - rvm: 2.3.3 + - rvm: 2.4.0-preview3 env: MODEL_PARSER=grape-swagger-entity - - rvm: 2.3.3 + - rvm: 2.4.0-preview3 env: MODEL_PARSER=grape-swagger-representable - - rvm: 2.3.3 - env: GRAPE_VERSION=0.14.0 - - rvm: 2.3.3 - env: GRAPE_VERSION=0.15.0 - - rvm: 2.3.3 env: GRAPE_VERSION=0.16.2 - - rvm: 2.3.3 + - rvm: 2.4.0-preview3 env: GRAPE_VERSION=0.17.0 - - rvm: 2.3.3 + - rvm: 2.4.0-preview3 env: GRAPE_VERSION=0.18.0 - - rvm: 2.3.3 + - rvm: 2.4.0-preview3 env: GRAPE_VERSION=HEAD + - rvm: 2.3.3 - rvm: 2.2 - rvm: ruby-head - rvm: jruby-9.1.6.0 - rvm: jruby-head - - rvm: rbx-2 allow_failures: - rvm: ruby-head - rvm: jruby-9.1.6.0 - rvm: jruby-head - - rvm: rbx-2 diff --git a/Gemfile b/Gemfile index 153c818d..893718ab 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,4 @@ +# frozen_string_literal: true source 'http://rubygems.org' ruby RUBY_VERSION diff --git a/README.md b/README.md index 476380d3..a21e2436 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ grape-swagger | swagger spec | grape | grape-entity | represen 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.xx.0 | 2.0 | >= 0.16.0 ... | >= 0.5.2 | >= 2.4.1 | ## Swagger-Spec diff --git a/Rakefile b/Rakefile index 86fa4128..5f2e050f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,5 @@ # encoding: utf-8 +# frozen_string_literal: true require 'rubygems' require 'bundler' @@ -14,6 +15,7 @@ require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) +# task default: [:spec] require 'rubocop/rake_task' RuboCop::RakeTask.new(:rubocop) diff --git a/grape-swagger.gemspec b/grape-swagger.gemspec index 73d418e0..8334cd46 100644 --- a/grape-swagger.gemspec +++ b/grape-swagger.gemspec @@ -1,3 +1,4 @@ +# frozen_string_literal: true $LOAD_PATH.push File.expand_path('../lib', __FILE__) require 'grape-swagger/version' @@ -11,7 +12,7 @@ Gem::Specification.new do |s| s.summary = 'Add auto generated documentation to your Grape API that can be displayed with Swagger.' s.license = 'MIT' - s.add_runtime_dependency 'grape', '>= 0.12.0' + s.add_runtime_dependency 'grape', '~> 0.16' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec}/*`.split("\n") diff --git a/lib/grape-swagger.rb b/lib/grape-swagger.rb index 726b4f1c..6c811871 100644 --- a/lib/grape-swagger.rb +++ b/lib/grape-swagger.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'grape' require 'grape-swagger/grape/route' diff --git a/lib/grape-swagger/doc_methods.rb b/lib/grape-swagger/doc_methods.rb index e00cba86..e35671bd 100644 --- a/lib/grape-swagger/doc_methods.rb +++ b/lib/grape-swagger/doc_methods.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'grape-swagger/doc_methods/status_codes' require 'grape-swagger/doc_methods/produces_consumes' diff --git a/lib/grape-swagger/doc_methods/build_model_definition.rb b/lib/grape-swagger/doc_methods/build_model_definition.rb index 7176f96e..13026c3d 100644 --- a/lib/grape-swagger/doc_methods/build_model_definition.rb +++ b/lib/grape-swagger/doc_methods/build_model_definition.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger module DocMethods class BuildModelDefinition diff --git a/lib/grape-swagger/doc_methods/data_type.rb b/lib/grape-swagger/doc_methods/data_type.rb index 3669af54..42874acb 100644 --- a/lib/grape-swagger/doc_methods/data_type.rb +++ b/lib/grape-swagger/doc_methods/data_type.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger module DocMethods class DataType diff --git a/lib/grape-swagger/doc_methods/extensions.rb b/lib/grape-swagger/doc_methods/extensions.rb index 1762922f..0f9aea40 100644 --- a/lib/grape-swagger/doc_methods/extensions.rb +++ b/lib/grape-swagger/doc_methods/extensions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger module DocMethods class Extensions diff --git a/lib/grape-swagger/doc_methods/headers.rb b/lib/grape-swagger/doc_methods/headers.rb index 8b3eac3b..709a27c9 100644 --- a/lib/grape-swagger/doc_methods/headers.rb +++ b/lib/grape-swagger/doc_methods/headers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger module DocMethods class Headers diff --git a/lib/grape-swagger/doc_methods/move_params.rb b/lib/grape-swagger/doc_methods/move_params.rb index a8bdd10e..d760fe40 100644 --- a/lib/grape-swagger/doc_methods/move_params.rb +++ b/lib/grape-swagger/doc_methods/move_params.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger module DocMethods class MoveParams diff --git a/lib/grape-swagger/doc_methods/operation_id.rb b/lib/grape-swagger/doc_methods/operation_id.rb index 47c7209a..43abaf2e 100644 --- a/lib/grape-swagger/doc_methods/operation_id.rb +++ b/lib/grape-swagger/doc_methods/operation_id.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger module DocMethods class OperationId diff --git a/lib/grape-swagger/doc_methods/optional_object.rb b/lib/grape-swagger/doc_methods/optional_object.rb index b5f8d2b9..faccf308 100644 --- a/lib/grape-swagger/doc_methods/optional_object.rb +++ b/lib/grape-swagger/doc_methods/optional_object.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger module DocMethods class OptionalObject diff --git a/lib/grape-swagger/doc_methods/parse_params.rb b/lib/grape-swagger/doc_methods/parse_params.rb index 0edad04f..f081a349 100644 --- a/lib/grape-swagger/doc_methods/parse_params.rb +++ b/lib/grape-swagger/doc_methods/parse_params.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger module DocMethods class ParseParams diff --git a/lib/grape-swagger/doc_methods/path_string.rb b/lib/grape-swagger/doc_methods/path_string.rb index b1fccd55..baef3c7e 100644 --- a/lib/grape-swagger/doc_methods/path_string.rb +++ b/lib/grape-swagger/doc_methods/path_string.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger module DocMethods class PathString diff --git a/lib/grape-swagger/doc_methods/produces_consumes.rb b/lib/grape-swagger/doc_methods/produces_consumes.rb index 66f4949e..a991c351 100644 --- a/lib/grape-swagger/doc_methods/produces_consumes.rb +++ b/lib/grape-swagger/doc_methods/produces_consumes.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger module DocMethods class ProducesConsumes diff --git a/lib/grape-swagger/doc_methods/status_codes.rb b/lib/grape-swagger/doc_methods/status_codes.rb index d26bf650..76f45cf2 100644 --- a/lib/grape-swagger/doc_methods/status_codes.rb +++ b/lib/grape-swagger/doc_methods/status_codes.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger module DocMethods class StatusCodes diff --git a/lib/grape-swagger/doc_methods/tag_name_description.rb b/lib/grape-swagger/doc_methods/tag_name_description.rb index 08f33c65..bff0e290 100644 --- a/lib/grape-swagger/doc_methods/tag_name_description.rb +++ b/lib/grape-swagger/doc_methods/tag_name_description.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger module DocMethods class TagNameDescription diff --git a/lib/grape-swagger/endpoint.rb b/lib/grape-swagger/endpoint.rb index da260b65..30f053f8 100644 --- a/lib/grape-swagger/endpoint.rb +++ b/lib/grape-swagger/endpoint.rb @@ -240,7 +240,7 @@ def partition_params(route) parse_request_params(required) end || {} - request_params = route.params.merge(request_params) if route.params.present? && !route.settings[:declared_params].present? + return route.params.merge(request_params) if route.params.present? && !route.settings[:declared_params].present? request_params end diff --git a/lib/grape-swagger/errors.rb b/lib/grape-swagger/errors.rb index 243e47b0..5a599620 100644 --- a/lib/grape-swagger/errors.rb +++ b/lib/grape-swagger/errors.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger module Errors class MarkdownDependencyMissingError < StandardError diff --git a/lib/grape-swagger/grape/route.rb b/lib/grape-swagger/grape/route.rb index e84b6c9a..6bbcab18 100644 --- a/lib/grape-swagger/grape/route.rb +++ b/lib/grape-swagger/grape/route.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # backwards compatibility for Grape < 0.16.0 module Grape class Route diff --git a/lib/grape-swagger/markdown/kramdown_adapter.rb b/lib/grape-swagger/markdown/kramdown_adapter.rb index ca07f9fc..0af84f00 100644 --- a/lib/grape-swagger/markdown/kramdown_adapter.rb +++ b/lib/grape-swagger/markdown/kramdown_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger class Markdown class KramdownAdapter diff --git a/lib/grape-swagger/markdown/redcarpet_adapter.rb b/lib/grape-swagger/markdown/redcarpet_adapter.rb index 13b10a33..baae55a3 100644 --- a/lib/grape-swagger/markdown/redcarpet_adapter.rb +++ b/lib/grape-swagger/markdown/redcarpet_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger class Markdown class RedcarpetAdapter diff --git a/lib/grape-swagger/model_parsers.rb b/lib/grape-swagger/model_parsers.rb index 711443ae..153eef02 100644 --- a/lib/grape-swagger/model_parsers.rb +++ b/lib/grape-swagger/model_parsers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger class ModelParsers include Enumerable diff --git a/lib/grape-swagger/rake/oapi_tasks.rb b/lib/grape-swagger/rake/oapi_tasks.rb index 62dfdf6b..16ffe9f2 100644 --- a/lib/grape-swagger/rake/oapi_tasks.rb +++ b/lib/grape-swagger/rake/oapi_tasks.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'rake' require 'rake/tasklib' require 'rack/test' diff --git a/spec/issues/403_versions_spec.rb b/spec/issues/403_versions_spec.rb index 543a7d79..9cf3f548 100644 --- a/spec/issues/403_versions_spec.rb +++ b/spec/issues/403_versions_spec.rb @@ -1,4 +1,5 @@ # encoding: utf-8 +# frozen_string_literal: true require 'spec_helper' describe 'describing versions' do diff --git a/spec/issues/430_entity_definitions_spec.rb b/spec/issues/430_entity_definitions_spec.rb index 7ed2cc78..053723a0 100644 --- a/spec/issues/430_entity_definitions_spec.rb +++ b/spec/issues/430_entity_definitions_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'definition names' do diff --git a/spec/lib/data_type_spec.rb b/spec/lib/data_type_spec.rb index a1297af7..88c35895 100644 --- a/spec/lib/data_type_spec.rb +++ b/spec/lib/data_type_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe GrapeSwagger::DocMethods::DataType do diff --git a/spec/lib/endpoint_spec.rb b/spec/lib/endpoint_spec.rb index 9bd1b378..6b55c136 100644 --- a/spec/lib/endpoint_spec.rb +++ b/spec/lib/endpoint_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe Grape::Endpoint do diff --git a/spec/lib/extensions_spec.rb b/spec/lib/extensions_spec.rb index 08de73ff..2fddffbc 100644 --- a/spec/lib/extensions_spec.rb +++ b/spec/lib/extensions_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe GrapeSwagger::DocMethods::Extensions do diff --git a/spec/lib/model_parsers_spec.rb b/spec/lib/model_parsers_spec.rb index 0314b6b4..a9830fd6 100644 --- a/spec/lib/model_parsers_spec.rb +++ b/spec/lib/model_parsers_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe GrapeSwagger::ModelParsers do diff --git a/spec/lib/move_params_spec.rb b/spec/lib/move_params_spec.rb index 76becf97..3e5fde61 100644 --- a/spec/lib/move_params_spec.rb +++ b/spec/lib/move_params_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe GrapeSwagger::DocMethods::MoveParams do diff --git a/spec/lib/oapi_tasks_spec.rb b/spec/lib/oapi_tasks_spec.rb index 9636c38b..541ca191 100644 --- a/spec/lib/oapi_tasks_spec.rb +++ b/spec/lib/oapi_tasks_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' RSpec.describe GrapeSwagger::Rake::OapiTasks do diff --git a/spec/lib/operation_id_spec.rb b/spec/lib/operation_id_spec.rb index 12dcd50c..1590f33b 100644 --- a/spec/lib/operation_id_spec.rb +++ b/spec/lib/operation_id_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require 'spec_helper' describe GrapeSwagger::DocMethods::OperationId do diff --git a/spec/lib/optional_object_spec.rb b/spec/lib/optional_object_spec.rb index 6da8c742..691fdff8 100644 --- a/spec/lib/optional_object_spec.rb +++ b/spec/lib/optional_object_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe GrapeSwagger::DocMethods::OptionalObject do diff --git a/spec/lib/path_string_spec.rb b/spec/lib/path_string_spec.rb index 40c6592d..69a95f0d 100644 --- a/spec/lib/path_string_spec.rb +++ b/spec/lib/path_string_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require 'spec_helper' describe GrapeSwagger::DocMethods::PathString do diff --git a/spec/lib/produces_consumes_spec.rb b/spec/lib/produces_consumes_spec.rb index e59fdce4..3f47c27b 100644 --- a/spec/lib/produces_consumes_spec.rb +++ b/spec/lib/produces_consumes_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe GrapeSwagger::DocMethods::ProducesConsumes do diff --git a/spec/markdown/kramdown_adapter_spec.rb b/spec/markdown/kramdown_adapter_spec.rb index e6f9390f..aff98a89 100644 --- a/spec/markdown/kramdown_adapter_spec.rb +++ b/spec/markdown/kramdown_adapter_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe GrapeSwagger::Markdown::KramdownAdapter do diff --git a/spec/markdown/redcarpet_adapter_spec.rb b/spec/markdown/redcarpet_adapter_spec.rb index 6c1bd1e0..957a2603 100644 --- a/spec/markdown/redcarpet_adapter_spec.rb +++ b/spec/markdown/redcarpet_adapter_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe GrapeSwagger::Markdown::RedcarpetAdapter, unless: RUBY_PLATFORM.eql?('java') || RUBY_ENGINE.eql?('rbx') do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index be1acabb..c81eefac 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) MODEL_PARSER = ENV.key?('MODEL_PARSER') ? ENV['MODEL_PARSER'].to_s.downcase.sub('grape-swagger-', '') : 'mock' diff --git a/spec/support/empty_model_parser.rb b/spec/support/empty_model_parser.rb index b79d3ff9..a6e73a78 100644 --- a/spec/support/empty_model_parser.rb +++ b/spec/support/empty_model_parser.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class EmptyClass end diff --git a/spec/support/grape_version.rb b/spec/support/grape_version.rb index 035fa0bd..16311d08 100644 --- a/spec/support/grape_version.rb +++ b/spec/support/grape_version.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class GrapeVersion class << self def current_version diff --git a/spec/support/mock_parser.rb b/spec/support/mock_parser.rb index e39e7b8a..635ecda3 100644 --- a/spec/support/mock_parser.rb +++ b/spec/support/mock_parser.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module GrapeSwagger class MockParser attr_reader :model diff --git a/spec/support/model_parsers/entity_parser.rb b/spec/support/model_parsers/entity_parser.rb index babfd221..5180aae4 100644 --- a/spec/support/model_parsers/entity_parser.rb +++ b/spec/support/model_parsers/entity_parser.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.shared_context 'entity swagger example' do before :all do module Entities diff --git a/spec/support/model_parsers/mock_parser.rb b/spec/support/model_parsers/mock_parser.rb index eef0d6e7..4ddfb315 100644 --- a/spec/support/model_parsers/mock_parser.rb +++ b/spec/support/model_parsers/mock_parser.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.shared_context 'mock swagger example' do before :all do module Entities diff --git a/spec/support/model_parsers/representable_parser.rb b/spec/support/model_parsers/representable_parser.rb index a2e08498..6d266960 100644 --- a/spec/support/model_parsers/representable_parser.rb +++ b/spec/support/model_parsers/representable_parser.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'representable/json' RSpec.shared_context 'representable swagger example' do diff --git a/spec/support/namespace_tags.rb b/spec/support/namespace_tags.rb index 139273db..a48bdc01 100644 --- a/spec/support/namespace_tags.rb +++ b/spec/support/namespace_tags.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.shared_context 'namespace example' do before :all do module TheApi diff --git a/spec/support/the_paths_definitions.rb b/spec/support/the_paths_definitions.rb index 569c7f2f..670a703f 100644 --- a/spec/support/the_paths_definitions.rb +++ b/spec/support/the_paths_definitions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.shared_context 'the api paths/defs' do let(:paths) do { diff --git a/spec/swagger_v2/api_swagger_v2_body_definitions_spec.rb b/spec/swagger_v2/api_swagger_v2_body_definitions_spec.rb index a1ffe4b1..10fe5168 100644 --- a/spec/swagger_v2/api_swagger_v2_body_definitions_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_body_definitions_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'body parameter definitions' do diff --git a/spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb b/spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb index 6cd3583e..4d1d00ec 100644 --- a/spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'definitions/models' do diff --git a/spec/swagger_v2/api_swagger_v2_detail_spec.rb b/spec/swagger_v2/api_swagger_v2_detail_spec.rb index de076426..7eeb62ce 100644 --- a/spec/swagger_v2/api_swagger_v2_detail_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_detail_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require 'spec_helper' def details diff --git a/spec/swagger_v2/api_swagger_v2_extensions_spec.rb b/spec/swagger_v2/api_swagger_v2_extensions_spec.rb index e483ba5d..75b512c6 100644 --- a/spec/swagger_v2/api_swagger_v2_extensions_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_extensions_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'extensions' do diff --git a/spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb b/spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb index fc43ff32..4bc6c4b3 100644 --- a/spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'format, content_type' do diff --git a/spec/swagger_v2/api_swagger_v2_global_configuration_spec.rb b/spec/swagger_v2/api_swagger_v2_global_configuration_spec.rb index 7adc8544..59d667ac 100644 --- a/spec/swagger_v2/api_swagger_v2_global_configuration_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_global_configuration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'global configuration stuff' do diff --git a/spec/swagger_v2/api_swagger_v2_hash_and_array_spec.rb b/spec/swagger_v2/api_swagger_v2_hash_and_array_spec.rb index c58eb885..bf7d20db 100644 --- a/spec/swagger_v2/api_swagger_v2_hash_and_array_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_hash_and_array_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'document hash and array' do diff --git a/spec/swagger_v2/api_swagger_v2_headers_spec.rb b/spec/swagger_v2/api_swagger_v2_headers_spec.rb index 4bd9b45e..a5b22e11 100644 --- a/spec/swagger_v2/api_swagger_v2_headers_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_headers_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'headers' do diff --git a/spec/swagger_v2/api_swagger_v2_hide_documentation_path_spec.rb b/spec/swagger_v2/api_swagger_v2_hide_documentation_path_spec.rb index 4714303b..389c40ab 100644 --- a/spec/swagger_v2/api_swagger_v2_hide_documentation_path_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_hide_documentation_path_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'hide documentation path' do diff --git a/spec/swagger_v2/api_swagger_v2_hide_param_spec.rb b/spec/swagger_v2/api_swagger_v2_hide_param_spec.rb index b30a6f36..3d3497f7 100644 --- a/spec/swagger_v2/api_swagger_v2_hide_param_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_hide_param_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'hidden flag enables a single endpoint parameter to be excluded from the documentation' do diff --git a/spec/swagger_v2/api_swagger_v2_ignore_defaults_spec.rb b/spec/swagger_v2/api_swagger_v2_ignore_defaults_spec.rb index 96a75ba2..8b87e825 100644 --- a/spec/swagger_v2/api_swagger_v2_ignore_defaults_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_ignore_defaults_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'swagger spec v2.0' do diff --git a/spec/swagger_v2/api_swagger_v2_mounted_spec.rb b/spec/swagger_v2/api_swagger_v2_mounted_spec.rb index cebedad4..c58dfd84 100644 --- a/spec/swagger_v2/api_swagger_v2_mounted_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_mounted_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'swagger spec v2.0' do diff --git a/spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb b/spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb index f988a7d8..3dc178a3 100644 --- a/spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'moving body/formData Params to definitions' do diff --git a/spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb b/spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb index 4197364c..13c14d14 100644 --- a/spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `header`' do diff --git a/spec/swagger_v2/api_swagger_v2_param_type_spec.rb b/spec/swagger_v2/api_swagger_v2_param_type_spec.rb index d73a5cd3..95c04fdd 100644 --- a/spec/swagger_v2/api_swagger_v2_param_type_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_param_type_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `header`' do diff --git a/spec/swagger_v2/api_swagger_v2_request_params_fix_spec.rb b/spec/swagger_v2/api_swagger_v2_request_params_fix_spec.rb index 0a498f14..8a9b1ae8 100644 --- a/spec/swagger_v2/api_swagger_v2_request_params_fix_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_request_params_fix_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'additional parameter settings' do diff --git a/spec/swagger_v2/api_swagger_v2_response_spec.rb b/spec/swagger_v2/api_swagger_v2_response_spec.rb index e5fe0355..258cb617 100644 --- a/spec/swagger_v2/api_swagger_v2_response_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_response_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'response' do diff --git a/spec/swagger_v2/api_swagger_v2_spec.rb b/spec/swagger_v2/api_swagger_v2_spec.rb index 3114c2ec..6ff95739 100644 --- a/spec/swagger_v2/api_swagger_v2_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'swagger spec v2.0' do diff --git a/spec/swagger_v2/api_swagger_v2_type-format_spec.rb b/spec/swagger_v2/api_swagger_v2_type-format_spec.rb index bcf79b5c..cfcd5851 100644 --- a/spec/swagger_v2/api_swagger_v2_type-format_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_type-format_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' # mapping of parameter types diff --git a/spec/swagger_v2/boolean_params_spec.rb b/spec/swagger_v2/boolean_params_spec.rb index db4774b2..6c705b70 100644 --- a/spec/swagger_v2/boolean_params_spec.rb +++ b/spec/swagger_v2/boolean_params_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'Boolean Params' do diff --git a/spec/swagger_v2/default_api_spec.rb b/spec/swagger_v2/default_api_spec.rb index 2e61bf0e..5f46e379 100644 --- a/spec/swagger_v2/default_api_spec.rb +++ b/spec/swagger_v2/default_api_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' # require 'grape_version' diff --git a/spec/swagger_v2/description_not_initialized.rb b/spec/swagger_v2/description_not_initialized.rb index 3f15d088..66fc1279 100644 --- a/spec/swagger_v2/description_not_initialized.rb +++ b/spec/swagger_v2/description_not_initialized.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'details' do diff --git a/spec/swagger_v2/endpoint_versioned_path_spec.rb b/spec/swagger_v2/endpoint_versioned_path_spec.rb index 97061b90..e3854522 100644 --- a/spec/swagger_v2/endpoint_versioned_path_spec.rb +++ b/spec/swagger_v2/endpoint_versioned_path_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'Grape::Endpoint#path_and_definitions' do diff --git a/spec/swagger_v2/errors_spec.rb b/spec/swagger_v2/errors_spec.rb index 8588018e..b11ab548 100644 --- a/spec/swagger_v2/errors_spec.rb +++ b/spec/swagger_v2/errors_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'Errors' do diff --git a/spec/swagger_v2/float_api_spec.rb b/spec/swagger_v2/float_api_spec.rb index 265d3b1f..9119d7da 100644 --- a/spec/swagger_v2/float_api_spec.rb +++ b/spec/swagger_v2/float_api_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'Float Params' do diff --git a/spec/swagger_v2/form_params_spec.rb b/spec/swagger_v2/form_params_spec.rb index 66d8ccc4..226dc427 100644 --- a/spec/swagger_v2/form_params_spec.rb +++ b/spec/swagger_v2/form_params_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'Form Params' do diff --git a/spec/swagger_v2/grape-swagger_spec.rb b/spec/swagger_v2/grape-swagger_spec.rb index 20cfcea1..8578ddd5 100644 --- a/spec/swagger_v2/grape-swagger_spec.rb +++ b/spec/swagger_v2/grape-swagger_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe Grape::API do diff --git a/spec/swagger_v2/hide_api_spec.rb b/spec/swagger_v2/hide_api_spec.rb index 6757cc19..03f99ed3 100644 --- a/spec/swagger_v2/hide_api_spec.rb +++ b/spec/swagger_v2/hide_api_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'a hide mounted api' do diff --git a/spec/swagger_v2/host.rb b/spec/swagger_v2/host.rb index 7e97d225..b944cfff 100644 --- a/spec/swagger_v2/host.rb +++ b/spec/swagger_v2/host.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'host in the swagger_doc' do diff --git a/spec/swagger_v2/mounted_target_class_spec.rb b/spec/swagger_v2/mounted_target_class_spec.rb index 8ea22af3..a6717242 100644 --- a/spec/swagger_v2/mounted_target_class_spec.rb +++ b/spec/swagger_v2/mounted_target_class_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'docs mounted separately from api' do diff --git a/spec/swagger_v2/namespace_tags_prefix_spec.rb b/spec/swagger_v2/namespace_tags_prefix_spec.rb index 1c3ea687..de4475e9 100644 --- a/spec/swagger_v2/namespace_tags_prefix_spec.rb +++ b/spec/swagger_v2/namespace_tags_prefix_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'namespace tags check while using prefix and version' do diff --git a/spec/swagger_v2/namespace_tags_spec.rb b/spec/swagger_v2/namespace_tags_spec.rb index fcede2df..97a29b1f 100644 --- a/spec/swagger_v2/namespace_tags_spec.rb +++ b/spec/swagger_v2/namespace_tags_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'namespace tags check' do diff --git a/spec/swagger_v2/namespaced_api_spec.rb b/spec/swagger_v2/namespaced_api_spec.rb index 3297a9ec..d93b9598 100644 --- a/spec/swagger_v2/namespaced_api_spec.rb +++ b/spec/swagger_v2/namespaced_api_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'namespace' do diff --git a/spec/swagger_v2/nicknamed_api_spec.rb b/spec/swagger_v2/nicknamed_api_spec.rb index f46185a9..13bba9c3 100644 --- a/spec/swagger_v2/nicknamed_api_spec.rb +++ b/spec/swagger_v2/nicknamed_api_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'a nicknamed mounted api' do diff --git a/spec/swagger_v2/param_multi_type_spec.rb b/spec/swagger_v2/param_multi_type_spec.rb index 9d2573af..6f2e6407 100644 --- a/spec/swagger_v2/param_multi_type_spec.rb +++ b/spec/swagger_v2/param_multi_type_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'Params Multi Types' do diff --git a/spec/swagger_v2/param_type_spec.rb b/spec/swagger_v2/param_type_spec.rb index 2cf5e7cd..0c9fb97a 100644 --- a/spec/swagger_v2/param_type_spec.rb +++ b/spec/swagger_v2/param_type_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'Params Types' do diff --git a/spec/swagger_v2/param_values_spec.rb b/spec/swagger_v2/param_values_spec.rb index aec525d5..b8c122a5 100644 --- a/spec/swagger_v2/param_values_spec.rb +++ b/spec/swagger_v2/param_values_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' # require 'grape_version' diff --git a/spec/swagger_v2/params_array_collection_fromat_spec.rb b/spec/swagger_v2/params_array_collection_fromat_spec.rb index 7b327c37..73f4f935 100644 --- a/spec/swagger_v2/params_array_collection_fromat_spec.rb +++ b/spec/swagger_v2/params_array_collection_fromat_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'Group Array Params, using collection format' do diff --git a/spec/swagger_v2/params_array_spec.rb b/spec/swagger_v2/params_array_spec.rb index b8a1b884..55d939d6 100644 --- a/spec/swagger_v2/params_array_spec.rb +++ b/spec/swagger_v2/params_array_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'Group Params as Array' do diff --git a/spec/swagger_v2/params_hash_spec.rb b/spec/swagger_v2/params_hash_spec.rb index 49bc7e63..0703a6c8 100644 --- a/spec/swagger_v2/params_hash_spec.rb +++ b/spec/swagger_v2/params_hash_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'Group Params as Hash' do diff --git a/spec/swagger_v2/params_nested_spec.rb b/spec/swagger_v2/params_nested_spec.rb index f0a15e8d..0d9dc9ef 100644 --- a/spec/swagger_v2/params_nested_spec.rb +++ b/spec/swagger_v2/params_nested_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'nested group params' do diff --git a/spec/swagger_v2/reference_entity.rb b/spec/swagger_v2/reference_entity.rb index 1f00e675..4033fed7 100644 --- a/spec/swagger_v2/reference_entity.rb +++ b/spec/swagger_v2/reference_entity.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'referenceEntity' do diff --git a/spec/swagger_v2/security_requirement_spec.rb b/spec/swagger_v2/security_requirement_spec.rb index 7a1f5ad8..ad94ebe9 100644 --- a/spec/swagger_v2/security_requirement_spec.rb +++ b/spec/swagger_v2/security_requirement_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'security requirement on endpoint method' do diff --git a/spec/swagger_v2/simple_mounted_api_spec.rb b/spec/swagger_v2/simple_mounted_api_spec.rb index 3430bc12..a6722900 100644 --- a/spec/swagger_v2/simple_mounted_api_spec.rb +++ b/spec/swagger_v2/simple_mounted_api_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe 'a simple mounted api' do diff --git a/spec/version_spec.rb b/spec/version_spec.rb index 446f2412..72d2cc18 100644 --- a/spec/version_spec.rb +++ b/spec/version_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'spec_helper' describe GrapeSwagger do