squash_matrix 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/squash_matrix/client.rb +5 -5
- data/lib/squash_matrix/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14e559246c6a92e015ce8a76917ebbf825c34ef3cae0694ec1c8a89fb67856b9
|
4
|
+
data.tar.gz: d5d6347fde23dd27cb1b2ed8eca63ea1c06e9b11f8efaecede84711b708b986f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9e4300e547a26cc3d8b9c7dad8226dacb0ac3db4d28a2da8545e4681c68dece3d47cedb378fcb84eeb0742aedc9987840190fea09df769424143af6d4d04323
|
7
|
+
data.tar.gz: e62b6aaa4ca9561b379f21e9fe6514771dc400734ae67771207f2f8f01d4062e5deec56c95b99a6097d1fd0ef43901f6c46d811393e21302d30339a54f84198c
|
data/lib/squash_matrix/client.rb
CHANGED
@@ -48,13 +48,13 @@ module SquashMatrix
|
|
48
48
|
@user_agent = user_agent || UserAgentRandomizer::UserAgent.fetch(type: 'desktop_browser').string
|
49
49
|
@squash_matrix_home_uri = URI::HTTP.build(host: SquashMatrix::Constants::SQUASH_MATRIX_URL)
|
50
50
|
@suppress_errors = suppress_errors
|
51
|
-
@timeout = timeout
|
51
|
+
@timeout = timeout&.to_i
|
52
52
|
return unless [player || email, password].none?(&:nil?)
|
53
53
|
@cookie_jar = HTTP::CookieJar.new
|
54
|
-
@player = player
|
54
|
+
@player = player&.to_i
|
55
55
|
@email = email
|
56
56
|
@password = password
|
57
|
-
@expires = expires && Time.parse(expires).utc
|
57
|
+
@expires = !expires.to_s.empty? && Time.parse(expires).utc
|
58
58
|
if cookie && @expires > Time.now.utc
|
59
59
|
cookie.split('; ').each do |v|
|
60
60
|
@cookie_jar.parse(v, @squash_matrix_home_uri)
|
@@ -220,8 +220,8 @@ module SquashMatrix
|
|
220
220
|
@cookie_jar.parse(v, @squash_matrix_home_uri)
|
221
221
|
end
|
222
222
|
@expires ||= Time.now.utc + 60 * 60 * 24 * 2 # default expires in two days (usually 52 hours)
|
223
|
-
@player = SquashMatrix::Constants::PLAYER_FROM_PATH_REGEX.match(res[SquashMatrix::Constants::LOCATION_HEADER])[1] if @player.nil? && !res[SquashMatrix::Constants::LOCATION_HEADER].empty?
|
224
|
-
return unless !@suppress_errors && !@cookie_jar&.cookies(@squash_matrix_home_uri)&.find { |c| c.name == SquashMatrix::Constants::ASPXAUTH_COOKIE_NAME && !c.value.empty? }
|
223
|
+
@player = SquashMatrix::Constants::PLAYER_FROM_PATH_REGEX.match(res[SquashMatrix::Constants::LOCATION_HEADER])[1] if @player.nil? && !res[SquashMatrix::Constants::LOCATION_HEADER].to_s.empty?
|
224
|
+
return unless !@suppress_errors && !@cookie_jar&.cookies(@squash_matrix_home_uri)&.find { |c| c.name == SquashMatrix::Constants::ASPXAUTH_COOKIE_NAME && !c.value.to_s.empty? }
|
225
225
|
error_string = SquashMatrix::NokogiriParser.get_log_on_error(res.body).join(', ')
|
226
226
|
raise SquashMatrix::Errors::AuthorizationError, error_string
|
227
227
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squash_matrix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Wilkosz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|