grayskull 0.1.3 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/grayskull/cli.rb +6 -5
- data/lib/grayskull/validator.rb +12 -2
- data/lib/grayskull/version.rb +1 -1
- metadata +2 -2
data/lib/grayskull/cli.rb
CHANGED
@@ -12,11 +12,12 @@ module Grayskull
|
|
12
12
|
results = validator.validate
|
13
13
|
|
14
14
|
if !results['result']
|
15
|
-
puts 'Validation Failed
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
puts 'Validation Failed with ' + @errors.count.to_s + ' errors';
|
16
|
+
puts ''
|
17
|
+
results["errors"].each{
|
18
|
+
|error|
|
19
|
+
puts error
|
20
|
+
}
|
20
21
|
else
|
21
22
|
puts 'Validated Successfully!'
|
22
23
|
end
|
data/lib/grayskull/validator.rb
CHANGED
@@ -10,8 +10,18 @@ module Grayskull
|
|
10
10
|
@file = file
|
11
11
|
@schema = schema
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
if file.kind_of?(String) && !Formats::FILENAME_PATTERN.match(file).nil?
|
14
|
+
@loaded_file = self.load(file)
|
15
|
+
else
|
16
|
+
@loaded_file = file
|
17
|
+
end
|
18
|
+
|
19
|
+
if schema.kind_of?(String) && !Formats::FILENAME_PATTERN.match(schema).nil?
|
20
|
+
@loaded_schema = self.load(schema)
|
21
|
+
else
|
22
|
+
@loaded_schema = schema
|
23
|
+
end
|
24
|
+
|
15
25
|
@types = @loaded_schema['types'] || {}
|
16
26
|
|
17
27
|
@errors = []
|
data/lib/grayskull/version.rb
CHANGED