spaceship 0.2.0 → 0.3.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: 904794a304cacd104b57a5dfdc757a9daaa73154
4
- data.tar.gz: c73073f31e7b3d3b7385fc1e864cf9944ef55583
3
+ metadata.gz: 512289a32dda1675818d359f917054b3f2e1e56e
4
+ data.tar.gz: 5ee2c24728b19f4fbff5ccaa23d99fb64dba3773
5
5
  SHA512:
6
- metadata.gz: da46f269738c9ed37cf56fa1c4c5ae8ba491eb9c3eedef6c59415d492b0defb7819df981091666cadd328d84aea67bccb8c6a21d7104e17a1c2395aa000ad6fb
7
- data.tar.gz: a8e15b850a1fca1cdbb565a988b51bf9fbb503ed9d6fc911bd4f09032f234971d1cc4513b82b3ee2d845bd5d68f1e3e3a310dad05d6e8b0f8f3dd8169b9f7661
6
+ metadata.gz: e4772e10092db2176b4b9c0994d247c92a932678433621599a852111bcad0ada3e991ea4599060f6bc4489f2bdf36a7f1bfac46192b6db8c1b30b7b49f0af409
7
+ data.tar.gz: a89358c7f17c498d33a20335a2d4becd8f16b5a5a192ee7467bc44c2b316b6377b48631dcc4d374639f26fc5829880e28f2ed371f8e1a0af0b04042e1de09f81
@@ -0,0 +1,30 @@
1
+ {
2
+ "Brazilian Portuguese": "Brazilian Portuguese",
3
+ "Danish": "Danish",
4
+ "Dutch": "Dutch",
5
+ "English": "English",
6
+ "English_Australian": "Australian English",
7
+ "English_CA": "Canadian English",
8
+ "English_UK": "UK English",
9
+ "Finnish": "Finnish",
10
+ "French": "French",
11
+ "French_CA": "Canadian French",
12
+ "German": "German",
13
+ "Greek": "Greek",
14
+ "Indonesian": "Indonesian",
15
+ "Italian": "Italian",
16
+ "Japanese": "Japanese",
17
+ "Korean": "Korean",
18
+ "Malay": "Malay",
19
+ "Norwegian": "Norwegian",
20
+ "Portuguese": "Portuguese",
21
+ "Russian": "Russian",
22
+ "Simplified Chinese": "Simplified Chinese",
23
+ "Spanish": "Spanish",
24
+ "Spanish_MX": "Mexican Spanish",
25
+ "Swedish": "Swedish",
26
+ "Thai": "Thai",
27
+ "Traditional Chinese": "Traditional Chinese",
28
+ "Turkish": "Turkish",
29
+ "Vietnamese": "Vietnamese"
30
+ }
@@ -157,6 +157,28 @@ module Spaceship
157
157
  return parameters
158
158
  end
159
159
 
160
+ # @return [String] A nicely formatted string about the state of this build
161
+ # @examples:
162
+ # External, Internal, Inactive, Expired
163
+ def testing_status
164
+ testing ||= "External" if self.external_expiry_date > 0
165
+
166
+ if self.build_train.testing_enabled
167
+ # only the latest build is actually valid
168
+ if self.build_train.builds.find_all { |b| b.upload_date > self.upload_date }.count == 0
169
+ testing ||= "Internal"
170
+ end
171
+ end
172
+
173
+ if (Time.at(self.internal_expiry_date / 1000) > Time.now)
174
+ testing ||= "Inactive"
175
+ else
176
+ testing = "Expired"
177
+ end
178
+
179
+ return testing
180
+ end
181
+
160
182
  # This will cancel the review process for this TestFlight build
161
183
  def cancel_beta_review!
162
184
  client.remove_testflight_build_from_review!(app_id: self.build_train.application.apple_id,
@@ -14,6 +14,19 @@ module Spaceship
14
14
  (result || {}).fetch('name', nil)
15
15
  end
16
16
 
17
+ # Converts the langauge "UK English" (user facing) to "English_UK" (value)
18
+ def from_itc_readable_to_itc(from)
19
+ readable_mapping.each do |key, value|
20
+ return key if value == from
21
+ end
22
+ nil
23
+ end
24
+
25
+ # Converts the langauge "English_UK" (value) to "UK English" (user facing)
26
+ def from_itc_to_itc_readable(from)
27
+ readable_mapping[from]
28
+ end
29
+
17
30
  private
18
31
  # Path to the gem to fetch resoures
19
32
  def spaceship_gem_path
@@ -28,6 +41,10 @@ module Spaceship
28
41
  def mapping
29
42
  @languages ||= JSON.parse(File.read(File.join(spaceship_gem_path, "lib", "assets", "languageMapping.json")))
30
43
  end
44
+
45
+ def readable_mapping
46
+ @readable ||= JSON.parse(File.read(File.join(spaceship_gem_path, "lib", "assets", "languageMappingReadable.json")))
47
+ end
31
48
  end
32
49
  end
33
50
  end
@@ -149,7 +149,7 @@ module Spaceship
149
149
  data['versionString']['value'] = version
150
150
  data['newApp']['name']['value'] = name
151
151
  data['newApp']['bundleId']['value'] = bundle_id
152
- data['newApp']['primaryLanguage']['value'] = primary_language || 'English_CA'
152
+ data['newApp']['primaryLanguage']['value'] = primary_language || 'English'
153
153
  data['newApp']['vendorId']['value'] = sku
154
154
  data['newApp']['bundleIdSuffix']['value'] = bundle_id_suffix
155
155
 
@@ -278,7 +278,7 @@ module Spaceship
278
278
  current['feedbackEmail']['value'] = feedback_email
279
279
  current['marketingUrl']['value'] = marketing_url
280
280
  current['privacyPolicyUrl']['value'] = privacy_policy_url
281
- current["pageLanguageValue"] = current['language'] # could iTunes Connect be any more buggy? This is required for some reason
281
+ current['pageLanguageValue'] = current['language'] # There is no valid reason why we need this, only iTC being iTC
282
282
  end
283
283
  build_info['testInfo']['reviewFirstName']['value'] = first_name
284
284
  build_info['testInfo']['reviewLastName']['value'] = last_name
@@ -1,3 +1,3 @@
1
1
  module Spaceship
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spaceship
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Natchev
@@ -205,6 +205,7 @@ files:
205
205
  - LICENSE
206
206
  - README.md
207
207
  - lib/assets/languageMapping.json
208
+ - lib/assets/languageMappingReadable.json
208
209
  - lib/spaceship.rb
209
210
  - lib/spaceship/base.rb
210
211
  - lib/spaceship/client.rb