grape-swagger-representable 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7283878859bdf4efc4eaf2a05f148a00d96359f
4
- data.tar.gz: ce3cc382572534160da8b25c31576f2a71ed25e9
3
+ metadata.gz: 600b0f897d9ce5f916831596c72a07bdd954db6f
4
+ data.tar.gz: ac63015e4f7d8ee4399a35fa076a3bc31d316caf
5
5
  SHA512:
6
- metadata.gz: a2c0676215a1460294fd72349fc0f169c37723b402998a44f61c7cc7fe1312fe2ff850e0138cd5547627ecccd0b342d2ee15455ad057b6f17cf23bb41df9d7b1
7
- data.tar.gz: c07328b18c497f3ecef7d4aeef82e08444cb4568d63c99e31453f395f303560a69bd640424889a29899890c48662af0abbb2e9c7cc3fc46108ca73d3b9cfac02
6
+ metadata.gz: 4d9d68f28b121a4e3621583a08875ba9b5e7c8046acbdd03641bbe3a311b672b510f9f7bc39c7b4cba444bc3b8ccd293678ee152da70105bc8933d81ed5ad495
7
+ data.tar.gz: 321f51fa4b473ad134b963703ff69f7366722da67d12e0edee558de12e4f7ea93632995ecf0642b05f4f13efd5f1c6122e0663e68828505f57ec7b1a39edfaf9
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2016-05-11 07:25:12 +0300 using RuboCop version 0.39.0.
3
+ # on 2017-11-19 22:40:01 +0200 using RuboCop version 0.51.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -8,26 +8,43 @@
8
8
 
9
9
  # Offense count: 2
10
10
  Metrics/AbcSize:
11
- Max: 30
11
+ Max: 34
12
+
13
+ # Offense count: 8
14
+ # Configuration parameters: CountComments, ExcludedMethods.
15
+ Metrics/BlockLength:
16
+ Max: 132
12
17
 
13
18
  # Offense count: 2
14
19
  Metrics/CyclomaticComplexity:
15
- Max: 11
20
+ Max: 15
16
21
 
17
- # Offense count: 65
18
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
22
+ # Offense count: 67
23
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
19
24
  # URISchemes: http, https
20
25
  Metrics/LineLength:
21
- Max: 152
26
+ Max: 160
22
27
 
23
28
  # Offense count: 2
24
29
  # Configuration parameters: CountComments.
25
30
  Metrics/MethodLength:
26
31
  Max: 36
27
32
 
33
+ # Offense count: 1
34
+ # Configuration parameters: CountKeywordArgs.
35
+ Metrics/ParameterLists:
36
+ Max: 6
37
+
28
38
  # Offense count: 2
29
39
  Metrics/PerceivedComplexity:
30
- Max: 14
40
+ Max: 18
41
+
42
+ # Offense count: 1
43
+ # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
44
+ # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
45
+ Naming/FileName:
46
+ Exclude:
47
+ - 'lib/grape-swagger-representable.rb'
31
48
 
32
49
  # Offense count: 2
33
50
  Style/Documentation:
@@ -36,9 +53,3 @@ Style/Documentation:
36
53
  - 'test/**/*'
37
54
  - 'lib/grape-swagger/representable.rb'
38
55
  - 'lib/grape-swagger/representable/parser.rb'
39
-
40
- # Offense count: 1
41
- # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts.
42
- Style/FileName:
43
- Exclude:
44
- - 'lib/grape-swagger-representable.rb'
data/.travis.yml CHANGED
@@ -1,21 +1,30 @@
1
+ language: ruby
2
+
3
+ sudo: false
4
+
1
5
  before_install:
2
6
  - gem update --system
3
7
  - gem install bundler
4
8
 
5
9
  rvm:
6
- - 2.4.0
7
- - 2.3.3
8
- - 2.2.6
10
+ - 2.4.2
11
+ - 2.3.5
9
12
 
10
13
  matrix:
11
14
  fast_finish: true
12
15
 
13
16
  include:
17
+ - rvm: 2.2.8
18
+ env:
14
19
  - rvm: ruby-head
20
+ env:
15
21
  - rvm: jruby-head
22
+ env:
16
23
  - rvm: rbx-2
24
+ env:
17
25
 
18
26
  allow_failures:
27
+ - rvm: 2.2.8
19
28
  - rvm: ruby-head
20
29
  - rvm: jruby-head
21
30
  - rvm: rbx-2
@@ -1,4 +1,4 @@
1
- # coding: utf-8
1
+
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'grape-swagger/representable/version'
@@ -22,13 +22,14 @@ Gem::Specification.new do |s|
22
22
  s.add_runtime_dependency 'representable'
23
23
 
24
24
  s.add_development_dependency 'bundler', '~> 1.12'
25
- s.add_development_dependency 'rake', '~> 10.0'
26
- s.add_development_dependency 'rspec', '~> 3.0'
27
- s.add_development_dependency 'rack-test'
25
+ s.add_development_dependency 'multi_json'
26
+ s.add_development_dependency 'pry' unless RUBY_PLATFORM.eql?('java') || RUBY_ENGINE.eql?('rbx')
27
+ s.add_development_dependency 'pry-byebug' unless RUBY_PLATFORM.eql?('java') || RUBY_ENGINE.eql?('rbx')
28
28
  s.add_development_dependency 'rack-cors'
29
- s.add_development_dependency 'rubocop'
29
+ s.add_development_dependency 'rack-test'
30
+ s.add_development_dependency 'rake', '~> 10.0'
30
31
  s.add_development_dependency 'redcarpet' unless RUBY_PLATFORM.eql?('java') || RUBY_ENGINE.eql?('rbx')
31
32
  s.add_development_dependency 'rouge' unless RUBY_PLATFORM.eql?('java') || RUBY_ENGINE.eql?('rbx')
32
- s.add_development_dependency 'pry' unless RUBY_PLATFORM.eql?('java') || RUBY_ENGINE.eql?('rbx')
33
- s.add_development_dependency 'pry-byebug' unless RUBY_PLATFORM.eql?('java') || RUBY_ENGINE.eql?('rbx')
33
+ s.add_development_dependency 'rspec', '~> 3.0'
34
+ s.add_development_dependency 'rubocop'
34
35
  end
@@ -42,6 +42,9 @@ module GrapeSwagger
42
42
  values = documentation[:values] || property[:values] || nil
43
43
  memo[:enum] = values if values.is_a?(Array)
44
44
 
45
+ example = documentation[:example] || property[:example] || nil
46
+ memo[:example] = example.is_a?(Proc) ? example.call : example if example
47
+
45
48
  if is_a_collection || documentation[:is_array]
46
49
  memo = {
47
50
  type: :array,
@@ -1,5 +1,5 @@
1
1
  module GrapeSwagger
2
2
  module Representable
3
- VERSION = '0.1.4'.freeze
3
+ VERSION = '0.1.5'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-swagger-representable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Zaitsev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-10 00:00:00.000000000 Z
11
+ date: 2017-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape-swagger
@@ -53,35 +53,35 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.12'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rake
56
+ name: multi_json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rspec
70
+ name: pry
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '3.0'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '3.0'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rack-test
84
+ name: pry-byebug
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: rubocop
112
+ name: rack-test
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rake
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '10.0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '10.0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: redcarpet
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -151,21 +165,21 @@ dependencies:
151
165
  - !ruby/object:Gem::Version
152
166
  version: '0'
153
167
  - !ruby/object:Gem::Dependency
154
- name: pry
168
+ name: rspec
155
169
  requirement: !ruby/object:Gem::Requirement
156
170
  requirements:
157
- - - ">="
171
+ - - "~>"
158
172
  - !ruby/object:Gem::Version
159
- version: '0'
173
+ version: '3.0'
160
174
  type: :development
161
175
  prerelease: false
162
176
  version_requirements: !ruby/object:Gem::Requirement
163
177
  requirements:
164
- - - ">="
178
+ - - "~>"
165
179
  - !ruby/object:Gem::Version
166
- version: '0'
180
+ version: '3.0'
167
181
  - !ruby/object:Gem::Dependency
168
- name: pry-byebug
182
+ name: rubocop
169
183
  requirement: !ruby/object:Gem::Requirement
170
184
  requirements:
171
185
  - - ">="
@@ -221,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
235
  version: '0'
222
236
  requirements: []
223
237
  rubyforge_project:
224
- rubygems_version: 2.5.1
238
+ rubygems_version: 2.5.2
225
239
  signing_key:
226
240
  specification_version: 4
227
241
  summary: Grape swagger adapter to support representable object parsing