feedcellar 0.1.1 → 0.1.2

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: b0297f9369fabdb912e41bcc6590b9be815635f1
4
- data.tar.gz: c6594d60ae6ece67a1032f858b2ee7394ee42c47
3
+ metadata.gz: eca1aa81de6be510b032bdd1873c9a5d20c691bb
4
+ data.tar.gz: f95eb0515ced32e51dae2d726626036184376064
5
5
  SHA512:
6
- metadata.gz: 99f3646df59af4f6151865631a0c93184f96ac0748d28522a419c1fcfeaa20c9995dc7c865cc36eb0bd3a6cc6db8d9a66ea171d6abac98ab034c336033473d3d
7
- data.tar.gz: de62b47d0afe37f4e56ef57cb3d1c06791e0e28cbf6c51d5039e2e677ecc3866ba7b6d6597c1bba3a518f4244689011232d1ba730aecb849bf40a00718ee1cf7
6
+ metadata.gz: 4580cb6be3f40757e10f664b3e595d725a478c76aae834ab8b990a279a434463204a2d08d8ffdeb25686f5e37bf5ece2dc84bb2a6bff480e25494f35bf939e9c
7
+ data.tar.gz: 93c3d94eb452934dad54787d1437453f19fce4ae51de5dd07dac47655cebf9dd4fb6ffe58f64f729437f64b38a4dbcadb43c534ae24233ecb8ed70b121f10f77
data/NEWS.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # NEWS
2
2
 
3
- ## Feedcellar 0.1.1: 2013-06-03
3
+ ## 0.1.2: 2013-06-04
4
+
5
+ Bug fixes release!
6
+
7
+ ### Changes
8
+
9
+ * Fixes
10
+ * Support Atom feed for register command
11
+ * Rescue HTTPError from invalid RSS
12
+
13
+ ## 0.1.1: 2013-06-03
4
14
 
5
15
  Add missing index release!
6
16
 
@@ -12,7 +22,7 @@ Add missing index release!
12
22
  * Fixes
13
23
  * Add missing index to Feeds table
14
24
 
15
- ## Feedcellar 0.1.0: 2013-06-02
25
+ ## 0.1.0: 2013-06-02
16
26
 
17
27
  Release to RubyGems.org!
18
28
 
@@ -24,7 +34,7 @@ Release to RubyGems.org!
24
34
  * Fixes
25
35
  * Rescue invalid feed.
26
36
 
27
- ## Feedcellar 0.0.3: 2013-06-02
37
+ ## 0.0.3: 2013-06-02
28
38
 
29
39
  ### Changes
30
40
 
@@ -32,13 +42,13 @@ Release to RubyGems.org!
32
42
  * Support Atom feed.
33
43
  * Add search command.
34
44
 
35
- ## Feedcellar 0.0.2: 2013-06-02
45
+ ## 0.0.2: 2013-06-02
36
46
 
37
47
  ### Changes
38
48
 
39
49
  * Improvements
40
50
  * Support register a URL.
41
51
 
42
- ## Feedcellar 0.0.1: 2013-06-01
52
+ ## 0.0.1: 2013-06-01
43
53
 
44
54
  Initial release!
@@ -29,12 +29,19 @@ module Feedcellar
29
29
  end
30
30
 
31
31
  resource = {}
32
- resource["xmlUrl"] = url
33
- resource["title"] = rss.channel.title
34
- resource["htmlUrl"] = rss.channel.link
35
- resource["description"] = rss.channel.description
32
+ if rss.is_a?(RSS::Atom::Feed)
33
+ resource["xmlUrl"] = url
34
+ resource["title"] = rss.title.content
35
+ resource["htmlUrl"] = rss.link.href
36
+ resource["description"] = rss.dc_description
37
+ else
38
+ resource["xmlUrl"] = url
39
+ resource["title"] = rss.channel.title
40
+ resource["htmlUrl"] = rss.channel.link
41
+ resource["description"] = rss.channel.description
42
+ end
36
43
 
37
- database.register(rss.channel.title, resource)
44
+ database.register(resource["title"], resource)
38
45
  end
39
46
  end
40
47
 
@@ -73,7 +80,12 @@ module Feedcellar
73
80
  begin
74
81
  rss = RSS::Parser.parse(feed_url)
75
82
  rescue RSS::InvalidRSSError
76
- rss = RSS::Parser.parse(feed_url, false)
83
+ begin
84
+ rss = RSS::Parser.parse(feed_url, false)
85
+ rescue
86
+ $stderr.puts "Warnning: #{$!} (#{feed_url})"
87
+ next
88
+ end
77
89
  rescue
78
90
  $stderr.puts "Warnning: #{$!} (#{feed_url})"
79
91
  next
@@ -1,3 +1,3 @@
1
1
  module Feedcellar
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -6,9 +6,9 @@
6
6
  <body>
7
7
  <outline text="my_letter" title="my_letter" type="rss"
8
8
  xmlUrl="http://myokoym.github.com/entries.rss" htmlUrl="http://myokoym.github.com/"/>
9
- <outline text="Rubygems | Latest Versions for shogi-ruby"
10
- title="Rubygems | Latest Versions for shogi-ruby" type="rss"
11
- xmlUrl="https://rubygems.org/gems/shogi-ruby/versions.atom" htmlUrl="https://rubygems.org/gems"/>
9
+ <outline text="Rubygems | Latest Versions for mister_fairy"
10
+ title="Rubygems | Latest Versions for mister_fairy" type="rss"
11
+ xmlUrl="https://rubygems.org/gems/mister_fairy/versions.atom" htmlUrl="https://rubygems.org/gems"/>
12
12
  <outline title="shogi" text="shogi">
13
13
  <outline text="函館将棋情報のブログ" title="函館将棋情報のブログ" type="rss"
14
14
  xmlUrl="http://blogs.yahoo.co.jp/mi807258/rss.xml" htmlUrl="http://rd.yahoo.co.jp/rss/l/blog/myblog/rss2/url/*http://blogs.yahoo.co.jp/mi807258"/>
data/test/test-command.rb CHANGED
@@ -20,8 +20,9 @@ class CommandTest < Test::Unit::TestCase
20
20
  $stderr = STDERR
21
21
 
22
22
  @command.register("http://myokoym.github.io/entries.rss")
23
+ @command.register("https://rubygems.org/gems/mister_fairy/versions.atom")
23
24
  Feedcellar::GroongaDatabase.new.open(@tmpdir) do |database|
24
- assert_equal(1, database.resources.size)
25
+ assert_equal(2, database.resources.size)
25
26
  end
26
27
 
27
28
  file = File.join(File.dirname(__FILE__), "fixtures", "subscriptions.xml")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feedcellar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masafumi Yokoyama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-03 00:00:00.000000000 Z
11
+ date: 2013-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rroonga