spaceship 0.38.1 → 0.38.2

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: 9ccb25cc6bac20555b7301bc25aae3475b6d2d49
4
- data.tar.gz: b83f4bb660b5e8e67bc695b0a8754e76a2740552
3
+ metadata.gz: 0d6e5eb4de7b6f8e0a32ebbbd5117477d8647f10
4
+ data.tar.gz: 9694bc300c94f5690cfc302a84d863f3639942e0
5
5
  SHA512:
6
- metadata.gz: 8bc3d0c2c3fa385c274841760584d3c174350ad1bb4bf36af481e6178a290c380be765da71fa203c89b89d67d5a030ad92122121ca94fe253288f120d90de3e0
7
- data.tar.gz: c29023f15cad38990e9e1f042e331232f5021172b6617738c9eb74735e75bafc12506dc4cb826a4e3fbc3c430e737ff620da67a394dfb1ffc3d1f703d4db2e6b
6
+ metadata.gz: db4a4ee41976c6396ce0316ea2143c198e0f40acf61599607e923c4957ad1045faec4207cc96d4da4b7e768daec4fb15e73603e94438311b8b2624df0a223338
7
+ data.tar.gz: 84b16e823c2e9e3c77893d74e476bd94921207903100aad5aeb08a3ca07b23d5569acae113e00719fc486fcb10204bd84459c2780c74f2da25f3af5075275ed4
@@ -2,12 +2,14 @@
2
2
  {
3
3
  "locale": "cmn-Hans",
4
4
  "name": "Simplified Chinese",
5
- "game-center": true
5
+ "game-center": true,
6
+ "itc_locale": "zh-Hans"
6
7
  },
7
8
  {
8
9
  "locale": "cmn-Hant",
9
10
  "name": "Traditional Chinese",
10
- "game-center": true
11
+ "game-center": true,
12
+ "itc_locale": "zh-Hant"
11
13
  },
12
14
  {
13
15
  "locale": "da-DK",
@@ -15,7 +17,8 @@
15
17
  "game-center": true,
16
18
  "alternatives": [
17
19
  "da"
18
- ]
20
+ ],
21
+ "itc_locale": "da"
19
22
  },
20
23
  {
21
24
  "locale": "nl-NL",
@@ -66,7 +69,8 @@
66
69
  "game-center": true,
67
70
  "alternatives": [
68
71
  "fi"
69
- ]
72
+ ],
73
+ "itc_locale": "fin"
70
74
  },
71
75
  {
72
76
  "locale": "fr-CA",
@@ -100,7 +104,8 @@
100
104
  "game-center": true,
101
105
  "alternatives": [
102
106
  "el"
103
- ]
107
+ ],
108
+ "itc_locale": "el"
104
109
  },
105
110
  {
106
111
  "locale": "id-ID",
@@ -108,7 +113,8 @@
108
113
  "game-center": true,
109
114
  "alternatives": [
110
115
  "id"
111
- ]
116
+ ],
117
+ "itc_locale": "id"
112
118
  },
113
119
  {
114
120
  "locale": "it-IT",
@@ -116,7 +122,8 @@
116
122
  "game-center": true,
117
123
  "alternatives": [
118
124
  "it"
119
- ]
125
+ ],
126
+ "itc_locale": "it"
120
127
  },
121
128
  {
122
129
  "locale": "ja-JP",
@@ -124,7 +131,8 @@
124
131
  "game-center": true,
125
132
  "alternatives": [
126
133
  "ja"
127
- ]
134
+ ],
135
+ "itc_locale": "ja"
128
136
  },
129
137
  {
130
138
  "locale": "ko-KR",
@@ -132,7 +140,8 @@
132
140
  "game-center": true,
133
141
  "alternatives": [
134
142
  "ko"
135
- ]
143
+ ],
144
+ "itc_locale": "ko"
136
145
  },
137
146
  {
138
147
  "locale": "ms-MY",
@@ -140,7 +149,8 @@
140
149
  "game-center": true,
141
150
  "alternatives": [
142
151
  "ms"
143
- ]
152
+ ],
153
+ "itc_locale": "ms"
144
154
  },
145
155
  {
146
156
  "locale": "no-NO",
@@ -148,7 +158,8 @@
148
158
  "game-center": true,
149
159
  "alternatives": [
150
160
  "no"
151
- ]
161
+ ],
162
+ "itc_locale": "no"
152
163
  },
153
164
  {
154
165
  "locale": "pt-BR",
@@ -169,7 +180,8 @@
169
180
  "game-center": true,
170
181
  "alternatives": [
171
182
  "ru"
172
- ]
183
+ ],
184
+ "itc_locale": "ru"
173
185
  },
174
186
  {
175
187
  "locale": "es-MX",
@@ -195,7 +207,8 @@
195
207
  "game-center": true,
196
208
  "alternatives": [
197
209
  "sv"
198
- ]
210
+ ],
211
+ "itc_locale": "sv"
199
212
  },
200
213
  {
201
214
  "locale": "th-TH",
@@ -203,7 +216,8 @@
203
216
  "game-center": true,
204
217
  "alternatives": [
205
218
  "th"
206
- ]
219
+ ],
220
+ "itc_locale": "th"
207
221
  },
208
222
  {
209
223
  "locale": "tr-TR",
@@ -211,7 +225,8 @@
211
225
  "game-center": true,
212
226
  "alternatives": [
213
227
  "tr"
214
- ]
228
+ ],
229
+ "itc_locale": "tr"
215
230
  },
216
231
  {
217
232
  "locale": "vi-VI",
@@ -219,6 +234,7 @@
219
234
  "game-center": true,
220
235
  "alternatives": [
221
236
  "vi"
222
- ]
237
+ ],
238
+ "itc_locale": "vi"
223
239
  }
224
240
  ]
@@ -6,6 +6,7 @@ require 'spaceship/ui'
6
6
  require 'spaceship/helper/plist_middleware'
7
7
  require 'spaceship/helper/net_http_generic_request'
8
8
  require 'tmpdir'
9
+ require "babosa"
9
10
 
10
11
  Faraday::Utils.default_params_encoder = Faraday::FlatParamsEncoder
11
12
 
@@ -132,6 +132,18 @@ module Spaceship
132
132
  details_for_app(app)
133
133
  end
134
134
 
135
+ def valid_name_for(input)
136
+ latinazed = input.to_slug.transliterate
137
+ latinazed = latinazed.gsub(/[^0-9A-Za-z\d\s]/, '') # remove non-valid characters
138
+ # Check if the input string was modified, since it might be empty now
139
+ # (if it only contained non-latin symbols) or the duplicate of another app
140
+ if latinazed != input
141
+ latinazed << " "
142
+ latinazed << Digest::MD5.hexdigest(input)
143
+ end
144
+ latinazed
145
+ end
146
+
135
147
  def create_app!(type, name, bundle_id, mac: false)
136
148
  # We moved the ensure_csrf to the top of this method
137
149
  # as we got some users with issues around creating new apps
@@ -155,7 +167,7 @@ module Spaceship
155
167
  end
156
168
 
157
169
  params = {
158
- name: name,
170
+ name: valid_name_for(name),
159
171
  teamId: team_id
160
172
  }
161
173
 
@@ -8,6 +8,12 @@ module Spaceship
8
8
  (result || {}).fetch('locale', nil)
9
9
  end
10
10
 
11
+ # Converts the Language "UK English" to itc locale en-GB
12
+ def from_standard_to_itc_locale(from)
13
+ result = mapping.find { |a| a['name'] == from } || {}
14
+ return result['itc_locale'] || result['locale']
15
+ end
16
+
11
17
  # Converts the language short codes: (en-US, de-DE) to the iTC format (English_CA, Brazilian Portuguese)
12
18
  def from_standard_to_itc(from)
13
19
  result = mapping.find { |a| a['locale'] == from || (a['alternatives'] || []).include?(from) }
@@ -47,6 +53,10 @@ class String
47
53
  Spaceship::Tunes::LanguageConverter.from_itc_to_standard(self)
48
54
  end
49
55
 
56
+ def to_itc_locale
57
+ Spaceship::Tunes::LanguageConverter.from_standard_to_itc_locale(self)
58
+ end
59
+
50
60
  def to_full_language
51
61
  Spaceship::Tunes::LanguageConverter.from_standard_to_itc(self)
52
62
  end
@@ -277,7 +277,7 @@ module Spaceship
277
277
  data['name'] = { value: name }
278
278
  data['bundleId'] = { value: bundle_id }
279
279
  data['primaryLanguage'] = { value: primary_language }
280
- data['primaryLocaleCode'] = { value: primary_language.to_language_code }
280
+ data['primaryLocaleCode'] = { value: primary_language.to_itc_locale }
281
281
  data['vendorId'] = { value: sku }
282
282
  data['bundleIdSuffix'] = { value: bundle_id_suffix }
283
283
  data['companyName'] = { value: company_name } if company_name
@@ -1,4 +1,4 @@
1
1
  module Spaceship
2
- VERSION = "0.38.1".freeze
2
+ VERSION = "0.38.2".freeze
3
3
  DESCRIPTION = "Ruby library to access the Apple Dev Center and iTunes Connect".freeze
4
4
  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.38.1
4
+ version: 0.38.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-11-25 00:00:00.000000000 Z
12
+ date: 2016-11-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: credentials_manager
@@ -115,6 +115,20 @@ dependencies:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
117
  version: '1.6'
118
+ - !ruby/object:Gem::Dependency
119
+ name: babosa
120
+ requirement: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ type: :runtime
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
118
132
  - !ruby/object:Gem::Dependency
119
133
  name: colored
120
134
  requirement: !ruby/object:Gem::Requirement
@@ -402,7 +416,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
402
416
  version: '0'
403
417
  requirements: []
404
418
  rubyforge_project:
405
- rubygems_version: 2.4.5.1
419
+ rubygems_version: 2.2.2
406
420
  signing_key:
407
421
  specification_version: 4
408
422
  summary: Ruby library to access the Apple Dev Center and iTunes Connect