feedium 0.1.9 → 0.1.10

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: c30edaee350209df22641b98d9a71c5304052d65
4
- data.tar.gz: 283e0d3c69211aa2bda023102b49cd16be590407
3
+ metadata.gz: 2ec2276acccb807bb6b7c6770ff633b917e9e046
4
+ data.tar.gz: cf9fd980c6d2bedba3fb07445339193e9b1bb855
5
5
  SHA512:
6
- metadata.gz: 64ed566cf25077d6956c79b7dfcea583014dddfb02763da53e021d5c56a2e86e645a4ddf48a304ac962a51926fc2609570454fb10bb8fdb046219535f8e2fb67
7
- data.tar.gz: d6df389edbe20371e837080700105eab42ae75ed6e9a90d672db027b1081c91eeb2ca606bcaf2a0495d4b96ec116a4c3b8531eb71af0111c16beed851a70d58b
6
+ metadata.gz: d5019a68a590f23cbc911492686b1b9fb6df7b6708d8939a6fd2489f6683708e55b7d141651451613dc4df2bce25867b6343fa05b65a56cf9b91c1b9f1d57557
7
+ data.tar.gz: ee365e55e7c7cc62840f567c628502eecc22780db133c25a55551238f71f408c094ac3a416687a467db751a8fc0ee8d11483b4a42b5ffc465279ae5a466bab7c
@@ -1,3 +1,3 @@
1
1
  module Feedium
2
- VERSION = '0.1.9'
2
+ VERSION = '0.1.10'
3
3
  end
data/lib/feedium.rb CHANGED
@@ -20,6 +20,14 @@ module Feedium
20
20
  ).freeze
21
21
 
22
22
  def self.find(url)
23
+ begin
24
+ uri = URI.parse(url.index('http') ? url : "http://#{url}")
25
+ query = uri.query.nil? ? '' : "?#{uri.query}"
26
+ url = "#{uri.scheme}://#{uri.host}#{uri.path}#{query}"
27
+ rescue URI::InvalidURIError => e
28
+ raise Feedium::RequestError.new(e.message)
29
+ end
30
+
23
31
  return @request.url if self.feed?(url)
24
32
 
25
33
  @body = @body || @request.io.read
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feedium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex