squash_matrix 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88789ae3eee0e457e795db28cc4243a48567d325e9e89e206bad10fb35db0bab
4
- data.tar.gz: 9164726d86ae99d833080ecacf7c0ce0ddb948af81cd29ad985a99790741bcaa
3
+ metadata.gz: 14e559246c6a92e015ce8a76917ebbf825c34ef3cae0694ec1c8a89fb67856b9
4
+ data.tar.gz: d5d6347fde23dd27cb1b2ed8eca63ea1c06e9b11f8efaecede84711b708b986f
5
5
  SHA512:
6
- metadata.gz: 1c6699aaa0333a24a262f53990e2dabe0a4058e990b7a386f4c5e6ed2dd7a749582afb24fc38cb15775349342bf8b62e1255985f7904a25080dc0bab5843d27b
7
- data.tar.gz: '09153a6dc3e3ff96f0afaa4ff6ae522caff6af637f6871cda0724997481bbb8a9dc8f09fbae76ef66846af302e36c7a058c099895206aa1c9024b3d99b546238'
6
+ metadata.gz: d9e4300e547a26cc3d8b9c7dad8226dacb0ac3db4d28a2da8545e4681c68dece3d47cedb378fcb84eeb0742aedc9987840190fea09df769424143af6d4d04323
7
+ data.tar.gz: e62b6aaa4ca9561b379f21e9fe6514771dc400734ae67771207f2f8f01d4062e5deec56c95b99a6097d1fd0ef43901f6c46d811393e21302d30339a54f84198c
@@ -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
@@ -1,3 +1,3 @@
1
1
  module SquashMatrix
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  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.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-23 00:00:00.000000000 Z
11
+ date: 2018-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler