Skip to content

Commit 303e0a2

Browse files
authored
Merge pull request #52 from LeFnord/master
Fixes descriminator behaviour.
2 parents 7f290cd + 7548c30 commit 303e0a2

21 files changed

+103
-42
lines changed

.rubocop.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ AllCops:
22
Exclude:
33
- vendor/**/*
44
TargetRubyVersion:
5-
2.2
5+
2.7
66

77
inherit_from: .rubocop_todo.yml
88

@@ -21,5 +21,34 @@ Metrics/MethodLength:
2121
Naming/FileName:
2222
Enabled: false
2323

24-
Layout/IndentFirstHashElement:
24+
Layout/FirstHashElementIndentation:
2525
EnforcedStyle: consistent
26+
27+
Layout/EmptyLinesAroundAttributeAccessor:
28+
Enabled: true
29+
Layout/SpaceAroundMethodCallOperator:
30+
Enabled: true
31+
Lint/DeprecatedOpenSSLConstant:
32+
Enabled: true
33+
Lint/MixedRegexpCaptureTypes:
34+
Enabled: true
35+
Lint/RaiseException:
36+
Enabled: true
37+
Lint/StructNewOverride:
38+
Enabled: true
39+
Style/ExponentialNotation:
40+
Enabled: true
41+
Style/HashEachMethods:
42+
Enabled: true
43+
Style/HashTransformKeys:
44+
Enabled: true
45+
Style/HashTransformValues:
46+
Enabled: true
47+
Style/RedundantFetchBlock:
48+
Enabled: true
49+
Style/RedundantRegexpCharacterClass:
50+
Enabled: true
51+
Style/RedundantRegexpEscape:
52+
Enabled: true
53+
Style/SlicingWithRange:
54+
Enabled: true

.rubocop_todo.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,48 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2017-07-03 22:59:40 +0300 using RuboCop version 0.49.1.
3+
# on 2020-06-29 22:12:50 UTC using RuboCop version 0.86.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 2
10-
Metrics/AbcSize:
11-
Max: 40
12-
139
# Offense count: 1
14-
# Configuration parameters: CountComments, ExcludedMethods.
15-
Metrics/BlockLength:
16-
Max: 27
10+
# Configuration parameters: Include.
11+
# Include: **/*.gemspec
12+
Gemspec/RequiredRubyVersion:
13+
Exclude:
14+
- 'grape-swagger-entity.gemspec'
15+
16+
# Offense count: 4
17+
# Configuration parameters: IgnoredMethods.
18+
Metrics/AbcSize:
19+
Max: 30
1720

1821
# Offense count: 1
1922
# Configuration parameters: CountComments.
2023
Metrics/ClassLength:
21-
Max: 124
24+
Max: 111
2225

23-
# Offense count: 1
26+
# Offense count: 2
27+
# Configuration parameters: IgnoredMethods.
2428
Metrics/CyclomaticComplexity:
25-
Max: 15
26-
27-
# Offense count: 14
28-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
29-
# URISchemes: http, https
30-
Metrics/LineLength:
31-
Max: 120
29+
Max: 11
3230

33-
# Offense count: 3
34-
# Configuration parameters: CountComments.
31+
# Offense count: 5
32+
# Configuration parameters: CountComments, ExcludedMethods.
3533
Metrics/MethodLength:
36-
Max: 30
34+
Max: 25
3735

3836
# Offense count: 2
37+
# Configuration parameters: IgnoredMethods.
3938
Metrics/PerceivedComplexity:
40-
Max: 16
39+
Max: 12
4140

42-
# Offense count: 2
41+
# Offense count: 4
4342
Style/Documentation:
4443
Exclude:
4544
- 'spec/**/*'
4645
- 'test/**/*'
4746
- 'lib/grape-swagger/entity.rb'
48-
- 'lib/grape-swagger/entity/parser.rb'
4947
- 'lib/grape-swagger/entity/attribute_parser.rb'
48+
- 'lib/grape-swagger/entity/parser.rb'

.travis.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,27 @@ after_success:
1010
- bundle exec danger
1111

1212
rvm:
13-
- 2.4.5
14-
- 2.5.3
15-
- 2.6.0
13+
- 2.5.8
14+
- 2.6.6
15+
- 2.7.1
1616

1717
env:
1818
- GRAPE_ENTITY=0.6.1
1919
- GRAPE_ENTITY=0.7.1
20+
- GRAPE_ENTITY=0.8.0
2021

2122
matrix:
2223
fast_finish: true
2324

2425
include:
25-
- rvm: 2.3.8
26+
- rvm: 2.4.10
2627
env:
2728
- rvm: ruby-head
2829
env:
2930
- rvm: jruby-head
3031
env:
31-
- rvm: rbx-2
32-
env:
3332

3433
allow_failures:
35-
- rvm: 2.3.8
34+
- rvm: 2.4.10
3635
- rvm: ruby-head
3736
- rvm: jruby-head
38-
- rvm: rbx-2

Dangerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# frozen_string_literal: true
2+
13
danger.import_dangerfile(gem: 'ruby-grape-danger')

Gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24

35
# Specify your gem's dependencies in grape-swagger-entity.gemspec
@@ -12,8 +14,8 @@ group :development, :test do
1214
gem 'rack-test'
1315
gem 'rake'
1416
gem 'rdoc'
15-
gem 'rspec', '~> 3.0'
16-
gem 'rubocop', '~> 0.68.1'
17+
gem 'rspec', '~> 3.9'
18+
gem 'rubocop', '~> 0.85'
1719
end
1820

1921
gem 'grape-swagger', git: 'https://github.com/ruby-grape/grape-swagger.git'

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'rubygems'
24
require 'bundler'
35

bin/pry

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

34
require 'bundler/setup'
45
require 'grape-swagger/entity'

grape-swagger-entity.gemspec

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
lib = File.expand_path('lib', __dir__)
24
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
35
require 'grape-swagger/entity/version'
@@ -17,7 +19,7 @@ Gem::Specification.new do |s|
1719
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
1820
s.require_paths = ['lib']
1921

20-
s.required_ruby_version = '>= 2.2.6'
21-
s.add_runtime_dependency 'grape-entity', '>= 0.5.0'
22+
s.required_ruby_version = '>= 2.4'
23+
s.add_runtime_dependency 'grape-entity', '>= 0.6.0'
2224
s.add_runtime_dependency 'grape-swagger', '>= 1.0.0'
2325
end

lib/grape-swagger-entity.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# frozen_string_literal: true
2+
13
require 'grape-swagger/entity'

lib/grape-swagger/entity.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'grape-swagger'
24
require 'grape-entity'
35

0 commit comments

Comments
 (0)