phone_gap-build 0.6.2 → 0.7.0

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: 8a57b96468b966e0b9247aaa0443fdbdaac7ff83
4
- data.tar.gz: 444f83e0b73ee9de550fe59ace040ca10799966a
3
+ metadata.gz: ee3545194726a70b62433b235ea33b325669f912
4
+ data.tar.gz: 12f94bb409194a1c853db2d0442d624447325e1b
5
5
  SHA512:
6
- metadata.gz: f78590a3bae29f6f5be0ae5abdd6801e1c91370a8f79256b8b9c859ce9b25719ecdff2e06ffac415b8a981ae81598ef091461d49b32057eddd7c82a6a1e827f5
7
- data.tar.gz: 4c663add0dda437f30345a9241ceb88b14457f31b8f728e2529e6bc82c1c0bae29bc4e221bb13f5d91d5ae9a9c77c7f1c31bcce7ae7c50d2856e71851a796907
6
+ metadata.gz: 4f99c368c83fcf663466a167e3f79e3cff21b6fd9e2f88bef7db32fe201522e3c3c7dd334a3642f4bc6a56dbb72adc16c8ee732f9978f73c5fbb476889dde7b0
7
+ data.tar.gz: 27ad1b1463536565610d378316744e924bf677c26ed3f271ecb70b2be8c2179e54e3a2725de27e701b3c87d201fe090aac1fe21f8497865c66c14f36164c703f
@@ -18,7 +18,7 @@ module PhoneGap
18
18
 
19
19
  def load
20
20
  if config_file && File.exists?(config_file)
21
- @config = YAML::load_file(config_file)
21
+ @config = YAML::load(ERB.new(File.read(config_file)).result)
22
22
  @token = @config['token']
23
23
  end
24
24
  self
@@ -1,5 +1,5 @@
1
1
  module PhoneGap
2
2
  module Build
3
- VERSION = '0.6.2'
3
+ VERSION = '0.7.0'
4
4
  end
5
5
  end
@@ -6,32 +6,45 @@ describe PhoneGap::Build::Credentials do
6
6
 
7
7
  describe '#load' do
8
8
 
9
- let(:config_file) { File.expand_path('config/phonegap.yml', ROOT_DIR) }
10
-
11
- before do
12
- File.stub(:exists?).with(config_file).and_return true
13
- end
14
-
15
9
  context 'when run in the context fo bundler' do
16
10
 
17
11
  before do
18
12
  ENV.stub(:[]).with('BUNDLE_GEMFILE').and_return(File.join(ROOT_DIR, 'Gemfile'))
19
13
  end
20
14
 
21
- it 'tries to load a phonegap config file' do
22
- expect(YAML).to receive(:load_file).with(config_file).and_return({})
23
- subject.load
24
- end
15
+ context 'and a config file exists' do
25
16
 
26
- context 'if a config file exists' do
17
+ let(:config_file) { File.expand_path('config/phonegap.yml', ROOT_DIR) }
18
+ let(:config_double) { double('config') }
19
+ let(:erb_double) { double('erb', :result => config_file) }
27
20
 
28
21
  before do
29
- YAML.stub(:load_file).and_return({'token' => 'BATMAN'})
22
+ File.stub(:exists?).with(config_file).and_return true
23
+ File.stub(:read).with(config_file).and_return config_double
24
+ ERB.stub(:new).with(config_double).and_return erb_double
25
+ end
26
+
27
+
28
+ it 'evaluates any embedded ruby' do
29
+ expect(ERB).to receive(:new).with(config_double).and_return erb_double
30
+ subject.load
30
31
  end
31
32
 
32
- it 'populates the credentials using values from the config file' do
33
+ it 'tries to load a phonegap config file' do
34
+ expect(YAML).to receive(:load).with(config_file).and_return({})
33
35
  subject.load
34
- expect(subject.token).to eq 'BATMAN'
36
+ end
37
+
38
+ context 'if a token exists in config' do
39
+
40
+ before do
41
+ YAML.stub(:load).and_return({'token' => 'BATMAN'})
42
+ end
43
+
44
+ it 'populates the credentials using values from the config file' do
45
+ subject.load
46
+ expect(subject.token).to eq 'BATMAN'
47
+ end
35
48
  end
36
49
  end
37
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phone_gap-build
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seb Glazebrook