fixed_record 0.4.2 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/Gemfile.lock +1 -1
- data/lib/fixed_record.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff8338a931bf7c56128b3865f814cff42f0383db1fe48d97cf36d621ab53e244
|
4
|
+
data.tar.gz: 9f3378e6a0423fbbd6cb042973a1c29b315114cdb3accd4b82d3dd8e94a2d529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7eb69a020b70344a11ccdbd5010ab9035cc016235ee462291fd8eef54e0d0829d70ab8581213d264d6f1a12fd99581794938258c50b2af550bb6d3b6d5785643
|
7
|
+
data.tar.gz: abc3b1526a5ce6b2f19271044692e4d4c1eff1acc8aadf05579075a96fd4d3aae30e594f5f1c4035eff034342a05e2d7d6c622fe09ac4e761b6a498d5c42f70a
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/fixed_record.rb
CHANGED
@@ -4,7 +4,7 @@ require 'psych'
|
|
4
4
|
require 'set'
|
5
5
|
|
6
6
|
class FixedRecord
|
7
|
-
VERSION = "0.4.
|
7
|
+
VERSION = "0.4.4"
|
8
8
|
|
9
9
|
# Lazy load data from given filename
|
10
10
|
# creating accessors for top level attributes
|
@@ -85,7 +85,15 @@ class FixedRecord
|
|
85
85
|
rescue Errno::ENOENT
|
86
86
|
raise
|
87
87
|
rescue Psych::SyntaxError => error
|
88
|
-
|
88
|
+
fname = File.basename(@@filename)
|
89
|
+
msg = error.message
|
90
|
+
if msg.include? @@filename
|
91
|
+
msg.sub!( @@filename, fname )
|
92
|
+
msg = "\#{error.class.name} \#{msg}"
|
93
|
+
else
|
94
|
+
msg = "\#{error.class.name} \#{fname} \#{error.message}"
|
95
|
+
end
|
96
|
+
raise ArgumentError, msg
|
89
97
|
end
|
90
98
|
validate_structure( y, @@singleton, @@filename )
|
91
99
|
if @@valid_keys.empty?
|