Skip to content

Commit

Permalink
support ruby 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
LeFnord committed Dec 18, 2016
1 parent bf55513 commit 6534b6c
Show file tree
Hide file tree
Showing 95 changed files with 103 additions and 18 deletions.
1 change: 0 additions & 1 deletion .ruby-gemset

This file was deleted.

21 changes: 6 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
source 'http://rubygems.org'

ruby RUBY_VERSION
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

<a name="swagger-spec" />
## Swagger-Spec
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

require 'rubygems'
require 'bundler'
Expand All @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion grape-swagger.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
require 'grape-swagger/version'

Expand All @@ -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")
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'grape'

require 'grape-swagger/grape/route'
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/doc_methods.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'grape-swagger/doc_methods/status_codes'

require 'grape-swagger/doc_methods/produces_consumes'
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/doc_methods/build_model_definition.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class BuildModelDefinition
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/doc_methods/data_type.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class DataType
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/doc_methods/extensions.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class Extensions
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/doc_methods/headers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class Headers
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/doc_methods/move_params.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class MoveParams
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/doc_methods/operation_id.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class OperationId
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/doc_methods/optional_object.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class OptionalObject
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/doc_methods/parse_params.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class ParseParams
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/doc_methods/path_string.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class PathString
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/doc_methods/produces_consumes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class ProducesConsumes
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/doc_methods/status_codes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class StatusCodes
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/doc_methods/tag_name_description.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
module DocMethods
class TagNameDescription
Expand Down
2 changes: 1 addition & 1 deletion lib/grape-swagger/endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/errors.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
module Errors
class MarkdownDependencyMissingError < StandardError
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/grape/route.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# backwards compatibility for Grape < 0.16.0
module Grape
class Route
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/markdown/kramdown_adapter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
class Markdown
class KramdownAdapter
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/markdown/redcarpet_adapter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
class Markdown
class RedcarpetAdapter
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/model_parsers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
class ModelParsers
include Enumerable
Expand Down
1 change: 1 addition & 0 deletions lib/grape-swagger/rake/oapi_tasks.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rake'
require 'rake/tasklib'
require 'rack/test'
Expand Down
1 change: 1 addition & 0 deletions spec/issues/403_versions_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
require 'spec_helper'

describe 'describing versions' do
Expand Down
1 change: 1 addition & 0 deletions spec/issues/430_entity_definitions_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'definition names' do
Expand Down
1 change: 1 addition & 0 deletions spec/lib/data_type_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe GrapeSwagger::DocMethods::DataType do
Expand Down
1 change: 1 addition & 0 deletions spec/lib/endpoint_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe Grape::Endpoint do
Expand Down
1 change: 1 addition & 0 deletions spec/lib/extensions_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe GrapeSwagger::DocMethods::Extensions do
Expand Down
1 change: 1 addition & 0 deletions spec/lib/model_parsers_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe GrapeSwagger::ModelParsers do
Expand Down
1 change: 1 addition & 0 deletions spec/lib/move_params_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe GrapeSwagger::DocMethods::MoveParams do
Expand Down
1 change: 1 addition & 0 deletions spec/lib/oapi_tasks_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

RSpec.describe GrapeSwagger::Rake::OapiTasks do
Expand Down
1 change: 1 addition & 0 deletions spec/lib/operation_id_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: false
require 'spec_helper'

describe GrapeSwagger::DocMethods::OperationId do
Expand Down
1 change: 1 addition & 0 deletions spec/lib/optional_object_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe GrapeSwagger::DocMethods::OptionalObject do
Expand Down
1 change: 1 addition & 0 deletions spec/lib/path_string_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: false
require 'spec_helper'

describe GrapeSwagger::DocMethods::PathString do
Expand Down
1 change: 1 addition & 0 deletions spec/lib/produces_consumes_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe GrapeSwagger::DocMethods::ProducesConsumes do
Expand Down
1 change: 1 addition & 0 deletions spec/markdown/kramdown_adapter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe GrapeSwagger::Markdown::KramdownAdapter do
Expand Down
1 change: 1 addition & 0 deletions spec/markdown/redcarpet_adapter_spec.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
1 change: 1 addition & 0 deletions spec/support/empty_model_parser.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class EmptyClass
end

Expand Down
1 change: 1 addition & 0 deletions spec/support/grape_version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class GrapeVersion
class << self
def current_version
Expand Down
1 change: 1 addition & 0 deletions spec/support/mock_parser.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module GrapeSwagger
class MockParser
attr_reader :model
Expand Down
1 change: 1 addition & 0 deletions spec/support/model_parsers/entity_parser.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
RSpec.shared_context 'entity swagger example' do
before :all do
module Entities
Expand Down
1 change: 1 addition & 0 deletions spec/support/model_parsers/mock_parser.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
RSpec.shared_context 'mock swagger example' do
before :all do
module Entities
Expand Down
1 change: 1 addition & 0 deletions spec/support/model_parsers/representable_parser.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'representable/json'

RSpec.shared_context 'representable swagger example' do
Expand Down
1 change: 1 addition & 0 deletions spec/support/namespace_tags.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
RSpec.shared_context 'namespace example' do
before :all do
module TheApi
Expand Down
1 change: 1 addition & 0 deletions spec/support/the_paths_definitions.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
RSpec.shared_context 'the api paths/defs' do
let(:paths) do
{
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_body_definitions_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'body parameter definitions' do
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'definitions/models' do
Expand Down
3 changes: 3 additions & 0 deletions spec/swagger_v2/api_swagger_v2_detail_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

require 'spec_helper'

def details
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_extensions_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'extensions' do
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'format, content_type' do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'global configuration stuff' do
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_hash_and_array_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'document hash and array' do
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_headers_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'headers' do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'hide documentation path' do
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_hide_param_spec.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_ignore_defaults_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'swagger spec v2.0' do
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_mounted_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'swagger spec v2.0' do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'moving body/formData Params to definitions' do
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `header`' do
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_param_type_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `header`' do
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_request_params_fix_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'additional parameter settings' do
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_response_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'response' do
Expand Down
1 change: 1 addition & 0 deletions spec/swagger_v2/api_swagger_v2_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'swagger spec v2.0' do
Expand Down
Loading

0 comments on commit 6534b6c

Please sign in to comment.