rumors-api-client 0.3.2 → 0.3.3

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: 6b768f20d4ad9b8220b11857abdf13fe4c348d67d4431e2748850f8d5648746a
4
- data.tar.gz: cc99f608609c1cdd5fa5424936b07b4aa3b217929b770b16cd5eadcd55613095
3
+ metadata.gz: fb067cb05b25c252c60d953419290b1d824b76af2c15f45252a024d694dde911
4
+ data.tar.gz: 7b6cf354855e5a2114c153794cf49ac6346508bf86ed9f83af4c4f0a0d75eda4
5
5
  SHA512:
6
- metadata.gz: 856a5233785e5d50c2baf37775efd49fe83ab9db38254a8e5f9f311c1fe234ed9898ac1a3e6db2d37544b52f9349308548d9aad235a2c4b8076553bcdad2323a
7
- data.tar.gz: 59f447dfc8b451f074e6fdd5a0a96e25b8f660653f542f16768576d3184db01e0ca29da00962814f995a48643545441928aeccd4acb5d4ab0ddc1ad49e2e47ed
6
+ metadata.gz: 2a3edefc6eb6119d078be33e5d2bb2602c2c90ff17d35073b0e03354221849329891cf2707561c0579eca366c73a171e65397d589ed7fcffd44fc4fa5f16af96
7
+ data.tar.gz: e9f0016e94fb539c6130299055e495d7b5751c8f5ffa83b2396e7f9b4fb23892d5913500073dfeb6ce0412f1e23e63d1325e2b4ff6aee7c61f2de57bf8733e6e
@@ -71,13 +71,21 @@ module Rumors
71
71
 
72
72
  response_uris = response_url.path.split("/").reject { |path| path.empty? }
73
73
  uris = url.path.split("/").reject { |path| path.empty? }
74
- return true if (response_uris & uris) == response_uris
74
+ next unless equal_arrays?(response_uris, uris)
75
+ return true if url.query.nil?
76
+ querys = url.query.split('&')
77
+ response_querys = response_url.query.split('&')
78
+ return true if equal_arrays?(response_querys, querys)
75
79
  end
76
80
  end
77
81
 
78
82
  false
79
83
  end
80
84
 
85
+ def equal_arrays?(this_one, another)
86
+ this_one.size == another.size && (this_one & another) == this_one
87
+ end
88
+
81
89
  def calculate_similarity(contents)
82
90
  # NOTE: https://github.com/jpmckinney/tf-idf-similarity
83
91
  most_like = {
@@ -1,7 +1,7 @@
1
1
  module Rumors
2
2
  module Api
3
3
  module Client
4
- VERSION = "0.3.2"
4
+ VERSION = "0.3.3"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rumors-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carol H
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-08 00:00:00.000000000 Z
11
+ date: 2019-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty