twingly-url 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0bef38a1195e09028dc139154dd6f7a833c9b91
4
- data.tar.gz: 9abaafbd41a71c382f9833ddd6f9fcf5cd9ce08c
3
+ metadata.gz: de58b5c64bf51bf6e4028750a38ec9953cf7d278
4
+ data.tar.gz: 35419a813b7be1f5971b3949cabbd8ffe5d85a8e
5
5
  SHA512:
6
- metadata.gz: b4e3602b1964b3b2b8f1a37b800f551bf316d8304258aeeb11a1ad43235c2ff81a265a640dbaae25540a9a732145af73543685a4e7f06b5115561d704f37d845
7
- data.tar.gz: 44904c9aeae8aa885019c4fb646e3da8d6206d15ede5990df2371fdbebcf02ede04ae101557e6ee4b7b2d6f73f8f664643f7d0e9239fdb84f54ff520309af175
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
- ERRORS = [
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, :ERRORS
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 *ERRORS => error
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
@@ -1,5 +1,5 @@
1
1
  module Twingly
2
2
  class URL
3
- VERSION = "4.0.0"
3
+ VERSION = "4.1.0"
4
4
  end
5
5
  end
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.0.0
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-02-03 00:00:00.000000000 Z
11
+ date: 2016-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable