yaml-lint 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/yaml-lint.rb +7 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b35dc59649f39ee3d5a74e903d31471d5168df4e4277f95e87734169a9a17f8b
4
- data.tar.gz: 8cd3710a60a3d90272c05e44c32360f16fd92a6d8dbccf75498761f56f38fd40
3
+ metadata.gz: 6baf527d2ca2e57849d69f231fd1ad4fef4984632430ec8bb601b5212c7e4236
4
+ data.tar.gz: 28ecee0ab0300f6c1883cdc20b5cbe99caf1f81fff223a125ad530b713e18dda
5
5
  SHA512:
6
- metadata.gz: c4be937cee4d6e3b1530d19531c6f68edc8b20938905bcef9990104eed9d5d1cc50da347326bcebd49aa8ff853b3b0cda088b4a8ca489f6c341610bf357bcdb7
7
- data.tar.gz: a573e05e918b0b1f0834c6e4feb8a49551f223e5692a125cac3257ba0d88d11aefde3a322af42a6cb4e46deb412cb0d962ae45255ab0a2c96e2a214168a163da
6
+ metadata.gz: b66bfa93ff0913b5e4b739ea7f93149567688f99f5db773570416da35a6eda4193c28a381ebfd3058e1ab5fa2a3e8c9f84cd147b3903ec2fc97d4dfdef40c5bc
7
+ data.tar.gz: 28d080fa4fb7cc4c29cb51aec330f83c0b058999acd508053bb32b13f803994be5347cad77e68841f14d9011ca935bf6e6839e596147aaf0528223e34a05027c
data/lib/yaml-lint.rb CHANGED
@@ -75,7 +75,13 @@ class YamlLint
75
75
  return 1
76
76
  end
77
77
  begin
78
- ::YAML.respond_to?(:unsafe_load) ? ::YAML.unsafe_load(file) : ::YAML.load_file(file)
78
+ if ::YAML.respond_to?(:unsafe_load)
79
+ # Specific to psych 4.0+
80
+ payload = ::File.read(file)
81
+ ::YAML.unsafe_load(payload)
82
+ else
83
+ ::YAML.load_file(file)
84
+ end
79
85
  rescue Exception => err
80
86
  error "File : #{file}, error: #{err}"
81
87
  return 1
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.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Fabre