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 +4 -4
- data/README.md +2 -1
- data/lib/phone_gap/build/credentials.rb +12 -2
- data/lib/phone_gap/build/version.rb +1 -1
- data/spec/phone_gap/build/credentials_spec.rb +16 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a57b96468b966e0b9247aaa0443fdbdaac7ff83
|
4
|
+
data.tar.gz: 444f83e0b73ee9de550fe59ace040ca10799966a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
@@ -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
|
-
|
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
|
-
|
18
|
+
ENV.stub(:[]).with('BUNDLE_GEMFILE').and_return(File.join(ROOT_DIR, 'Gemfile'))
|
24
19
|
end
|
25
20
|
|
26
|
-
it '
|
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
|
-
|
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.
|
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-
|
11
|
+
date: 2014-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httmultiparty
|