spaceship 0.38.3 → 0.38.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
  SHA1:
3
- metadata.gz: aae5d35a4c23744e481a23cef1fa491b14776c3e
4
- data.tar.gz: 1731dad227784f370063203f9872696dd7214669
3
+ metadata.gz: 5a0b40b9749f12ba27a122c73293eca70cbd3126
4
+ data.tar.gz: a7e094dd79ed180c483b6dcf311d09c8d1321aa4
5
5
  SHA512:
6
- metadata.gz: 32170186f60ac67542177b62e63f08ff6add6de77c2e151856127c756ff8491c1a497b83f778c4b6143f7631901594583bbc8f575a244c7a45af5577097f1ac8
7
- data.tar.gz: 698b62cd941759dfc62c57ef01c9acaccc356f0aef9ca2b8f13244130cc7eb10e9d551d80a772fd80906af769e0f8d5edb1b232ac67aebbcc89cb4186cabf73c
6
+ metadata.gz: 9505aee9d3c1cd29fb389d22cad898c21d4c044b0061f5d6e842064bdc26d8aeb52a0f5c72586894f10910e4c79f0fa019289499872c3b07cda46fb7cc253bd0
7
+ data.tar.gz: 19be4b30b6ddf123b5b6794f288d3e44570862a5ed8fe9283f5dbe29d97d13ea9f7d07059913a049e16bf70584ac450234ffc39f76c42558ff7a170ccae56e0f
@@ -0,0 +1,28 @@
1
+ # Babosa has a conflict with the unicode-string_width gem. unicode-string_width defines
2
+ # a module called `Unicode`, but Babosa uses the presence of this constant as
3
+ # the sign that it should try to require the `unicode` gem, which will not be present.
4
+ #
5
+ # We don't want to introduce the `unicode` gem because it depends on native extensions.
6
+ #
7
+ # This works around the possibility that the unicode-string_width gem may already be
8
+ # loaded by temporarily undefining the `Unicode` constant while we load Babosa,
9
+ # then restoring it to its previous state if necessary.
10
+ class BabosaFix
11
+ def apply
12
+ unicode_removed = false
13
+
14
+ if defined? Unicode
15
+ orig_unicode = Unicode
16
+ Object.send(:remove_const, :Unicode)
17
+ unicode_removed = true
18
+ end
19
+
20
+ require 'babosa'
21
+
22
+ if unicode_removed
23
+ Object.send(:const_set, :Unicode, orig_unicode)
24
+ end
25
+ end
26
+ end
27
+
28
+ BabosaFix.new.apply
@@ -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 'spaceship/babosa_fix'
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
+ latinized = input.to_slug.transliterate
137
+ latinized = latinized.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 latinized != input
141
+ latinized << " "
142
+ latinized << Digest::MD5.hexdigest(input)
143
+ end
144
+ latinized
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
 
@@ -195,7 +207,7 @@ module Spaceship
195
207
  ensure_csrf(Spaceship::AppGroup)
196
208
 
197
209
  r = request(:post, 'account/ios/identifiers/addApplicationGroup.action', {
198
- name: name,
210
+ name: valid_name_for(name),
199
211
  identifier: group_id,
200
212
  teamId: team_id
201
213
  })
@@ -1,4 +1,4 @@
1
1
  module Spaceship
2
- VERSION = "0.38.3".freeze
2
+ VERSION = "0.38.4".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.3
4
+ version: 0.38.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -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: 1.0.2
125
+ type: :runtime
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '='
130
+ - !ruby/object:Gem::Version
131
+ version: 1.0.2
118
132
  - !ruby/object:Gem::Dependency
119
133
  name: colored
120
134
  requirement: !ruby/object:Gem::Requirement
@@ -328,6 +342,7 @@ files:
328
342
  - lib/assets/languageMapping.json
329
343
  - lib/assets/languageMappingReadable.json
330
344
  - lib/spaceship.rb
345
+ - lib/spaceship/babosa_fix.rb
331
346
  - lib/spaceship/base.rb
332
347
  - lib/spaceship/client.rb
333
348
  - lib/spaceship/du/du_client.rb
@@ -402,7 +417,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
402
417
  version: '0'
403
418
  requirements: []
404
419
  rubyforge_project:
405
- rubygems_version: 2.2.2
420
+ rubygems_version: 2.5.1
406
421
  signing_key:
407
422
  specification_version: 4
408
423
  summary: Ruby library to access the Apple Dev Center and iTunes Connect