prmd 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTIwZDk1MjQwNDczNDkxOTkyZWE4NjVhNjgyZGI5MDBhOWY4ODNlZA==
4
+ NjVhYzZlMzA0ODZlNDdhM2M1NWYzYzM0MjExMzM5NTZmMDQ2NDBhMw==
5
5
  data.tar.gz: !binary |-
6
- NGQxYTRlZjE5NmQ5YzcwZGM4OWZmMzFiYTU5OGU3N2FjYzkyYTMxOA==
6
+ N2VlOGY4NDYwYmIwYzM4M2VhNjVjZTViZjk0MTg0YTRlMmRiNmNlZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MmUwNWIxYjEwMDExY2FkYTM5MDliNDM0MGNlYjY2NzFhYzhhNzhlNWNhY2M2
10
- YmFiOTFiOGFkMzdhZGFlMWU5ODk2OTY4ZWVkMDE3MjA5YzAyOTIyZDFlZjdi
11
- MjEwNzVlZjUzMWUyNzI5NDc0NDk2OTgzMmZiZTc2NjNkYmI0N2E=
9
+ NDMwNDFlZWZjM2VjZDg0Yzc0YjhhNzA4MDc5NmUxM2FiMzExZjA4NzAyOTdj
10
+ YjE1NjZlNDc2Nzc5ZDY4MzNjZTAyZjhmNTI4ZTdlMWY0NDBhYmQwNGM0NDAy
11
+ MjI4NTQ3NDAxMDFhMmNmZjI2N2FhOWM4N2QyM2JjNTFlNTA0NTQ=
12
12
  data.tar.gz: !binary |-
13
- ZDAxNWM4ZWJmZDJhN2YwZjIyMDNkZmJlY2E2ZGMzYzllOTI2Y2UxYzI5M2Nm
14
- ZDU0YzYzNTI1YTI5NGM0NjA3NmRhZjI3MWFjZGY0OGNmMzliNThkNzg0NjBj
15
- MjEzYWUwZDhlMDc3ZWU3MWZhMmVjMWRmNTNmZDk1ODQwNDk5YzI=
13
+ OTAwZjNiNzI2M2ZkZTBiZDQ1OGFlMjJkMTY0YmYwNDM0NDQ5MzQ0NGJhODU1
14
+ OGE2MTk5Y2M1YjBlOGJjOGNmMDBhM2FlM2ExMzhlYmY5NDgyZWQwOTlmZTlh
15
+ YzQ0NzkzODE4MmEwZjQ0ZGVlMGZiNzc2Y2MzMzI0NzYxNmViNjk=
@@ -2,10 +2,12 @@ module Prmd
2
2
  def self.verify(schema)
3
3
  errors = []
4
4
  errors << verify_schema(schema)
5
- if schema['definitions']
6
- schema['definitions'].each do |key, value|
7
- errors << verify_schema(value)
8
- errors << verify_definitions_and_links(value)
5
+ schema = Prmd::Schema.new(schema)
6
+ if schema['properties']
7
+ schema['properties'].each do |key, value|
8
+ _, schemata = schema.dereference(value)
9
+ errors << verify_schema(schemata)
10
+ errors << verify_definitions_and_links(schemata)
9
11
  end
10
12
  end
11
13
  errors.flatten!
@@ -28,14 +28,14 @@
28
28
  end
29
29
 
30
30
  # avoid repetition :}
31
- if descriptions.size > 1
31
+ description = if descriptions.size > 1
32
32
  descriptions.first.gsub!(/ of (this )?.*/, "")
33
33
  descriptions[1..-1].map { |d| d.gsub!(/unique /, "") }
34
+ [descriptions[0...-1].join(", "), descriptions.last].join(" or ")
35
+ else
36
+ description = descriptions.last
34
37
  end
35
38
 
36
- last = descriptions.pop
37
- description = [descriptions.join(", "), last].join(" or ")
38
-
39
39
  example = [*examples].map { |e| "<code>#{e.to_json}</code>" }.join(" or ")
40
40
  attributes << [key, "string", description, example]
41
41
 
@@ -1,3 +1,3 @@
1
1
  module Prmd
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - geemus
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-07 00:00:00.000000000 Z
11
+ date: 2014-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erubis