linkhum-url 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/lib/linkhum/url.rb +4 -1
  4. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8aa891eed2cfe43008f162c21df1f7f475d6505
4
- data.tar.gz: 08261faca4002474b5632f34a2e0c4feaaa067fc
3
+ metadata.gz: 149759d5df9572e66a76c54488440775366fbdce
4
+ data.tar.gz: ef7fb7cba5c2c8a5af0787c2ee4d83f90eee3303
5
5
  SHA512:
6
- metadata.gz: bf51abd8b3e08070bb62627e69d633ad5801ddb061dbb68461313fd9af1a8b20bb87c2ee8dc534d9ec307c295ff8382202cb44c3122067405e73c96a1c8310d0
7
- data.tar.gz: 032b83a347f6756256306e2f485d87b83fd42e2f7ed452b7a6af551c3f110496d6ad3186057816cc18c11fa10e88c256d05abe39b0154397d1c1283d92364557
6
+ metadata.gz: 4a5e52c506981a6da241325f8e6c461935e6567d05d9724e3939c411258ff008d09b001b39c076d834925373f346f433fd9480d2fd62683f6af9efb18a65722e
7
+ data.tar.gz: f2fbd2619a0e99b92866f703d51ef954e4d4a3952a333d6fcab974e28549dc599eb7092dd933d602959784dc0e45b1bc2b9b6cf05e12d8746ad66364a85b0d2f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.1.2:
2
+
3
+ * Handle explicit port numbers in URLs;
4
+
1
5
  0.1.1:
2
6
 
3
7
  * Handle percent-encoded non-UTF8 query strings: return
data/lib/linkhum/url.rb CHANGED
@@ -17,6 +17,9 @@ module Linkhum
17
17
  end
18
18
  url_encoded[:host] = au.normalized_host
19
19
 
20
+ url_encoded[:port] = au.port ? ":#{au.port}" : ""
21
+ human_readable[:port] = url_encoded[:port]
22
+
20
23
  human_readable[:path] = Addressable::URI.unencode_component(au.path)
21
24
  # this code handles bug in Addressable::URI (up to 2.5.0), which
22
25
  # converts paths to Unicode NFKC (it should only do that for
@@ -59,7 +62,7 @@ module Linkhum
59
62
  userinfo_part = parts[:userinfo] ? "#{parts[:userinfo]}@" : ""
60
63
  query_part = parts[:query] ? "?#{parts[:query]}" : ""
61
64
  fragment_part = parts[:fragment] ? "##{parts[:fragment]}" : ""
62
- "#{parts[:scheme]}://#{userinfo_part}#{parts[:host]}#{parts[:path]}#{query_part}#{fragment_part}"
65
+ "#{parts[:scheme]}://#{userinfo_part}#{parts[:host]}#{parts[:port]}#{parts[:path]}#{query_part}#{fragment_part}"
63
66
  end
64
67
  end
65
68
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linkhum-url
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Makhotkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-04 00:00:00.000000000 Z
11
+ date: 2017-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -80,8 +80,8 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.8'
83
- description: 'Input URL could be both human-readable and URL-encoded. Two URLs are
84
- returned as result: human-readable and URL-encoded'
83
+ description: 'Input URL could be either human-readable, or URL-encoded. Two URLs
84
+ are returned as result: human-readable and URL-encoded.'
85
85
  email: squadette@gmail.com
86
86
  executables: []
87
87
  extensions: []
@@ -104,7 +104,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
105
  - - "~>"
106
106
  - !ruby/object:Gem::Version
107
- version: '2.2'
107
+ version: '2.0'
108
108
  required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - ">="
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.5.1
115
+ rubygems_version: 2.5.2
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: Linkhum-URL creates both URL-encoded and readable versions of URLs