twingly-url 4.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/twingly/url.rb +15 -3
- data/lib/twingly/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de58b5c64bf51bf6e4028750a38ec9953cf7d278
|
4
|
+
data.tar.gz: 35419a813b7be1f5971b3949cabbd8ffe5d85a8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8588aa6fb7ec19a7959bb4f14c77ec503a5d333637e6de043e1256e202e78921c4cf47d11b4b1568589293d2d56b64e322bfeaf550b7117de74f57b98c542232
|
7
|
+
data.tar.gz: 892b16cdfea1ca8843867e84b2a8612fc68b50eebdd6db585ef42efc58be17df38138f880a734695655ae139f7861f2a9feff7b8500a907f979d7de51ec58da3
|
data/README.md
CHANGED
@@ -42,11 +42,11 @@ Note that this isn't a benchmark, we're using [ruby-prof] which will slow things
|
|
42
42
|
|
43
43
|
## Release workflow
|
44
44
|
|
45
|
-
* Bump the version in `lib/twingly/version.rb
|
45
|
+
* Bump the version in `lib/twingly/version.rb` in a commit, no need to push (the release task does that).
|
46
46
|
|
47
47
|
* Make sure you are logged in as [twingly][twingly-rubygems] at RubyGems.org.
|
48
48
|
|
49
|
-
* Build and [publish](http://guides.rubygems.org/publishing/) the gem.
|
49
|
+
* Build and [publish](http://guides.rubygems.org/publishing/) the gem. This will create the proper tag in git, push the commit and tag and upload to RubyGems.
|
50
50
|
|
51
51
|
bundle exec rake release
|
52
52
|
|
data/lib/twingly/url.rb
CHANGED
@@ -14,13 +14,13 @@ module Twingly
|
|
14
14
|
|
15
15
|
ACCEPTED_SCHEMES = /\Ahttps?\z/i
|
16
16
|
ENDS_WITH_SLASH = /\/+$/
|
17
|
-
|
17
|
+
ERRORS_TO_EXTEND = [
|
18
18
|
Addressable::URI::InvalidURIError,
|
19
19
|
PublicSuffix::DomainInvalid,
|
20
20
|
IDN::Idna::IdnaError,
|
21
21
|
]
|
22
22
|
|
23
|
-
private_constant :ACCEPTED_SCHEMES, :ENDS_WITH_SLASH, :
|
23
|
+
private_constant :ACCEPTED_SCHEMES, :ENDS_WITH_SLASH, :ERRORS_TO_EXTEND
|
24
24
|
|
25
25
|
class << self
|
26
26
|
def parse(potential_url)
|
@@ -44,7 +44,7 @@ module Twingly
|
|
44
44
|
raise Twingly::URL::Error::ParseError if public_suffix_domain.sld.nil?
|
45
45
|
|
46
46
|
new(addressable_uri, public_suffix_domain)
|
47
|
-
rescue *
|
47
|
+
rescue *ERRORS_TO_EXTEND => error
|
48
48
|
error.extend(Twingly::URL::Error)
|
49
49
|
raise
|
50
50
|
end
|
@@ -153,6 +153,18 @@ module Twingly
|
|
153
153
|
(path.empty?) ? "/" : path
|
154
154
|
end
|
155
155
|
|
156
|
+
def userinfo
|
157
|
+
addressable_uri.userinfo.to_s
|
158
|
+
end
|
159
|
+
|
160
|
+
def user
|
161
|
+
addressable_uri.user.to_s
|
162
|
+
end
|
163
|
+
|
164
|
+
def password
|
165
|
+
addressable_uri.password.to_s
|
166
|
+
end
|
167
|
+
|
156
168
|
def valid?
|
157
169
|
true
|
158
170
|
end
|
data/lib/twingly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twingly-url
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Twingly AB
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|