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 +8 -8
- data/lib/prmd/commands/verify.rb +6 -4
- data/lib/prmd/templates/schemata.erb +4 -4
- data/lib/prmd/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjVhYzZlMzA0ODZlNDdhM2M1NWYzYzM0MjExMzM5NTZmMDQ2NDBhMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2VlOGY4NDYwYmIwYzM4M2VhNjVjZTViZjk0MTg0YTRlMmRiNmNlZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDMwNDFlZWZjM2VjZDg0Yzc0YjhhNzA4MDc5NmUxM2FiMzExZjA4NzAyOTdj
|
10
|
+
YjE1NjZlNDc2Nzc5ZDY4MzNjZTAyZjhmNTI4ZTdlMWY0NDBhYmQwNGM0NDAy
|
11
|
+
MjI4NTQ3NDAxMDFhMmNmZjI2N2FhOWM4N2QyM2JjNTFlNTA0NTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTAwZjNiNzI2M2ZkZTBiZDQ1OGFlMjJkMTY0YmYwNDM0NDQ5MzQ0NGJhODU1
|
14
|
+
OGE2MTk5Y2M1YjBlOGJjOGNmMDBhM2FlM2ExMzhlYmY5NDgyZWQwOTlmZTlh
|
15
|
+
YzQ0NzkzODE4MmEwZjQ0ZGVlMGZiNzc2Y2MzMzI0NzYxNmViNjk=
|
data/lib/prmd/commands/verify.rb
CHANGED
@@ -2,10 +2,12 @@ module Prmd
|
|
2
2
|
def self.verify(schema)
|
3
3
|
errors = []
|
4
4
|
errors << verify_schema(schema)
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
|
data/lib/prmd/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2014-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erubis
|