phone_gap-build 0.6.1 → 0.6.2

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: 8e834b89c2ec819e1fd0c2b884aadd4ed469a61d
4
- data.tar.gz: a1660bada277a57f7693419ca0cc06eabc7383db
3
+ metadata.gz: 8a57b96468b966e0b9247aaa0443fdbdaac7ff83
4
+ data.tar.gz: 444f83e0b73ee9de550fe59ace040ca10799966a
5
5
  SHA512:
6
- metadata.gz: 219404a7e7d4cedeb7868d667ece7e80ac39ec2ae91cf0b2431cbf0d9ed2bc5eb04440ee77ac34db1272cd0c4c23f2eb8dda32bea81cbf7694c8494580de906a
7
- data.tar.gz: bf67eac9281fe2fa4ef18e329bcc750a2d101d39cdc1dc89eca9753375be80c0cc443fc49706c7086fe27991bf26461f1874d35dac3be5b3d6f2e51bdd7bb7d7
6
+ metadata.gz: f78590a3bae29f6f5be0ae5abdd6801e1c91370a8f79256b8b9c859ce9b25719ecdff2e06ffac415b8a981ae81598ef091461d49b32057eddd7c82a6a1e827f5
7
+ data.tar.gz: 4c663add0dda437f30345a9241ceb88b14457f31b8f728e2529e6bc82c1c0bae29bc4e221bb13f5d91d5ae9a9c77c7f1c31bcce7ae7c50d2856e71851a796907
data/README.md CHANGED
@@ -29,7 +29,8 @@ Or install it yourself as:
29
29
  # manually set your api credentials
30
30
  PhoneGap::Build.credentials(token: 'my_api_token')
31
31
 
32
- # credentials are autoloaded from config/phonegap.yml if it exists
32
+ # credentials are autoloaded from config/phonegap.yml if it exists and you are running in the context of bundler
33
+ # i.e. BUNDLE_GEMFILE environment variable is set.
33
34
 
34
35
  # set what apps you got
35
36
  apps = PhoneGap::Build.apps
@@ -17,13 +17,23 @@ module PhoneGap
17
17
  end
18
18
 
19
19
  def load
20
- config_file = File.expand_path('../../../../config/phonegap.yml', __FILE__)
21
- if File.exists? config_file
20
+ if config_file && File.exists?(config_file)
22
21
  @config = YAML::load_file(config_file)
23
22
  @token = @config['token']
24
23
  end
25
24
  self
26
25
  end
26
+
27
+ private
28
+
29
+ def config_file
30
+ if ENV['BUNDLE_GEMFILE']
31
+ application_root = ENV['BUNDLE_GEMFILE'].gsub('Gemfile', '')
32
+ File.expand_path(File.join(application_root, 'config', 'phonegap.yml'), __FILE__)
33
+ else
34
+ false
35
+ end
36
+ end
27
37
  end
28
38
  end
29
39
  end
@@ -1,5 +1,5 @@
1
1
  module PhoneGap
2
2
  module Build
3
- VERSION = '0.6.1'
3
+ VERSION = '0.6.2'
4
4
  end
5
5
  end
@@ -12,20 +12,27 @@ describe PhoneGap::Build::Credentials do
12
12
  File.stub(:exists?).with(config_file).and_return true
13
13
  end
14
14
 
15
- it 'tries to load a phonegap config file' do
16
- expect(YAML).to receive(:load_file).with(config_file).and_return({})
17
- subject.load
18
- end
19
-
20
- context 'if a config file exists' do
15
+ context 'when run in the context fo bundler' do
21
16
 
22
17
  before do
23
- YAML.stub(:load_file).and_return({'token' => 'BATMAN'})
18
+ ENV.stub(:[]).with('BUNDLE_GEMFILE').and_return(File.join(ROOT_DIR, 'Gemfile'))
24
19
  end
25
20
 
26
- it 'populates the credentials using values from the config file' do
21
+ it 'tries to load a phonegap config file' do
22
+ expect(YAML).to receive(:load_file).with(config_file).and_return({})
27
23
  subject.load
28
- expect(subject.token).to eq 'BATMAN'
24
+ end
25
+
26
+ context 'if a config file exists' do
27
+
28
+ before do
29
+ YAML.stub(:load_file).and_return({'token' => 'BATMAN'})
30
+ end
31
+
32
+ it 'populates the credentials using values from the config file' do
33
+ subject.load
34
+ expect(subject.token).to eq 'BATMAN'
35
+ end
29
36
  end
30
37
  end
31
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phone_gap-build
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seb Glazebrook
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-21 00:00:00.000000000 Z
11
+ date: 2014-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httmultiparty