yaml-lint 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/yaml-lint +1 -1
  3. data/lib/yaml-lint.rb +7 -6
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7b5f9927180f94ca3f4de28347e298590bf4a19
4
- data.tar.gz: 9a449dceb9a007daad46119ad3dff01a9dedd677
3
+ metadata.gz: fb29aa4e6f0026944a06a820665d65910b2be07a
4
+ data.tar.gz: f3411164507107cff49cb01a6bfc23a083b0f814
5
5
  SHA512:
6
- metadata.gz: a0dce2ea6eecb51c90451ec5082aee022550a3a36679983cda41ebd738a17657280c8abce47e4f502e40a829cf21fbe066245a958d397b1c50ac8b455be87f55
7
- data.tar.gz: b0b7874c060b8a9c8bc28e3e31a1fcf51fce516b9b93940561f22f375d1c1847ca9fdcf02b932544a6d515d493812361cc446849249e2bfa80e3dc1595cd323e
6
+ metadata.gz: a77de2bfc721656a70124f97608c4b8350ea2b71a994cf5295666a0d48c2fa1716fbcce7c774f55e7692a3cc6b34b9bb46611b79f64230b78c44b9fecfc6ae67
7
+ data.tar.gz: e3cbe7d5568dc196c5974b9e5b4f30213595a90fcd1e65949c8814ebeb93fff784520e7377f2b926ae4ca4137d9cb4c254d9a33ac5280d1c58d166031c66cdba
@@ -22,7 +22,7 @@ bad_result = false
22
22
  ARGV.each do|file|
23
23
  lint = YamlLint.new(file)
24
24
  result = lint.do_lint
25
- bad_result = true unless result and bad_result
25
+ bad_result = true unless result
26
26
  end
27
27
 
28
28
  puts 'Done.'
@@ -42,14 +42,14 @@ class YamlLint
42
42
  unless File.exists? @file
43
43
  error "File #{@file} does not exist"
44
44
  @error = true
45
- return
46
- end
47
- if File.directory? @file
48
- self.parse_directory @file
49
45
  else
50
- self.parse_file @file
46
+ if File.directory? @file
47
+ self.parse_directory @file
48
+ else
49
+ self.parse_file @file
50
+ end
51
51
  end
52
- @error
52
+ @error ? false : true
53
53
  end
54
54
 
55
55
  def parse_directory(directory)
@@ -67,6 +67,7 @@ class YamlLint
67
67
  def parse_file(file)
68
68
  unless File.extname(file) == ".yaml"
69
69
  error "The extension of the file #{file} should be .yaml"
70
+ @error = true
70
71
  return
71
72
  end
72
73
  begin
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaml-lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Fabre