swagger-core 0.2.2 → 0.2.3

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: f3af93efcb0f85951fb9df1b336a6cda8734ff54
4
- data.tar.gz: 55e2097921aed8e3a23af1e5e6dc3d1c9b53399d
3
+ metadata.gz: 5aba9b5a68451390562512924f4c3d9c67ef8e88
4
+ data.tar.gz: e2861be404cf83fd74102030b6fd80015459d908
5
5
  SHA512:
6
- metadata.gz: d86f0c184cf88efc692b1201a0a61acb25bd1cbf29054572fdd2729c0e0b115fade5f13d1087f2e532bd344fda28da818a2f6b3db12543ca5ce6d449448fad0e
7
- data.tar.gz: 994786ab4d0b7bcd30024b0e29212c6e4bb47284e5b8e1ce4301edc567ea1209cfeefee9fad254159376b4e8e2bd9323f04833cba7bb3f34a805156f87959132
6
+ metadata.gz: 0a1b56875724d0abf2c28153988927db270dbcd412ed7b0ef63ae5c9775f42cced19068b16f35c3b60febb6d277a303ca43aad3227dd22ab83ab6990630e61ee
7
+ data.tar.gz: 704dc9cc3df5f300a1afb1f099afc73897d1bce5dbde8b77a8a1eae5ca0e0add0a02093882806a4355b2b17b3a58c3011501bcf7b6ee907f35d34bdaa81ec5a0
@@ -21,7 +21,7 @@ module Swagger
21
21
  def self.build(content, opts = {})
22
22
  parser ||= Swagger::Parsers.parser_for(opts[:format])
23
23
  content = parser.parse(content) unless parser.nil?
24
- Swagger::API.build(content)
24
+ Swagger::API.build_api(content)
25
25
  end
26
26
 
27
27
  # Load a Swagger document from a file.
@@ -1,7 +1,7 @@
1
1
  module Swagger
2
2
  # A common interface for building or loading Swagger documents of any version. See subclasses.
3
3
  class API < SwaggerObject
4
- def self.build(hash)
4
+ def self.build_api(hash)
5
5
  version = hash['swaggerVersion'] || hash['swagger']
6
6
  major, _minor = version.to_s.split('.')
7
7
  case major
@@ -15,15 +15,15 @@ module Swagger
15
15
  end
16
16
 
17
17
  # @api private
18
- def attach_to_children # rubocop:disable Metrics/MethodLength
19
- each_value do |v|
20
- if v.respond_to? :attach_parent
21
- v.attach_parent self
22
- elsif v.respond_to? :each_value
18
+ def attach_to_children
19
+ each_value do |v| # rubocop:disable Style/Next
20
+ v.attach_parent self if v.respond_to? :attach_parent
21
+ if v.respond_to? :each_value
23
22
  v.each_value do |sv|
24
23
  sv.attach_parent self if sv.respond_to? :attach_parent
25
24
  end
26
- elsif v.respond_to? :each
25
+ end
26
+ if v.respond_to? :each
27
27
  v.each do |sv|
28
28
  sv.attach_parent self if sv.respond_to? :attach_parent
29
29
  end
@@ -42,7 +42,7 @@ module Swagger
42
42
  end
43
43
 
44
44
  def default_response
45
- return nil if responses.values.nil?
45
+ return nil if responses.nil? || responses.values.nil?
46
46
 
47
47
  # FIXME: Swagger isn't very clear on "normal response codes"
48
48
  # In the examples, default is actually an error
@@ -1,3 +1,3 @@
1
1
  module Swagger
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
@@ -21,10 +21,10 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ['lib']
22
22
 
23
23
  spec.add_dependency 'addressable', '~> 2.3'
24
- spec.add_dependency 'hashie', '~> 3.0'
24
+ spec.add_dependency 'hashie', '~> 3.0', '< 3.4.0'
25
25
  spec.add_dependency 'json-schema', '~> 2.2'
26
26
  spec.add_dependency 'mime-types', '~> 2.0'
27
- spec.add_development_dependency 'bundler', '~> 1.6'
27
+ spec.add_development_dependency 'bundler', '~> 1.5'
28
28
  spec.add_development_dependency 'rake'
29
29
  spec.add_development_dependency 'rspec'
30
30
  spec.add_development_dependency 'rubocop'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swagger-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Lincoln
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-13 00:00:00.000000000 Z
11
+ date: 2015-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -31,6 +31,9 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '3.0'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: 3.4.0
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +41,9 @@ dependencies:
38
41
  - - "~>"
39
42
  - !ruby/object:Gem::Version
40
43
  version: '3.0'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: 3.4.0
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: json-schema
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +78,14 @@ dependencies:
72
78
  requirements:
73
79
  - - "~>"
74
80
  - !ruby/object:Gem::Version
75
- version: '1.6'
81
+ version: '1.5'
76
82
  type: :development
77
83
  prerelease: false
78
84
  version_requirements: !ruby/object:Gem::Requirement
79
85
  requirements:
80
86
  - - "~>"
81
87
  - !ruby/object:Gem::Version
82
- version: '1.6'
88
+ version: '1.5'
83
89
  - !ruby/object:Gem::Dependency
84
90
  name: rake
85
91
  requirement: !ruby/object:Gem::Requirement