feedium 0.1.2 → 0.1.3

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: 3b8959077198b32bcd2e348dd6c444c4101b16c7
4
- data.tar.gz: 903d0725fce0c322f37c6abe5bcda1b6a57db4fa
3
+ metadata.gz: ebd48989de1a50ea6c22f003ccf6388b6492f18f
4
+ data.tar.gz: 4426c257985aa7c3bad77ec43b5272a338636df8
5
5
  SHA512:
6
- metadata.gz: 3a54ec18118e3c0edcd7539680642a22d170b0423d83bce346178160fa64307419460016b47b3e6f4d0648df761b115eeb20fe4351649276f394bfe0fe390d64
7
- data.tar.gz: 7cd2bc64920ec54655ef6e210465c0b244f0578d6e08ed5c6d329fa98204ffb5597a8dd5cbadfe546993c072242f19e57dc22fb9f1d728d421be68fa01197357
6
+ metadata.gz: 16ba4f8fe6757980dff6076659b52a90aa315ea32feceb7702b7484436285c63776009c1964da612e40c65cba247209f294f37422244c8d958b648094e0cfa57
7
+ data.tar.gz: cc416ceea25aa40eec0b1ffaa1534aa6f29ceadfdd2508f30179aa47c0ad4a3c9e7bd7e8efb9149ce300841c110e22c3e70f3cce7fb0a97db4f7ef9154525a12
data/examples/parse.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
2
2
  require File.join(dir, 'feedium')
3
3
 
4
- puts Feedium.parse('http://mangastream.com/rss')
4
+ # puts Feedium.parse('http://mangastream.com/rss')
5
+ puts Feedium.parse('https://mrmondialisation.org/feed/')
@@ -19,17 +19,23 @@ class Feedium::Request
19
19
 
20
20
  raise Feedium::RequestError.new('Not valid url') unless @url =~ URI_REQEX
21
21
 
22
- @io = open(url, {
23
- allow_redirections: :all,
24
- read_timeout: 10,
25
- open_timeout: 10,
26
- content_length_proc: ->(size) {
27
- raise Feedium::RequestError.new('File Too Large') if size && size > MAX_CONTENT_SIZE
28
- },
29
- progress_proc: ->(size) {
30
- raise Feedium::RequestError.new('File Too Large') if size > MAX_CONTENT_SIZE
31
- },
32
- 'User-Agent' => 'Feedium'
33
- })
22
+ begin
23
+ @io = open(url, {
24
+ allow_redirections: :all,
25
+ read_timeout: 10,
26
+ open_timeout: 10,
27
+ content_length_proc: ->(size) {
28
+ raise Feedium::RequestError.new('File Too Large') if size && size > MAX_CONTENT_SIZE
29
+ },
30
+ progress_proc: ->(size) {
31
+ raise Feedium::RequestError.new('File Too Large') if size > MAX_CONTENT_SIZE
32
+ },
33
+ 'User-Agent' => 'Feedium'
34
+ })
35
+ rescue Net::ReadTimeout => e
36
+ raise Feedium::RequestError.new(e.message)
37
+ rescue OpenURI::HTTPError => e
38
+ raise Feedium::RequestError.new(e.message)
39
+ end
34
40
  end
35
41
  end
@@ -1,3 +1,3 @@
1
1
  module Feedium
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex