nethttputils 0.3.3.0 → 0.4.0.0

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: 9afa291d86c40f37b207744ca23c7e12c330e055
4
- data.tar.gz: 3afb6030d76642efed329bdf322c68dbb3eb2d00
3
+ metadata.gz: 90e1643f0b99d5ca39f20bdb3d86aec3c85a8803
4
+ data.tar.gz: 5cfd760c36f4d0d53ed89daaf00ff39006b3422b
5
5
  SHA512:
6
- metadata.gz: a91b3cf20cbb611ff5e77d8efef83b37c01cabe413431dfb7edf7df9fe4c5eae4d92cf177891b04fd2e4a96b399871fcdc9b9afc2d2dd9926101b2321da5f28c
7
- data.tar.gz: 137f44eee308529b23e5c6d9c592801950ddca31e156a6e0010b0a98f34cd8f758d6810143d34c0994b3ff17e42f1cc8a6d7608cdba9b7638c143781822732fa
6
+ metadata.gz: 1a7d31e15dfe0611039ec9649e2a58bef131e79c69facda64a087ba39343c52f07c985c68109430263033119f461ae21bc1049ea78b30a93c9c5f710859552db
7
+ data.tar.gz: 3b299dadd98178e52ac2ce0f3763c03f1619f368296e7991c16f86f8e794023590c05afce2e76f8f75be3767fb15315a3cb85cc87071a605902a7a45b920b7ce
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  language: ruby
3
3
 
4
- script: "ruby lib/nethttputils.rb"
4
+ script: "bundle install && bundle exec ruby lib/nethttputils.rb"
5
5
 
6
6
  os:
7
7
  - linux
@@ -19,3 +19,11 @@ matrix:
19
19
  allow_failures:
20
20
  # something with `NetHTTPUtils.request_data("http://localhost:8000/?1=2&3=4", form: {1=>3})` test
21
21
  - rvm: jruby-head
22
+ - rvm: 2.3
23
+ os: osx
24
+ - rvm: 2.2
25
+ os: osx
26
+ - rvm: 2.1
27
+ os: osx
28
+ - rvm: 2.0
29
+ os: osx
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+ gem "byebug"
3
+ gemspec
@@ -25,8 +25,8 @@ module NetHTTPUtils
25
25
  class << self
26
26
 
27
27
  def remove_tags str
28
- str.gsub(/<script( [a-z]+="[^"]*")*>.*?<\/script>/m, "").
29
- gsub(/<style( [a-z]+="[^"]*")*>.*?<\/style>/m, "").
28
+ str.gsub(/<script( [a-z-]+="[^"]*")*>.*?<\/script>/m, "").
29
+ gsub(/<style( [a-z-]+="[^"]*")*>.*?<\/style>/m, "").
30
30
  gsub(/<[^>]*>/, "").split(?\n).map(&:strip).reject(&:empty?).join(?\n)
31
31
  end
32
32
 
@@ -217,7 +217,8 @@ module NetHTTPUtils
217
217
  case response.code
218
218
  when /\A30\d\z/
219
219
  logger.info "redirect: #{response["location"]}"
220
- new_uri = URI.join request.uri, response["location"]
220
+ require "addressable"
221
+ new_uri = URI.join request.uri.to_s, Addressable::URI.escape(response["location"])
221
222
  new_host = new_uri.host
222
223
  raise Error.new "redirected in place" if new_uri == http.instance_variable_get(:@uri)
223
224
  if http.address != new_host ||
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "nethttputils"
3
- spec.version = "0.3.3.0"
3
+ spec.version = "0.4.0.0"
4
4
  spec.summary = "this tool is like a pet that I adopted young and now I depend on, sorry"
5
5
  spec.description = <<-EOF
6
6
  Back in 2015 I was a guy automating things at my job and two scripts had a common need --
@@ -22,4 +22,6 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.require_path = "lib"
24
24
  spec.files = `git ls-files -z`.split(?\0) - spec.test_files
25
+
26
+ spec.add_dependency "addressable"
25
27
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nethttputils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3.0
4
+ version: 0.4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Maslov aka Nakilon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-08 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2020-01-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: addressable
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: |2
14
28
  Back in 2015 I was a guy automating things at my job and two scripts had a common need --
15
29
  they both had to pass the same credentials to Jenkins (via query params, I guess).
@@ -27,6 +41,7 @@ extensions: []
27
41
  extra_rdoc_files: []
28
42
  files:
29
43
  - ".travis.yml"
44
+ - Gemfile
30
45
  - LICENSE
31
46
  - Rakefile
32
47
  - lib/nethttputils.rb