grape-swagger-entity 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: 09004935e0da7b2d424d04a85feb7d0b7e4f5665
4
- data.tar.gz: 13531135fa1fd80e04a9f0677bbf95cd9034e4aa
3
+ metadata.gz: 09decfdceca7643d9cf6df2f34843a5643d62a56
4
+ data.tar.gz: ab8bbcc2c2d29802747f35848165abcf85407a4d
5
5
  SHA512:
6
- metadata.gz: e605ba8293b54f14ca786afe7c2c5f5e478042889c37aee3e2dd98e61f8149e4e5f3b1545a6d7d373542f679f4e8fbdbae48511de6b1a8465508b9c1c9ecfbec
7
- data.tar.gz: 49da1141e3a3b413b893db0c0f4d1755e3a6dd516d05ffea0f367388f5cfba7130d103c8cfe349273c98f577a6302ef80e9b46b56cd76486c471184374a5ec94
6
+ metadata.gz: 5eeada88bb46cdc9b84157c0bc75b207f6f05f99fc9378c8c73a8d03d08ac83192a91d3cefab8a996d60ffb57e3b5ac51d1caee25c8692b845d9068616da9de1
7
+ data.tar.gz: 6847991544fa81362e9deab7df204f38059fb49dca0f72a84ff94d6179d2f9ce7416262b138f30bc1fce0b3cb2e74439a5ed4f8da88cbafc5a58e328be4a7592
data/.travis.yml CHANGED
@@ -5,13 +5,26 @@ cache: bundler
5
5
  matrix:
6
6
  include:
7
7
  - rvm: 2.3.0
8
+ script:
9
+ - bundle exec danger
10
+ - rvm: 2.3.0
11
+ env:
12
+ - GRAPE_ENTITY="~> 0.4.0"
13
+ - rvm: 2.3.0
14
+ env:
15
+ - GRAPE_ENTITY="~> 0.5.0"
16
+ - rvm: 2.3.0
17
+ env:
18
+ - GRAPE_ENTITY="~> 0.6.0"
8
19
  - rvm: 2.2
9
20
  - rvm: 2.1
21
+ - rvm: jruby-9.1.2.0
10
22
  - rvm: ruby-head
11
23
  - rvm: jruby-head
12
- - rvm: jruby-19mode
13
24
  - rvm: rbx-2
14
25
  allow_failures:
15
26
  - rvm: ruby-head
16
27
  - rvm: jruby-head
28
+ - rvm: rbx-2
29
+
17
30
  before_install: gem install bundler -v 1.12.1
data/CHANGELOG.md CHANGED
@@ -8,8 +8,20 @@
8
8
 
9
9
  * Your contribution here.
10
10
 
11
+ ### 0.1.5 (November 21, 2016)
12
+
13
+ #### Features
14
+
15
+ * [#11](https://github.com/ruby-grape/grape-swagger-entity/pull/11): Use an automated PR linter, [danger.systems](http://danger.systems) - [@Bugagazavr](https://github.com/Bugagazavr).
16
+ * [#12](https://github.com/ruby-grape/grape-swagger-entity/pull/12): Allow parsing Entity with no endpoint - [@lordnibbler](https://github.com/lordnibbler).
17
+
18
+ #### Fixes
19
+
20
+ * [#8](https://github.com/ruby-grape/grape-swagger-entity/pull/8): Generate enum property if values key is passed in documentation - [@lordnibbler](https://github.com/lordnibbler).
21
+ * [#15](https://github.com/ruby-grape/grape-swagger-entity/pull/15): Support grape entity 0.6.x and later - [@Bugagazavr](https://github.com/Bugagazavr).
22
+
11
23
  ### 0.1.4 (June 7, 2016)
12
24
 
13
25
  #### Fixes
14
26
 
15
- * [#7](https://github.com/ruby-grape/grape-swagger-entity/pull/7) Fixed array support for primitive types - [@Bugagazavr](https://github.com/Bugagazavr).
27
+ * [#7](https://github.com/ruby-grape/grape-swagger-entity/pull/7): Fixed array support for primitive types - [@Bugagazavr](https://github.com/Bugagazavr).
data/Dangerfile ADDED
@@ -0,0 +1 @@
1
+ danger.import_dangerfile(gem: 'ruby-grape-danger')
data/Gemfile CHANGED
@@ -3,4 +3,11 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in grape-swagger-entity.gemspec
4
4
  gemspec
5
5
 
6
+ gem 'grape-entity', ENV.fetch('GRAPE_ENTITY', '0.5.0')
6
7
  gem 'grape-swagger', github: 'ruby-grape/grape-swagger'
8
+ gem 'ruby-grape-danger', '~> 0.1.0', require: false
9
+
10
+ if RUBY_VERSION < '2.2.2'
11
+ gem 'rack', '<2.0.0'
12
+ gem 'activesupport', '<5.0.0'
13
+ end
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.email = ['kirik910@gmail.com']
11
11
 
12
12
  s.summary = 'Grape swagger adapter to support grape-entity object parsing'
13
- s.homepage = 'https://github.com/Bugagazavr/grape-swagger-entity'
13
+ s.homepage = 'https://github.com/ruby-grape/grape-swagger-entity'
14
14
  s.license = 'MIT'
15
15
 
16
16
  s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_development_dependency 'rspec', '~> 3.0'
27
27
  s.add_development_dependency 'rack-test'
28
28
  s.add_development_dependency 'rack-cors'
29
- s.add_development_dependency 'rubocop'
29
+ s.add_development_dependency 'rubocop', '0.40.0'
30
30
  s.add_development_dependency 'redcarpet' unless RUBY_PLATFORM.eql?('java') || RUBY_ENGINE.eql?('rbx')
31
31
  s.add_development_dependency 'rouge' unless RUBY_PLATFORM.eql?('java') || RUBY_ENGINE.eql?('rbx')
32
32
  s.add_development_dependency 'pry' unless RUBY_PLATFORM.eql?('java') || RUBY_ENGINE.eql?('rbx')
@@ -13,7 +13,7 @@ module GrapeSwagger
13
13
  # TODO: this should only be a temporary hack ;)
14
14
  if ::GrapeEntity::VERSION =~ /0\.4\.\d/
15
15
  parameters = model.exposures ? model.exposures : model.documentation
16
- elsif ::GrapeEntity::VERSION =~ /0\.5\.\d/
16
+ else
17
17
  parameters = model.root_exposures.each_with_object({}) do |value, memo|
18
18
  memo[value.attribute] = value.send(:options)
19
19
  end
@@ -38,7 +38,7 @@ module GrapeSwagger
38
38
  end
39
39
 
40
40
  if model
41
- name = endpoint.send(:expose_params_from_model, model)
41
+ name = endpoint.nil? ? model.to_s.demodulize : endpoint.send(:expose_params_from_model, model)
42
42
  memo[entity_name] = entity_model_type(name, entity_options)
43
43
  else
44
44
  documented_type = entity_options[:type]
@@ -62,8 +62,9 @@ module GrapeSwagger
62
62
  }
63
63
  end
64
64
 
65
- if entity_options[:values] && entity_options[:values].is_a?(Array)
66
- memo[entity_name][:enum] = entity_options[:values]
65
+ if entity_options[:documentation] && entity_options[:documentation][:values]
66
+ values = entity_options[:documentation][:values]
67
+ memo[entity_name][:enum] = values if values.is_a?(Array)
67
68
  end
68
69
 
69
70
  if entity_options[:documentation] && entity_options[:documentation][:is_array]
@@ -1,5 +1,5 @@
1
1
  module GrapeSwagger
2
2
  module Entity
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-entity
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: 2016-06-07 00:00:00.000000000 Z
11
+ date: 2016-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape-swagger
@@ -112,16 +112,16 @@ dependencies:
112
112
  name: rubocop
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: 0.40.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: 0.40.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: redcarpet
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -191,6 +191,7 @@ files:
191
191
  - ".rubocop_todo.yml"
192
192
  - ".travis.yml"
193
193
  - CHANGELOG.md
194
+ - Dangerfile
194
195
  - Gemfile
195
196
  - LICENSE.txt
196
197
  - README.md
@@ -202,7 +203,7 @@ files:
202
203
  - lib/grape-swagger/entity.rb
203
204
  - lib/grape-swagger/entity/parser.rb
204
205
  - lib/grape-swagger/entity/version.rb
205
- homepage: https://github.com/Bugagazavr/grape-swagger-entity
206
+ homepage: https://github.com/ruby-grape/grape-swagger-entity
206
207
  licenses:
207
208
  - MIT
208
209
  metadata: {}