Skip to content

Commit

Permalink
Prepare next release
Browse files Browse the repository at this point in the history
- bump version
- updates travis matrix to newest ruby versions
- removes deprecation warnings of swagger-entity and -representable
  • Loading branch information
LeFnord committed Jan 3, 2020
1 parent 61e62d7 commit ef69543
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 34 deletions.
6 changes: 0 additions & 6 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ Gemspec/RequiredRubyVersion:
Exclude:
- 'grape-swagger.gemspec'

# Offense count: 1
# Cop supports --auto-correct.
Lint/UnneededCopEnableDirective:
Exclude:
- 'spec/lib/optional_object_spec.rb'

# Offense count: 30
Metrics/AbcSize:
Max: 59
Expand Down
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ after_success:
- bundle exec danger

rvm:
- 2.4.6
- 2.5.5
- 2.6.3
- 2.4.9
- 2.5.7
- 2.6.5
env:
- MODEL_PARSER=grape-swagger-entity
- MODEL_PARSER=grape-swagger-representable
Expand All @@ -21,14 +21,11 @@ matrix:
fast_finish: true

include:
- rvm: 2.3.8
env:
- rvm: ruby-head
env:
- rvm: jruby-head
env:

allow_failures:
- rvm: 2.3.8
- rvm: ruby-head
- rvm: jruby-head
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ group :development, :test do
gem 'rack-test'
gem 'rake'
gem 'rdoc'
gem 'rspec', '~> 3.8'
gem 'rubocop', '~> 0.71', require: false
gem 'rspec', '~> 3.9'
gem 'rubocop', '~> 0.75', require: false
end

group :test do
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ Also added support for [representable](https://github.com/apotonick/representabl

```ruby
# For Grape::Entity ( https://github.com/ruby-grape/grape-entity )
gem 'grape-swagger-entity'
gem 'grape-swagger-entity', '~> 0.3'
# For representable ( https://github.com/apotonick/representable )
gem 'grape-swagger-representable'
gem 'grape-swagger-representable', '~> 0.2'
```

If you are not using Rails, make sure to load the parser inside your application initialization logic, e.g., via `require 'grape-swagger/entity'` or `require 'grape-swagger/representable'`.
Expand Down
17 changes: 0 additions & 17 deletions lib/grape-swagger/doc_methods/build_model_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,10 @@ def required_attributes(model)

def parse_entity(model)
return unless model.respond_to?(:documentation)

deprecated_workflow_for('grape-swagger-entity')

model.documentation
.select { |_name, options| options[:required] }
.map { |name, options| options[:as] || name }
end

def parse_representable(model)
return unless model.respond_to?(:map)

deprecated_workflow_for('grape-swagger-representable')

model.map
.select { |p| p[:documentation] && p[:documentation][:required] }
.map(&:name)
end

def deprecated_workflow_for(gem_name)
warn "DEPRECATED: You are using old #{gem_name} version, which doesn't provide " \
"required attributes. To solve this problem, please update #{gem_name}"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/optional_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
let(:options) do
{ host: proc { |request| request.host =~ /^example/ ? '/api-example' : '/api' } }
end
# rubocop:enable RegexpMatch

specify do
expect(subject.build(key, options, request)).to eql '/api-example'
end
Expand Down

0 comments on commit ef69543

Please sign in to comment.