deploygate 0.6.3 → 0.6.4

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
  SHA256:
3
- metadata.gz: 17db64ccad3b6dbc67aca1430d24b86a35f278c91356633afd71635e1218dc41
4
- data.tar.gz: 409f3792317f8bf0d2e73e12ba712c56f8e66e93d7c0116ca9d09d084f6993a5
3
+ metadata.gz: 0dfa2aaa4fb89cc3c6d42911b5c7546fbae07bc23b708d14337087a8debd3f1e
4
+ data.tar.gz: cc02a7b75d851d3fef7a8e776d27cce845f942ffaf4f6871d4841c9166ea4872
5
5
  SHA512:
6
- metadata.gz: 7391995661f77a94f21deead895a83c7e2678e5482b48acb4afb83f2060cc85eb3043b7ac0a266d08078ed47d60c95941f469117d016752a66c2c0411fd94603
7
- data.tar.gz: cb0fc091a7a2e83be4aab162cf2a0a596588181812af3ceadda88521511f30f2b34163c73dde39686de027366e4952a8721b6a9c936d597dedcf4f8cea75b9fe
6
+ metadata.gz: 34083bf5b446f8e1f61bb85cd479af29bb601ec93e830bd9b67bd9de9cd00336b0cc0fd5eae8a07458242ae59f7dc6f6e6db135ff21be016734ed28020c33822
7
+ data.tar.gz: 0b2a45ba2161ddfb4f8a2e894f0fbe73d1a76c03cb956353ba0156802883acced0424c2f456ecef2e8be956e1718b5444c8b7e34faf468facedf2c5afcc336f9
@@ -1,3 +1,3 @@
1
1
  module DeployGate
2
- VERSION = '0.6.3'
2
+ VERSION = '0.6.4'
3
3
  end
@@ -72,14 +72,18 @@ module DeployGate
72
72
  # @param [String] bundle_identifier
73
73
  # @return [String]
74
74
  def convert_bundle_identifier(bundle_identifier)
75
- identifier = bundle_identifier
76
- if match = bundle_identifier.match(/\$\((.+)\)/)
77
- custom_id = match[1]
78
- identifier = target_build_configration.build_settings[custom_id]
79
- end
80
- identifier = convert_bundle_identifier(identifier) if bundle_identifier.match(/\$\((.+)\)/)
75
+ new_bundle_identifier = bundle_identifier.gsub(/\$\(([^\)]+)\)|\${([^}]+)}/) {
76
+ custom_id = $1 || $2
77
+ if custom_id == 'TARGET_NAME'
78
+ target_project_setting.name
79
+ else
80
+ target_build_configration.build_settings[custom_id]
81
+ end
82
+ }
83
+ # bail out if the result identical to the original
84
+ return bundle_identifier if new_bundle_identifier == bundle_identifier
81
85
 
82
- identifier
86
+ convert_bundle_identifier(new_bundle_identifier)
83
87
  end
84
88
 
85
89
  # @return [String]
@@ -1,3 +1,59 @@
1
1
  describe DeployGate::Xcode::Analyze do
2
- # TODO: add test
2
+
3
+ context '#convert_bundle_identifier' do
4
+
5
+ class DummyProject
6
+ SCHEME = 'dummy'
7
+ def schemes
8
+ [SCHEME, 'dummy2']
9
+ end
10
+
11
+ def options
12
+ {}
13
+ end
14
+ end
15
+
16
+ class DummyProjectSetting
17
+ def name
18
+ 'TargetName'
19
+ end
20
+ end
21
+
22
+ class DummyBuildConfigration
23
+ def build_settings
24
+ {
25
+ 'PRODUCT_NAME' => '$(TARGET_NAME)',
26
+ 'CUSTOM_KEY' => 'CustomKey',
27
+ 'PRODUCT_BUNDLE_IDENTIFER' => 'com.deploygate.app',
28
+ 'DEBUG_POSTFIX' => '.debug',
29
+ 'LOOP' => '$(LOOP)'
30
+ }
31
+ end
32
+ end
33
+
34
+ before do
35
+ allow_any_instance_of(DeployGate::Xcode::Analyze).to receive(:find_scheme_workspace).and_return('')
36
+ allow_any_instance_of(DeployGate::Xcode::Analyze).to receive(:find_build_workspace)
37
+ allow_any_instance_of(DeployGate::Xcode::Analyze).to receive(:target_build_configration).and_return(DummyBuildConfigration.new)
38
+ allow_any_instance_of(DeployGate::Xcode::Analyze).to receive(:target_project_setting).and_return(DummyProjectSetting.new)
39
+ allow(FastlaneCore::Configuration).to receive(:create)
40
+ allow(FastlaneCore::Project).to receive(:new).and_return(DummyProject.new)
41
+ end
42
+
43
+ it do
44
+ analyze = DeployGate::Xcode::Analyze.new('', nil, DummyProject::SCHEME)
45
+ expect(analyze.convert_bundle_identifier('com.deploygate.$(PRODUCT_NAME).${CUSTOM_KEY}')).to eq 'com.deploygate.TargetName.CustomKey'
46
+ end
47
+
48
+ it 'if only env' do
49
+ analyze = DeployGate::Xcode::Analyze.new('', nil, DummyProject::SCHEME)
50
+ expect(analyze.convert_bundle_identifier('$(PRODUCT_BUNDLE_IDENTIFER)$(DEBUG_POSTFIX)')).to eq 'com.deploygate.app.debug'
51
+ end
52
+
53
+ it 'if loop env' do
54
+ analyze = DeployGate::Xcode::Analyze.new('', nil, DummyProject::SCHEME)
55
+ expect(analyze.convert_bundle_identifier('$(LOOP)')).to eq '$(LOOP)'
56
+ end
57
+ end
58
+
3
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deploygate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - deploygate
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-06 00:00:00.000000000 Z
11
+ date: 2018-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -419,7 +419,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
419
419
  version: '0'
420
420
  requirements: []
421
421
  rubyforge_project:
422
- rubygems_version: 2.7.5
422
+ rubygems_version: 2.7.6
423
423
  signing_key:
424
424
  specification_version: 4
425
425
  summary: A command-line interface for DeployGate