eras 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eras/adapters/file_system.rb +6 -4
- data/lib/eras/error_reporter.rb +1 -1
- data/lib/eras/version.rb +1 -1
- 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: bcabf38f85c19c28d26ec76db463d508a1bcd1f2a8ee97c2ba3c880f8fe8ffd9
|
4
|
+
data.tar.gz: 96f5730869b8dc2651dedae5032407d06503ee92e8b4e2fa8e9d282685061436
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 861833d3957291c5a0ac83bbce52af9ded69fc40448c01542b85e2b1cfee45bf84f08b6a2ee3f63c9de7d714d84be69a2c03e4c5131da99ad552f090b9505666
|
7
|
+
data.tar.gz: 3736ffd2be3718e0fcf380c2f5f6c01b94cac16af6186e1624693d57349fd09e2135e12e7d8c509cda79767435812bcf47756b67141914da5c249a9c74530906
|
@@ -4,7 +4,12 @@ module Eras
|
|
4
4
|
include ActionView::Helpers::NumberHelper
|
5
5
|
attr_reader :path
|
6
6
|
|
7
|
-
def initialize(
|
7
|
+
def initialize(path = nil)
|
8
|
+
if path.nil?
|
9
|
+
dir = Rails.root.join("tmp", "eras")
|
10
|
+
Dir.mkdir(dir) unless File.exists?(dir)
|
11
|
+
end
|
12
|
+
# TODO: Actually use the path
|
8
13
|
@path = Rails.root.join("tmp", "eras", "errors.json")
|
9
14
|
end
|
10
15
|
|
@@ -20,9 +25,6 @@ module Eras
|
|
20
25
|
[]
|
21
26
|
end
|
22
27
|
|
23
|
-
# Why is this necessary? I thought File.open would create the file if it didn't exist.
|
24
|
-
File.create(@path) unless File.exist?(@path)
|
25
|
-
|
26
28
|
File.open(@path, "w") do |f|
|
27
29
|
errors = existing_errors
|
28
30
|
errors.unshift(data)
|
data/lib/eras/error_reporter.rb
CHANGED
data/lib/eras/version.rb
CHANGED