rrsimple-rss 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rrsimple-rss.rb CHANGED
@@ -2,7 +2,7 @@ require 'cgi'
2
2
  require 'time'
3
3
 
4
4
  class RRSimpleRSS
5
- VERSION = "1.3.4"
5
+ VERSION = "1.3.5"
6
6
 
7
7
  attr_reader :items, :source
8
8
  alias :entries :items
@@ -130,7 +130,7 @@ class RRSimpleRSS
130
130
  end
131
131
 
132
132
  if tag == :category || tag == :keywords
133
- item[:categories] = match[3].scan(%r{<(rss:|atom:)?#{tag}(.*?)>(.*?)</(rss:|atom:)?#{tag}>}mi).map {|x| category(x[2])}
133
+ item[tag] = match[3].scan(%r{<(rss:|atom:)?#{tag}(.*?)>(.*?)</(rss:|atom:)?#{tag}>}mi).map {|x| category(x[2])}
134
134
  else
135
135
  item[clean_tag(tag)] = clean_content(tag, $2, $3) if $2 || $3
136
136
  end
@@ -146,7 +146,7 @@ class RRSimpleRSS
146
146
  end
147
147
 
148
148
  def category(str)
149
- str.include?("CDATA") ? str[9..str.length-4] : str
149
+ str.include?("CDATA") ? str[9..str.length-4] : str
150
150
  end
151
151
 
152
152
  def clean_content(tag, attrs, content)
data/rrsimple-rss.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "rrsimple-rss"
3
- s.version = "1.3.4"
3
+ s.version = "1.3.5"
4
4
  s.date = "2010-07-06"
5
5
  s.summary = "A simple, flexible, extensible, and liberal RSS and Atom reader for Ruby. It is designed to be backwards compatible with the standard RSS parser, but will never do RSS generation."
6
6
  s.email = "rodrigo@rrmartins.com"
@@ -43,7 +43,9 @@ class BaseTest < Test::Unit::TestCase
43
43
  assert_equal Time.parse("2015-11-09 11:55:45 -0200"), @rss_prnews.channel.lastBuildDate
44
44
  assert_nil @rss_prnews.items.first.full_text
45
45
  assert_not_nil @rss_prnews.items.first.description
46
- assert_kind_of Array, @rss_prnews.items.first.categories
46
+ assert_kind_of Array, @rss_prnews.items.first.keywords
47
+ assert_kind_of Array, @rss_prnews.items.first.category
48
+ assert_equal "Art", @rss_prnews.items.first.category.first
47
49
  end
48
50
 
49
51
  def test_rss_baboo
@@ -56,7 +58,7 @@ class BaseTest < Test::Unit::TestCase
56
58
  assert_equal Time.parse("2015-11-05 14:11:24 -0200"), @rss_baboo.channel.lastBuildDate
57
59
  assert_nil @rss_baboo.items.first.full_text
58
60
  assert_not_nil @rss_baboo.items.first.description
59
- assert_kind_of Array, @rss_baboo.items.first.categories
61
+ assert_kind_of Array, @rss_baboo.items.first.category
60
62
  end
61
63
 
62
64
  def test_rss_bbc
@@ -68,7 +70,7 @@ class BaseTest < Test::Unit::TestCase
68
70
  assert_equal Time.parse("2015-11-03 08:21:50 -0200"), @rss_bbc.items.first.pubDate
69
71
  assert_equal Time.parse("2015-11-05 07:33:38 -0200"), @rss_bbc.channel.lastBuildDate
70
72
  assert_not_nil @rss_bbc.items.first.full_text
71
- assert_kind_of Array, @rss_bbc.items.first.categories
73
+ assert_kind_of Array, @rss_bbc.items.first.category
72
74
  end
73
75
 
74
76
  def test_rss09
@@ -80,7 +82,7 @@ class BaseTest < Test::Unit::TestCase
80
82
  assert_equal Time.parse("2005-09-09 06:52:31 -0300"), @rss09.items.first.dc_date
81
83
  assert_equal Time.parse("Fri Sep 09 02:52:31 PDT 2005"), @rss09.channel.dc_date
82
84
  assert_nil @rss09.items.first.full_text
83
- assert_kind_of Array, @rss09.items.first.categories
85
+ assert_kind_of Array, @rss09.items.first.category
84
86
  end
85
87
 
86
88
  def test_media_rss
@@ -102,7 +104,7 @@ class BaseTest < Test::Unit::TestCase
102
104
  assert_equal "pets frodo", @media_rss.items.first.media_category
103
105
  assert_equal "urn:flickr:tags", @media_rss.items.first.media_category_scheme
104
106
  assert_nil @media_rss.items.first.full_text
105
- assert_kind_of Array, @media_rss.items.first.categories
107
+ assert_kind_of Array, @media_rss.items.first.category
106
108
  end
107
109
 
108
110
  def test_rss20
@@ -113,7 +115,7 @@ class BaseTest < Test::Unit::TestCase
113
115
  assert_equal "http://feeds.feedburner.com/rufytech?m=68", @rss20.items.first[:link]
114
116
  assert_equal "This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site.", @rss20.channel.feedburner_browserFriendly
115
117
  assert_nil @rss20.items.first.full_text
116
- assert_kind_of Array, @rss20.items.first.categories
118
+ assert_kind_of Array, @rss20.items.first.category
117
119
  end
118
120
 
119
121
  def test_atom
@@ -123,7 +125,7 @@ class BaseTest < Test::Unit::TestCase
123
125
  assert_equal "http://example.org/2005/04/02/atom", @atom.entries.first.link
124
126
  assert_equal "http://example.org/2005/04/02/atom", @atom.entries.first[:link]
125
127
  assert_nil @atom.entries.first.full_text
126
- assert_kind_of Array, @atom.entries.first.categories
128
+ assert_kind_of Array, @atom.entries.first.category
127
129
  end
128
130
 
129
131
  def test_bad_feed
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rrsimple-rss
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: