airservice_build_tools 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/airservice/build_tools/obj_c.rb +2 -2
- data/lib/airservice/build_tools/version.rb +1 -1
- data/spec/airservice/build_tools/obj_c_spec.rb +24 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bef2301134341d74dcc3311b844206b2c993de09
|
4
|
+
data.tar.gz: de76dee7b4bf8f797f68589cda79e75cfd63adae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c956d3e129bedd7aeb6b6e5455b6ea67ecb62b325f7334f7186f569943c5065c52a65395a2fb0f2b898b8f081ce81a35ce85a842f204c4e5bf68cb8d9bf439e2
|
7
|
+
data.tar.gz: 854871514802cb2c10cb3a7fe47374b3184b0cb1d6be7034ca91c66c495c8204f1cce2e3540eac21ba352446f897ea06a003217a322b9d7e5f385eeb32213b94
|
data/Gemfile.lock
CHANGED
@@ -12,9 +12,9 @@ module AirService
|
|
12
12
|
plist = Plist::parse_xml(plist_file_path)
|
13
13
|
|
14
14
|
build_version = options[:build_version]
|
15
|
-
plist['CFBundleVersion'] = build_version
|
15
|
+
plist['CFBundleVersion'] = build_version if build_version
|
16
16
|
version = options[:version]
|
17
|
-
plist['CFBundleShortVersionString'] = version
|
17
|
+
plist['CFBundleShortVersionString'] = version if version
|
18
18
|
|
19
19
|
log "Updating plist to #{plist.inspect}"
|
20
20
|
new_plist_content = plist.to_plist
|
@@ -15,8 +15,9 @@ describe AirService::BuildTools::ObjC do
|
|
15
15
|
expect(error.message).to include('exists')
|
16
16
|
end
|
17
17
|
end
|
18
|
-
|
19
|
-
plist_file
|
18
|
+
context 'when updating without errors' do
|
19
|
+
let(:plist_file) {
|
20
|
+
<<-plist
|
20
21
|
<?xml version="1.0" encoding="UTF-8"?>
|
21
22
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
22
23
|
<plist version="1.0">
|
@@ -25,15 +26,29 @@ describe AirService::BuildTools::ObjC do
|
|
25
26
|
<string>en</string>
|
26
27
|
</dict>
|
27
28
|
</plist>
|
28
|
-
|
29
|
-
|
30
|
-
File.open(file_path, 'w+') {|f| f.write( plist_file) }
|
29
|
+
plist
|
30
|
+
}
|
31
31
|
|
32
|
-
|
32
|
+
it 'adds version and build number in plist' do
|
33
|
+
file_path = 'test_plist.plist'
|
34
|
+
File.open(file_path, 'w+') { |f| f.write(plist_file) }
|
33
35
|
|
34
|
-
|
35
|
-
|
36
|
-
|
36
|
+
update_plist_version(file_path: file_path, build_version: '345', version: '1.1.345')
|
37
|
+
|
38
|
+
actual = Plist::parse_xml(file_path)
|
39
|
+
actual['CFBundleVersion'].should eq('345')
|
40
|
+
actual['CFBundleShortVersionString'].should eq('1.1.345')
|
41
|
+
end
|
42
|
+
it 'ignores not specified version' do
|
43
|
+
file_path = 'test_plist.plist'
|
44
|
+
File.open(file_path, 'w+') { |f| f.write(plist_file) }
|
45
|
+
|
46
|
+
update_plist_version(file_path: file_path)
|
47
|
+
|
48
|
+
actual = File.read(file_path)
|
49
|
+
actual.should_not include('CFBundleVersion')
|
50
|
+
actual.should_not include('CFBundleShortVersionString')
|
51
|
+
end
|
37
52
|
end
|
38
53
|
end
|
39
54
|
end
|