grayskull 0.1.3 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
- results['errors'].each{
17
- |error|
18
- puts error
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
@@ -10,8 +10,18 @@ module Grayskull
10
10
  @file = file
11
11
  @schema = schema
12
12
 
13
- @loaded_file = self.load(file)
14
- @loaded_schema = self.load(schema)
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 = []
@@ -1,4 +1,4 @@
1
1
  module Grayskull
2
2
  # Current version number
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.6"
4
4
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 6
9
+ version: 0.1.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Will McKenzie