eye-patch 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: 7b3916ac3ff82a328806885a727764529794589f
4
- data.tar.gz: a772bb0b5a1a22b40d5b47fea49e968d4ac1ac3e
3
+ metadata.gz: cec203fd8cd5288c1d812c5a45f3f000c6f785bb
4
+ data.tar.gz: cbce2948c4bbe9478c0f0fa9ada5ca8ab256a668
5
5
  SHA512:
6
- metadata.gz: 18d93b251bd6a48484c4d4f21c042ca79cf9ad91b87a63fa1ab3ed47040858b44517da916bbd0e40a20c066950c842448c4c7ae51feb73a56df4312fa2a10dd4
7
- data.tar.gz: 8c107ef5c89ebb9423966e69e24159c2e032e0a86c628bd0264de4cc565ac86ded97306225f289e05ab7dd11ddf1048466c9363977b9860dd75b843f7a29d856
6
+ metadata.gz: 2042751d5237d76fc8b6e1673659eb8a87cf554d5316a6317165e409fcb09978df7927a34ec13a32e456cfc25a7d3d0797ae7a0fb445ca38ed38dbec6e149867
7
+ data.tar.gz: bf7bf841ea854958bcaebc597c5b9aaa9d2f62954c2c697e770884411c8e0f84dccd473118933cbbad60fc23318f972fbfbd98ba120a6fd9fce4c1918cff44f9
@@ -9,7 +9,11 @@ module Eye::Patch
9
9
  def_delegators :parsed, :[], :fetch
10
10
 
11
11
  def initialize(filename)
12
- @settings = YAML.load(ERB.new(File.read(filename)).result)
12
+ file = File.new(filename)
13
+ erb = ERB.new(file.read)
14
+ erb.filename = file.path
15
+
16
+ @settings = YAML.load(erb.result)
13
17
  end
14
18
 
15
19
  private
@@ -1,5 +1,5 @@
1
1
  module Eye
2
2
  module Patch
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
@@ -10,6 +10,17 @@ module Eye
10
10
  file.close
11
11
  assert_equal 3, Settings.new(file.path)[:sum]
12
12
  end
13
+
14
+ it "exposes the config file's path within ERB" do
15
+ file = Tempfile.new("yaml")
16
+ file.write("working_dir: <%= __FILE__ %>/..")
17
+ file.close
18
+
19
+ assert_equal(
20
+ File.join(file.path, ".."),
21
+ Settings.new(file.path)[:working_dir],
22
+ )
23
+ end
13
24
  end
14
25
  end
15
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eye-patch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Horner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-02 00:00:00.000000000 Z
11
+ date: 2016-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eye