blackstack_commons 1.1.46 → 1.1.50

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/functions.rb +9 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6b57c738f8499ebc38d5be99f5937759baf7123
4
- data.tar.gz: 3de3276efe5a38ade0c72d40b480643e88b290c5
3
+ metadata.gz: 7ec175d955b30420b67d76efa7c92a09e356310d
4
+ data.tar.gz: 948668ffae79fd5d4d0db020f1286e6b2b1b9e54
5
5
  SHA512:
6
- metadata.gz: cc67e56c192e0ea1686716022bdb587653d0ccfdd0523111fc9f8f31bf5f4361ab4e557ee890115408660a5d9845a4dcfd528dba5f517984c2559fd8f8c8a785
7
- data.tar.gz: 59c77ba407a165cabb412d010fc3dcb2c4cd81a038d37e367a60feae1e469ced9570aa48439e6db5436b81b72aa4f824629de57f32640630afee4de75374ebd5
6
+ metadata.gz: d5645bda43346622b2be2d14c213e3e173844f4ce48860efeb47283f50bb30b59ede997f986225b6040a12ecd9483983e8ffbfcedfbac5cbdc961c0ed356b20b
7
+ data.tar.gz: 528e8322b7d41cb504c44175a95c6e1ad3ee3b99ef55caeddf8e000dd50bf67bc650cb38621f7f748aa1e28634da4c0fb245b5b56e92e44aeb5afcd5d1a10fe7
data/lib/functions.rb CHANGED
@@ -155,7 +155,13 @@ module BlackStack
155
155
  MATCH_DOMAIN = /(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,10}/
156
156
  MATCH_DATE_STANDARD = /\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])/
157
157
  MATCH_PHONE = /(?:\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}/
158
- MATCH_URL = /(https?:\/\/)?([\da-z\.-]+)(\.)([\da-z]{2,6})(\/[\da-z\.-]*[\da-z])*(\/)?/
158
+
159
+ # Note: MATCH_URL gets the URL up to '?', but it doesn't retrieves the parameters.
160
+ # Exmaple:
161
+ # https://foo.com/bar?param1=value1&param2=value2 --> https://foo.com/bar?
162
+ # https://foo.com/bar/?param1=value1&param2=value2 --> https://foo.com/bar/?
163
+ MATCH_URL = /(https?:\/\/)?([\da-z\.-]+)([\.\:])([\da-z]{2,6})([\/[\da-z\.\-]+]*[\da-z])(\/)?(\?)?/i
164
+
159
165
  MATCH_LINKEDIN_COMPANY_URL = /(https?:\/\/)?(www\\.)?linkedin\.com\/company\//
160
166
  MATCH_FIXNUM = /[0-9]+/
161
167
  MATCH_CONTENT_SPINNING = /{[^}]+}/
@@ -567,6 +573,7 @@ module BlackStack
567
573
  # ssl_verify_mode: you can disabele SSL verification here.
568
574
  # max_channels: this method use lockfiles to prevent an excesive number of API calls from each datacenter. There is not allowed more simultaneous calls than max_channels.
569
575
  # TODO: setup max_simultaneus_calls in the configurtion file.
576
+ # TODO: parameter support_redirections has been deprecated.
570
577
  def self.call_post(url, params = {}, ssl_verify_mode=BlackStack::Netting::DEFAULT_SSL_VERIFY_MODE, support_redirections=true)
571
578
  =begin
572
579
  # build the lockfile name
@@ -591,7 +598,7 @@ module BlackStack
591
598
  res = http.request req
592
599
  case res
593
600
  when Net::HTTPSuccess then res
594
- when Net::HTTPRedirection then BlackStack::Netting::call_post(URI(res['location']), params, BlackStack::Netting::DEFAULT_SSL_VERIFY_MODE, false) if support_redirections
601
+ #when Net::HTTPRedirection then BlackStack::Netting::call_post(URI(res['location']), params, BlackStack::Netting::DEFAULT_SSL_VERIFY_MODE, false) if support_redirections
595
602
  else
596
603
  res.error!
597
604
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blackstack_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.46
4
+ version: 1.1.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-29 00:00:00.000000000 Z
11
+ date: 2022-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: content_spinning