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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4a9e48476eb39e790e0ff143b0096a279ba68b363197623ea8d689508273fae
4
- data.tar.gz: f19266850f44f926b20f08e5fbad96688bee67599e8c4abc1a387a472983420c
3
+ metadata.gz: 8461f24b4e628c0e2d0c761a59341ffa73f78fba8752d4fc3d9c8fbd3367a722
4
+ data.tar.gz: 2ceac24bc81c102a99a61b5d284275fb3be6cf4cbbd97054abac556d853ee214
5
5
  SHA512:
6
- metadata.gz: 3e05bf650863d53b3d961f3e9695ac9221640e30d929a75a6a5b8532a637db87821ee4196a248fd119ff88b0853c914eefea1770bd20d8be0826468e3952699b
7
- data.tar.gz: a0808adc61bf5328df3bf252325c013809a582506b58127518b79cec2cea70f5e149128fdb684badfe951b5db665a9602b03049decb4cb67d2f2220ea6061fc9
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(_path = nil)
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
@@ -1,3 +1,3 @@
1
1
  module Eras
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eras
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bobby McDonald