branchable_cdn_assets 0.5.0 → 0.5.1

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
  SHA1:
3
- metadata.gz: 6ea31a15245850a8679508ce6256859f872e8e22
4
- data.tar.gz: 34645624f7e366189c37c46c2ccd1841e032652c
3
+ metadata.gz: e26d161a2f90baf7eccfd0196b73ad4960e44999
4
+ data.tar.gz: 3c5283f4b6a357efc58247b639bc0176da4f402d
5
5
  SHA512:
6
- metadata.gz: d724f92695a224e3fc88dca3ca8075b18cdb420a6a0817205ceeceb9a3b3cc789907b4fcf9c0247221e9a913a2977fc6ea987c3547171865874f72435e68174c
7
- data.tar.gz: fd962e24f6d4b906f7507d6636d6cd11f82a782112e418dc0421a67e66801a4ac9c11ed66a7d8ff9e697746f6129ae26f0fa1560470f6cfab6f44372155954bc
6
+ metadata.gz: f63978ead84a55ce26f39193527e8e54b9b54a87c7987bdc2569ce0e4ff7409971ab2b5e146262f397c6a630232718cc4b248d1005a822924a93bc14f43f3925
7
+ data.tar.gz: 61852b9411fedcfbf00a1c69bdb2a4f00de1e3805fe0de800c7ed7576be9e871acd44f0e4fc70d16b0e1af89cc02c62a43af4b2587f5ef02a9a5952c550adbec
@@ -1,5 +1,6 @@
1
1
  require 'tempfile'
2
2
  require 'yaml'
3
+ require 'erb'
3
4
 
4
5
  require 'asgit'
5
6
  require 'here_or_there'
@@ -55,7 +55,7 @@ module BranchableCDNAssets
55
55
 
56
56
  def read_config_file path
57
57
  if File.exists?(path)
58
- YAML.load IO.read(path)
58
+ YAML.load ERB.new(IO.read(path)).result
59
59
  else
60
60
  raise "config file not found at #{path}"
61
61
  end
@@ -1,3 +1,3 @@
1
1
  module BranchableCDNAssets
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -43,6 +43,10 @@ describe BranchableCDNAssets::Config do
43
43
  "baz: wu\n"
44
44
  end
45
45
 
46
+ let(:yaml_erb) do
47
+ "foo: <%= 'bar' %>"
48
+ end
49
+
46
50
  describe "#raw_data" do
47
51
  context "when given a hash" do
48
52
  it "uses hash data as is" do
@@ -59,6 +63,12 @@ describe BranchableCDNAssets::Config do
59
63
 
60
64
  expect( described_class.new('yaml').raw_data ).to eq foo: 'bar', baz: 'wu'
61
65
  end
66
+ it "reads erb in yaml" do
67
+ allow(File).to receive(:exists?).with('yaml_erb').and_return(true)
68
+ allow(IO).to receive(:read).with('yaml_erb').and_return(yaml_erb)
69
+
70
+ expect( described_class.new('yaml_erb').raw_data ).to eq foo: 'bar'
71
+ end
62
72
  it "raises exception if file not found" do
63
73
  allow(File).to receive(:exists?).with('yaml').and_return(false)
64
74
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: branchable_cdn_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Sloan