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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4a9e48476eb39e790e0ff143b0096a279ba68b363197623ea8d689508273fae
4
- data.tar.gz: f19266850f44f926b20f08e5fbad96688bee67599e8c4abc1a387a472983420c
3
+ metadata.gz: bcabf38f85c19c28d26ec76db463d508a1bcd1f2a8ee97c2ba3c880f8fe8ffd9
4
+ data.tar.gz: 96f5730869b8dc2651dedae5032407d06503ee92e8b4e2fa8e9d282685061436
5
5
  SHA512:
6
- metadata.gz: 3e05bf650863d53b3d961f3e9695ac9221640e30d929a75a6a5b8532a637db87821ee4196a248fd119ff88b0853c914eefea1770bd20d8be0826468e3952699b
7
- data.tar.gz: a0808adc61bf5328df3bf252325c013809a582506b58127518b79cec2cea70f5e149128fdb684badfe951b5db665a9602b03049decb4cb67d2f2220ea6061fc9
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(_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
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)
@@ -1,6 +1,6 @@
1
1
  module Eras
2
2
  class ErrorReporter
3
- def initialize(adapter: Eras::Adapters::FileSystem.new(::Rails.env))
3
+ def initialize(adapter: Eras::Adapters::FileSystem.new)
4
4
  @adapter = adapter
5
5
  end
6
6
 
data/lib/eras/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eras
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.4"
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.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bobby McDonald