eras 0.2.2 → 0.2.3
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
- data/lib/eras/adapters/file_system.rb +5 -4
- 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: 8461f24b4e628c0e2d0c761a59341ffa73f78fba8752d4fc3d9c8fbd3367a722
|
4
|
+
data.tar.gz: 2ceac24bc81c102a99a61b5d284275fb3be6cf4cbbd97054abac556d853ee214
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9fcda9d56c87bd3538179ac2a6f9fa85b35fa7f30de4b33d6d5a7067e4470d90ccf1ae76934ba5bcdc89a36d3e56d243683c85a185f1ad5a6a36485bc148d4e
|
7
|
+
data.tar.gz: 55cf81501cd4a81786299c38b1e677d97ec1ec0b028d96f778b360e8e1ed8acb20f5e8ddc7f940efd889f3823b7786ed6045c7964e295e04acd27eef9c1ed6be
|
@@ -4,7 +4,11 @@ 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
|
8
12
|
@path = Rails.root.join("tmp", "eras", "errors.json")
|
9
13
|
end
|
10
14
|
|
@@ -20,9 +24,6 @@ module Eras
|
|
20
24
|
[]
|
21
25
|
end
|
22
26
|
|
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
27
|
File.open(@path, "w") do |f|
|
27
28
|
errors = existing_errors
|
28
29
|
errors.unshift(data)
|
data/lib/eras/version.rb
CHANGED