Skip to content

Commit ff5b610

Browse files
authored
Points to grape-swagger-entity fix. (#799)
- allows grape head to fails ... for the moment
1 parent 71612be commit ff5b610

File tree

5 files changed

+36
-4
lines changed

5 files changed

+36
-4
lines changed

.rubocop.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ AllCops:
1111
Layout/EmptyLinesAroundArguments:
1212
Enabled: false
1313

14+
Layout/EmptyLinesAroundAttributeAccessor:
15+
Enabled: true
16+
1417
Layout/FirstHashElementIndentation:
1518
EnforcedStyle: consistent
1619

@@ -24,6 +27,12 @@ Layout/SpaceAroundMethodCallOperator:
2427

2528
# Lint stuff
2629
#
30+
Lint/DeprecatedOpenSSLConstant:
31+
Enabled: true
32+
33+
Lint/MixedRegexpCaptureTypes:
34+
Enabled: true
35+
2736
Lint/RaiseException:
2837
Enabled: true
2938

@@ -39,6 +48,9 @@ Metrics/BlockLength:
3948
Metrics/ClassLength:
4049
Max: 300
4150

51+
Metrics/CyclomaticComplexity:
52+
Max: 17
53+
4254
Metrics/MethodLength:
4355
Exclude:
4456
- spec/**/*
@@ -64,3 +76,15 @@ Style/HashTransformValues:
6476

6577
Style/RegexpLiteral:
6678
Enabled: false
79+
80+
Style/RedundantFetchBlock:
81+
Enabled: true
82+
83+
Style/RedundantRegexpCharacterClass:
84+
Enabled: true
85+
86+
Style/RedundantRegexpEscape:
87+
Enabled: true
88+
89+
Style/SlicingWithRange:
90+
Enabled: false

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ jobs:
3333
- rvm: 2.4.10
3434
- rvm: ruby-head
3535
- rvm: jruby-head
36+
37+
- env: GRAPE_VERSION=HEAD

Gemfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ gem 'grape', case version = ENV['GRAPE_VERSION'] || '>= 1.3.0'
1414
end
1515

1616
gem ENV['MODEL_PARSER'] if ENV.key?('MODEL_PARSER')
17+
1718
group :development, :test do
1819
gem 'bundler'
1920
gem 'grape-entity'
@@ -26,12 +27,16 @@ group :development, :test do
2627
gem 'rake'
2728
gem 'rdoc'
2829
gem 'rspec', '~> 3.9'
29-
gem 'rubocop', '~> 0.82', require: false
30+
gem 'rubocop', '~> 0.85', require: false
3031
end
3132

3233
group :test do
3334
gem 'coveralls_reborn', require: false
34-
gem 'grape-swagger-entity'
35+
3536
gem 'ruby-grape-danger', '~> 0.1.1', require: false
3637
gem 'simplecov', require: false
38+
39+
unless ENV['MODEL_PARSER'] == 'grape-swagger-entity'
40+
gem 'grape-swagger-entity', git: 'https://github.com/ruby-grape/grape-swagger-entity'
41+
end
3742
end

lib/grape-swagger.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def route_path_start_with?(route, name)
109109
module SwaggerDocumentationAdder
110110
attr_accessor :combined_namespaces, :combined_namespace_identifiers
111111
attr_accessor :combined_routes, :combined_namespace_routes
112+
112113
include SwaggerRouting
113114

114115
def add_swagger_documentation(options = {})

lib/grape-swagger/doc_methods/operation_id.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def build(route, path = nil)
1616

1717
def manipulate(path)
1818
operation = path.split('/').map(&:capitalize).join
19-
operation.gsub!(/\-(\w)/, &:upcase).delete!('-') if operation[/\-(\w)/]
20-
operation.gsub!(/\_(\w)/, &:upcase).delete!('_') if operation.include?('_')
19+
operation.gsub!(/-(\w)/, &:upcase).delete!('-') if operation[/-(\w)/]
20+
operation.gsub!(/_(\w)/, &:upcase).delete!('_') if operation.include?('_')
2121
operation.gsub!(/\.(\w)/, &:upcase).delete!('.') if operation[/\.(\w)/]
2222
if path.include?('{')
2323
operation.gsub!(/\{(\w)/, &:upcase)

0 commit comments

Comments
 (0)