sus 0.17.0 → 0.17.2
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/sus/file.rb +32 -0
- data/lib/sus/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b86dafae68ebeadfd3e2b7aa2f94e955a05f9b65bf3fcaf1dfdd65a8822a0722
|
4
|
+
data.tar.gz: 7714b5ca6dbac3f8a68f386a369c152c2086e1b9d907040c3163f4f7df8b2670
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d35bd5af4e176105da748d46df24d101e828bd579f6daa32f1907909daa8401abdd73d0bb8f63195ac2c5c787db8af56ec1d7c7131947e0553a7005db0127c6
|
7
|
+
data.tar.gz: 510e795dfe14659e2dc2ab166a546c1547b26d2c1476595260ee67124c5d01e162223196057e22635317cac382d399e36a46f8487b6bdc98baa29867b4606966
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/sus/file.rb
CHANGED
@@ -33,9 +33,41 @@ module Sus
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
class FileLoadError
|
37
|
+
def self.build(parent, path, error)
|
38
|
+
self.new(Identity.new(path), path, error)
|
39
|
+
end
|
40
|
+
|
41
|
+
def initialize(identity, path, error)
|
42
|
+
@identity = identity
|
43
|
+
@path = path
|
44
|
+
@error = error
|
45
|
+
end
|
46
|
+
|
47
|
+
attr :identity
|
48
|
+
|
49
|
+
def leaf?
|
50
|
+
true
|
51
|
+
end
|
52
|
+
|
53
|
+
def print(output)
|
54
|
+
output.write("file ", :path, @identity)
|
55
|
+
end
|
56
|
+
|
57
|
+
def call(assertions)
|
58
|
+
assertions.nested(self, identity: @identity, isolated: true) do |assertions|
|
59
|
+
assertions.error!(@error)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
private_constant :FileLoadError
|
65
|
+
|
36
66
|
module Context
|
37
67
|
def file(path)
|
38
68
|
add File.build(self, path)
|
69
|
+
rescue StandardError, LoadError, SyntaxError => error
|
70
|
+
add FileLoadError.build(self, path, error)
|
39
71
|
end
|
40
72
|
end
|
41
73
|
end
|
data/lib/sus/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|