spaceship 0.19.1 → 0.19.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: 4c40879ad0c738029f303c172a1212db068e4df7
4
- data.tar.gz: a8f4120544500767bdf36f58d990f44f002beded
3
+ metadata.gz: c3bf9dd05d81a6abd26ea7c1c92fe391a21fead6
4
+ data.tar.gz: 8a3416e6fdc98ed27a59014dbb8a8f1a34bc668e
5
5
  SHA512:
6
- metadata.gz: 914e806100ebb6edba58d80b7567fe18180ac36d13e72560b7791ffbc86a61bfd32293c909b781424eb9d8101fbae36b4d129507d3d4be13a26d8fc586b7a368
7
- data.tar.gz: 8ff9ba50fc4c241973a53da1a15a01416189747ea9783b71f0c343a2bf7661f2b9537e614d00d501dec6f24def8a2ec0cd781583d049d4994475686745eca2ff
6
+ metadata.gz: c46595feaf1b4c8e39f578eb271653b89617b0e15395ae4c949cafda4acf846a1fc443d8306da7056cd049468554123a5bebd7bcf8519acb4932f397ae264297
7
+ data.tar.gz: 2fa7bf1a5c6297f4767318d80987cfafd8233a3ca936cffec85d9d873e08fb0b5694d4235b3402138f22a78152d67540866cd0011d6ff2982e3543c89c2d5ba9
@@ -1,8 +1,8 @@
1
1
  require 'faraday' # HTTP Client
2
2
  require 'logger'
3
3
  require 'faraday_middleware'
4
- require 'faraday-cookie_jar'
5
4
  require 'spaceship/ui'
5
+ require 'spaceship/helper/cookie_jar_middleware'
6
6
  require 'spaceship/helper/plist_middleware'
7
7
  require 'spaceship/helper/net_http_generic_request'
8
8
 
@@ -66,12 +66,12 @@ module Spaceship
66
66
  end
67
67
 
68
68
  def initialize
69
- @cookie = HTTP::CookieJar.new
69
+ @cookie_jar = CookieJar::Jar.new
70
70
  @client = Faraday.new(self.class.hostname) do |c|
71
71
  c.response :json, content_type: /\bjson$/
72
72
  c.response :xml, content_type: /\bxml$/
73
73
  c.response :plist, content_type: /\bplist$/
74
- c.use :cookie_jar, jar: @cookie
74
+ c.use :cookie_jar, jar: @cookie_jar
75
75
  c.adapter Faraday.default_adapter
76
76
 
77
77
  if ENV['DEBUG']
@@ -108,7 +108,8 @@ module Spaceship
108
108
  #
109
109
  # @return (String) the cookie-string in the RFC6265 format: https://tools.ietf.org/html/rfc6265#section-4.2.1
110
110
  def cookie
111
- @cookie.map(&:to_s).join(';')
111
+ # this gets the cookie for allowed under the entire apple domain
112
+ @cookie_jar.get_cookie_header('https://apple.com/')
112
113
  end
113
114
 
114
115
  #####################################################
@@ -0,0 +1,34 @@
1
+ require 'cookiejar'
2
+
3
+ module Faraday
4
+ class CookieJar < Faraday::Middleware
5
+ def initialize(app, options = {})
6
+ super(app)
7
+ @jar = options[:jar] || CookieJar::Jar.new
8
+ end
9
+
10
+ def call(env)
11
+ cookies = @jar.get_cookies(env[:url])
12
+
13
+ unless cookies.empty?
14
+ if env[:request_headers]["Cookie"]
15
+ env[:request_headers]["Cookie"] = @jar.get_cookie_header(env[:url]) + ";" + env[:request_headers]["Cookie"]
16
+ else
17
+ env[:request_headers]["Cookie"] = @jar.get_cookie_header(env[:url])
18
+ end
19
+ end
20
+
21
+ @app.call(env).on_complete do |res|
22
+ if res[:response_headers]
23
+ @jar.set_cookies_from_headers(env[:url], res[:response_headers])
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+
30
+ if Faraday.respond_to?(:register_middleware)
31
+ Faraday.register_middleware cookie_jar: -> { Faraday::CookieJar }
32
+ elsif Faraday::Middleware.respond_to?(:register_middleware)
33
+ Faraday::Middleware.register_middleware cookie_jar: Faraday::CookieJar
34
+ end
@@ -710,10 +710,10 @@ module Spaceship
710
710
  value: email
711
711
  },
712
712
  firstName: {
713
- value: first_name
713
+ value: first_name || ""
714
714
  },
715
715
  lastName: {
716
- value: last_name
716
+ value: last_name || ""
717
717
  },
718
718
  testing: {
719
719
  value: true
@@ -1,3 +1,3 @@
1
1
  module Spaceship
2
- VERSION = "0.19.1"
2
+ VERSION = "0.19.2"
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.19.1
4
+ version: 0.19.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-01-15 00:00:00.000000000 Z
12
+ date: 2016-01-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: credentials_manager
@@ -82,33 +82,33 @@ dependencies:
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0.9'
84
84
  - !ruby/object:Gem::Dependency
85
- name: faraday-cookie_jar
85
+ name: fastimage
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: 0.0.6
90
+ version: '1.6'
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 0.0.6
97
+ version: '1.6'
98
98
  - !ruby/object:Gem::Dependency
99
- name: fastimage
99
+ name: cookiejar
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '1.6'
104
+ version: '0.3'
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '1.6'
111
+ version: '0.3'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: pry
114
114
  requirement: !ruby/object:Gem::Requirement
@@ -270,6 +270,7 @@ files:
270
270
  - lib/spaceship/du/du_client.rb
271
271
  - lib/spaceship/du/upload_file.rb
272
272
  - lib/spaceship/du/utilities.rb
273
+ - lib/spaceship/helper/cookie_jar_middleware.rb
273
274
  - lib/spaceship/helper/net_http_generic_request.rb
274
275
  - lib/spaceship/helper/plist_middleware.rb
275
276
  - lib/spaceship/launcher.rb