swagger_yard 0.3.2 → 0.3.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: bcc44f83fbfc033ffcb705294bfabe66ad77931f
4
- data.tar.gz: 7a4246e624c0064d13d20cb69ab9596554e4c882
3
+ metadata.gz: e6166455641c33ed4e8dd620e1d9fd6d7a7a04a8
4
+ data.tar.gz: 3a36d52baa856e2d06acfc04da5c4a19403aeebf
5
5
  SHA512:
6
- metadata.gz: f976b31cefafbe77dcb69adc49319c903d559ed754770e1afff3c1a9a16a0e6568d260504024aad8878364fff90f25580aee38216518b42d6630b5a93d615678
7
- data.tar.gz: a8f8ca363f696d796be24398b4d18da83abcb1cfcfd1e9da6eab9018f2caea4d4577402d077d7aff563de2974066bd04605f52a32312a499bb89fe3caf56a81c
6
+ metadata.gz: fe018dd6c2336f4b5ccd2b144b54a578e6f7a574a603ee67d0f40b973ed00e41dd7a52b7572666dacd37464e24df6897453d238e7ca986ae7b5ab9441bc68169
7
+ data.tar.gz: 903a6787f86dea465e460b83212546aa67ca60b49287779b982a042af3e9f9379184f78af034b6ba760baa33ef81d9fc135df3056318bff3f1de6e02c5b58df9
@@ -12,6 +12,10 @@ module SwaggerYard
12
12
  end
13
13
  end
14
14
 
15
+ def self.mangle(name)
16
+ name.gsub(/[^[:alnum:]_]+/, '_')
17
+ end
18
+
15
19
  def initialize
16
20
  @properties = []
17
21
  end
@@ -24,7 +28,7 @@ module SwaggerYard
24
28
  tags.each do |tag|
25
29
  case tag.tag_name
26
30
  when "model"
27
- @id = tag.text.gsub(/[^[:alnum:]_]+/, '_')
31
+ @id = Model.mangle(tag.text)
28
32
  when "property"
29
33
  @properties << Property.from_tag(tag)
30
34
  end
@@ -25,7 +25,7 @@ module SwaggerYard
25
25
  attr_reader :name, :array, :enum
26
26
 
27
27
  def initialize(name, options = {})
28
- @name = name
28
+ @name = Model.mangle(name) if name
29
29
  @array = options[:array]
30
30
  @enum = options[:enum]
31
31
  @format = options[:format]
@@ -1,3 +1,3 @@
1
1
  module SwaggerYard
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swagger_yard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - chtrinh (Chris Trinh)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-22 00:00:00.000000000 Z
11
+ date: 2016-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard