linkhum-url 0.1.7 → 0.1.9

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
- SHA1:
3
- metadata.gz: f4828723c55573337e62de25f8715302fd82faa2
4
- data.tar.gz: 48d3c36a73d00df28cf077158d05140fc27317a0
2
+ SHA256:
3
+ metadata.gz: 590545b8c0e80193622074b125f5f3a4c82f6379bcf6ad109d30a3a0f8d84493
4
+ data.tar.gz: ed82b9cba1e0b4e152213f5213b9917e9286558b93f8432626ad85c62cd9974b
5
5
  SHA512:
6
- metadata.gz: 005426d3dcdffcd884486064fd67c3211a9ad599c399631b575a5683617631218609a3cfcaaf22ff85667398c03357102a00f5030b343c923218fbb5d5300c5a
7
- data.tar.gz: 50a941aa4b8d1776ebac7f909a491e5ebeb2235d13ad70bb20bafe192c7938e4970994229cda243dd1bafe529e60d2d1363445ae2534682a851462dff8169ec7
6
+ metadata.gz: 06eb89a2710ae3ceed95fa9ee03b0353808d2a5591904e77091f81780cedfa718a0b32110a2411dc1b55d86da2ebd7bee7f07a67432c83f5171c7b868dec8505
7
+ data.tar.gz: 82c0caa1f5716fda19ecf58daaa2e0915c60c580955db2df9d1ea3e4fc18eee77f5f8dfeac3556e914973602599057995cb2b00901bed3d7c3661692292c6282
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ 0.1.9:
2
+
3
+ * support Ruby 3.0;
4
+
5
+ 0.1.8:
6
+
7
+ * handle invalid UTF-8 in percent-encoded paths;
8
+
1
9
  0.1.7:
2
10
 
3
11
  * percent-encode square brackets in :url_encoded part of the result, because of HTTParty;
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2016-2017 Alexey Makhotkin
3
+ Copyright (c) 2016-2019 Alexey Makhotkin
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -10,8 +10,6 @@ scenes `addressable` gem is used to handle actual URL parsing.
10
10
  This is a sister gem to
11
11
  [`linkhum`](https://github.com/zverok/linkhum).
12
12
 
13
- [![Build Status](https://travis-ci.org/squadette/linkhum-url.svg?branch=master)](https://travis-ci.org/squadette/linkhum-url)
14
-
15
13
  ## Usage
16
14
 
17
15
  `linkhum-url` has only one method: `Linkhum::URL.parse(url)`. It
@@ -33,8 +31,9 @@ embedding etc.
33
31
 
34
32
  ## Install
35
33
 
36
- $ sudo apt-get install idn # Debian/Ubuntu
37
- $ brew install libidn # Mac OS X
34
+ $ sudo apt-get install libidn11 libidn11-dev # Ubuntu Xenial
35
+ $ sudo apt-get install idn # Older Debian/Ubuntu
36
+ $ brew install libidn # Mac OS X
38
37
 
39
38
  $ gem install linkhum-url
40
39
 
@@ -42,4 +41,4 @@ embedding etc.
42
41
 
43
42
  `linkhum-url` released under MIT License.
44
43
 
45
- Copyright (C) Alexey Makhotkin, 2016-2017.
44
+ Copyright (C) Alexey Makhotkin, 2016-2019.
data/lib/linkhum/url.rb CHANGED
@@ -30,6 +30,11 @@ module Linkhum
30
30
  end
31
31
  au_path.force_encoding(Encoding::ASCII_8BIT)
32
32
  url_encoded[:path] = encode_component(au_path)
33
+ decoded_path = human_readable[:path].dup
34
+ if !decoded_path.force_encoding(Encoding::UTF_8).valid_encoding?
35
+ human_readable[:path] = au.path
36
+ end
37
+
33
38
  human_readable[:query] = unencode_component(au.query, false)
34
39
  if au.query
35
40
  decoded_query = human_readable[:query].dup
@@ -37,7 +42,6 @@ module Linkhum
37
42
  human_readable[:query] = au.query
38
43
  end
39
44
  end
40
-
41
45
  if au.query
42
46
  # see above
43
47
  au_query = au.query.dup
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.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Makhotkin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-17 00:00:00.000000000 Z
11
+ date: 2023-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -67,19 +67,19 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: travis
70
+ name: json
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.8'
75
+ version: 2.6.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.8'
82
+ version: 2.6.0
83
83
  description: 'Input URL could be either human-readable, or URL-encoded. Two URLs
84
84
  are returned as result: human-readable and URL-encoded.'
85
85
  email: squadette@gmail.com
@@ -96,24 +96,23 @@ homepage: http://rubygems.org/gems/linkhum-url
96
96
  licenses:
97
97
  - MIT
98
98
  metadata: {}
99
- post_install_message:
99
+ post_install_message:
100
100
  rdoc_options: []
101
101
  require_paths:
102
102
  - lib
103
103
  required_ruby_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - "~>"
105
+ - - ">="
106
106
  - !ruby/object:Gem::Version
107
- version: '2.0'
107
+ version: '2.00'
108
108
  required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
113
  requirements: []
114
- rubyforge_project:
115
- rubygems_version: 2.6.10
116
- signing_key:
114
+ rubygems_version: 3.2.3
115
+ signing_key:
117
116
  specification_version: 4
118
117
  summary: Linkhum-URL creates both URL-encoded and readable versions of URLs
119
118
  test_files: []