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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3bf9dd05d81a6abd26ea7c1c92fe391a21fead6
|
4
|
+
data.tar.gz: 8a3416e6fdc98ed27a59014dbb8a8f1a34bc668e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c46595feaf1b4c8e39f578eb271653b89617b0e15395ae4c949cafda4acf846a1fc443d8306da7056cd049468554123a5bebd7bcf8519acb4932f397ae264297
|
7
|
+
data.tar.gz: 2fa7bf1a5c6297f4767318d80987cfafd8233a3ca936cffec85d9d873e08fb0b5694d4235b3402138f22a78152d67540866cd0011d6ff2982e3543c89c2d5ba9
|
data/lib/spaceship/client.rb
CHANGED
@@ -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
|
-
@
|
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: @
|
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
|
-
|
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
|
data/lib/spaceship/version.rb
CHANGED
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.
|
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-
|
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:
|
85
|
+
name: fastimage
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
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:
|
97
|
+
version: '1.6'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
99
|
+
name: cookiejar
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: '
|
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: '
|
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
|