fixed_record 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13fd3793d391886423d6c51b3e99d020431f15dfe30c3c4246aa7947dbd37098
4
- data.tar.gz: 663f7bad130a931a5930385224573232d7c8f94f3d4c31e2327e401f215d29a5
3
+ metadata.gz: 6569aadc6d27a82383e2fadcf8da80313962ae3a46c1515ca1670d5472cfc1bd
4
+ data.tar.gz: f3bb5c501f26f2bd64f0c6c606ae9da209e4c93a9de8d2458367fec87dfe2386
5
5
  SHA512:
6
- metadata.gz: 5f7208d36b15816d189f085f4000fefb32bf48f1525ba8438646a52e92a38fecdc7527e7cf7a62407543b28dcc0ca09d3470b1deac60203d52ce416c0a2dc331
7
- data.tar.gz: 1e2bb52fb5e7401b7d705df0937149ef8cef1e5a27f3d175f1416c62a06f6b5d95ab22e2c34ae4d45b2d81c77b12f8498f096518385c6a3148ae64c772e37d8f
6
+ metadata.gz: 76869aa7725d9dd400ebcf0e8c8c04d1d0bef639298742e3b5ea6bbca491364e021df28c26a181e48ac248b2f9b88ec95ba4e3ffc22201ba924f17fd84923934
7
+ data.tar.gz: 29a29b7422dceda390e4449d511bc13aff4a4f32fc66d3b0333f9556a218ae6419e5031944e972756cf10c50912d81a1d45da7208c25f0ce8a8eb56825a0dee1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Gem fixed_record Changelog
2
2
 
3
+ ## 0.4.2
4
+ * Syntax Errors in YAML file now reported as ArgumentError
5
+
3
6
  ## 0.4.1
4
7
  * Bump rake version due to security issue
5
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fixed_record (0.4.1)
4
+ fixed_record (0.4.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/fixed_record.rb CHANGED
@@ -1,9 +1,10 @@
1
1
 
2
2
  require 'yaml'
3
+ require 'psych'
3
4
  require 'set'
4
5
 
5
6
  class FixedRecord
6
- VERSION = "0.4.1"
7
+ VERSION = "0.4.2"
7
8
 
8
9
  # Lazy load data from given filename
9
10
  # creating accessors for top level attributes
@@ -79,7 +80,13 @@ class FixedRecord
79
80
 
80
81
  def self.load!
81
82
  if @@items.nil?
82
- y = YAML.load_file( @@filename )
83
+ begin
84
+ y = YAML.load_file( @@filename )
85
+ rescue Errno::ENOENT
86
+ raise
87
+ rescue Psych::SyntaxError => error
88
+ raise ArgumentError, "\#{error.class.name} \#{error.message}"
89
+ end
83
90
  validate_structure( y, @@singleton, @@filename )
84
91
  if @@valid_keys.empty?
85
92
  # Grab keys from file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixed_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Bell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-02 00:00:00.000000000 Z
11
+ date: 2020-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler