simple-rss 1.2 → 1.2.2
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.
- data/install.rb +40 -0
- data/lib/simple-rss.rb +8 -7
- data/simple-rss.gemspec +12 -0
- data/test/base/base_test.rb +2 -2
- metadata +11 -9
data/install.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'rbconfig'
|
2
|
+
require 'find'
|
3
|
+
require 'ftools'
|
4
|
+
|
5
|
+
include Config
|
6
|
+
|
7
|
+
# this was adapted from rdoc's install.rb by ways of Log4r
|
8
|
+
|
9
|
+
$sitedir = CONFIG["sitelibdir"]
|
10
|
+
unless $sitedir
|
11
|
+
version = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
|
12
|
+
$libdir = File.join(CONFIG["libdir"], "ruby", version)
|
13
|
+
$sitedir = $:.find {|x| x =~ /site_ruby/ }
|
14
|
+
if !$sitedir
|
15
|
+
$sitedir = File.join($libdir, "site_ruby")
|
16
|
+
elsif $sitedir !~ Regexp.quote(version)
|
17
|
+
$sitedir = File.join($sitedir, version)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
makedirs = %w{ shipping }
|
22
|
+
makedirs.each {|f| File::makedirs(File.join($sitedir, *f.split(/\//)))}
|
23
|
+
|
24
|
+
Dir.chdir("lib")
|
25
|
+
begin
|
26
|
+
require 'rubygems'
|
27
|
+
require 'rake'
|
28
|
+
rescue LoadError
|
29
|
+
puts
|
30
|
+
puts "Please install Gem and Rake from http://rubyforge.org/projects/rubygems and http://rubyforge.org/projects/rake"
|
31
|
+
puts
|
32
|
+
exit(-1)
|
33
|
+
end
|
34
|
+
|
35
|
+
files = FileList["**/*"]
|
36
|
+
|
37
|
+
# File::safe_unlink *deprecated.collect{|f| File.join($sitedir, f.split(/\//))}
|
38
|
+
files.each {|f|
|
39
|
+
File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
|
40
|
+
}
|
data/lib/simple-rss.rb
CHANGED
@@ -2,7 +2,7 @@ require 'cgi'
|
|
2
2
|
require 'time'
|
3
3
|
|
4
4
|
class SimpleRSS
|
5
|
-
VERSION = "1.2"
|
5
|
+
VERSION = "1.2.2"
|
6
6
|
|
7
7
|
attr_reader :items, :source
|
8
8
|
alias :entries :items
|
@@ -33,10 +33,11 @@ class SimpleRSS
|
|
33
33
|
:'feedburner:origLink'
|
34
34
|
]
|
35
35
|
|
36
|
-
def initialize(source)
|
36
|
+
def initialize(source, options={})
|
37
37
|
@source = source.respond_to?(:read) ? source.read : source.to_s
|
38
38
|
@items = Array.new
|
39
|
-
|
39
|
+
@options = Hash.new.update(options)
|
40
|
+
|
40
41
|
parse
|
41
42
|
end
|
42
43
|
|
@@ -59,8 +60,8 @@ class SimpleRSS
|
|
59
60
|
end
|
60
61
|
|
61
62
|
# The strict attribute is for compatibility with Ruby's standard RSS parser
|
62
|
-
def parse(source,
|
63
|
-
new source
|
63
|
+
def parse(source, options={})
|
64
|
+
new source, options
|
64
65
|
end
|
65
66
|
end
|
66
67
|
|
@@ -85,8 +86,8 @@ class SimpleRSS
|
|
85
86
|
|
86
87
|
if $2 || $3
|
87
88
|
tag_cleaned = clean_tag(tag)
|
88
|
-
|
89
|
-
self.class.
|
89
|
+
instance_variable_set("@#{ tag_cleaned }", clean_content(tag, $2, $3))
|
90
|
+
self.class.send(:attr_reader, tag_cleaned)
|
90
91
|
end
|
91
92
|
end
|
92
93
|
|
data/simple-rss.gemspec
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "simple-rss"
|
3
|
+
s.version = "1.2.2"
|
4
|
+
s.date = "2009-02-25"
|
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
|
+
s.email = "lucas@rufy.com"
|
7
|
+
s.homepage = "http://github.com/cardmagic/simple-rss"
|
8
|
+
s.description = "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."
|
9
|
+
s.has_rdoc = true
|
10
|
+
s.authors = ["Lucas Carlson"]
|
11
|
+
s.files = ["install.rb", "lib", "lib/simple-rss.rb", "LICENSE", "Rakefile", "README", "simple-rss.gemspec", "test", "test/base", "test/base/base_test.rb", "test/data", "test/data/atom.xml", "test/data/not-rss.xml", "test/data/rss09.rdf", "test/data/rss20.xml", "test/test_helper.rb"]
|
12
|
+
end
|
data/test/base/base_test.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../test_helper'
|
2
2
|
class BaseTest < Test::Unit::TestCase
|
3
3
|
def setup
|
4
|
-
@rss09 = SimpleRSS.parse open(File.dirname(__FILE__) + '/../data/rss09.rdf')
|
5
|
-
@rss20 = SimpleRSS.parse open(File.dirname(__FILE__) + '/../data/rss20.xml')
|
4
|
+
@rss09 = SimpleRSS.parse open(File.dirname(__FILE__) + '/../data/rss09.rdf')
|
5
|
+
@rss20 = SimpleRSS.parse open(File.dirname(__FILE__) + '/../data/rss20.xml')
|
6
6
|
@atom = SimpleRSS.parse open(File.dirname(__FILE__) + '/../data/atom.xml')
|
7
7
|
end
|
8
8
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-rss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucas Carlson
|
@@ -22,20 +22,22 @@ extensions: []
|
|
22
22
|
extra_rdoc_files: []
|
23
23
|
|
24
24
|
files:
|
25
|
+
- install.rb
|
25
26
|
- lib/simple-rss.rb
|
26
|
-
-
|
27
|
+
- LICENSE
|
28
|
+
- Rakefile
|
29
|
+
- README
|
30
|
+
- simple-rss.gemspec
|
27
31
|
- test/base/base_test.rb
|
28
|
-
- test/data
|
29
32
|
- test/data/atom.xml
|
30
33
|
- test/data/not-rss.xml
|
31
34
|
- test/data/rss09.rdf
|
32
35
|
- test/data/rss20.xml
|
33
36
|
- test/test_helper.rb
|
34
|
-
- LICENSE
|
35
|
-
- Rakefile
|
36
|
-
- README
|
37
37
|
has_rdoc: true
|
38
|
-
homepage: http://simple-rss
|
38
|
+
homepage: http://github.com/cardmagic/simple-rss
|
39
|
+
licenses: []
|
40
|
+
|
39
41
|
post_install_message:
|
40
42
|
rdoc_options: []
|
41
43
|
|
@@ -56,9 +58,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
58
|
requirements: []
|
57
59
|
|
58
60
|
rubyforge_project:
|
59
|
-
rubygems_version: 1.3.
|
61
|
+
rubygems_version: 1.3.5
|
60
62
|
signing_key:
|
61
|
-
specification_version:
|
63
|
+
specification_version: 3
|
62
64
|
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.
|
63
65
|
test_files: []
|
64
66
|
|