benschwarz-smoke 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +6 -0
- data/VERSION.yml +1 -1
- metadata +65 -196
- data/Gemfile +0 -10
- data/bin/edit_json.rb +0 -3
- data/bin/restclient +0 -3
- data/vendor/gems/cache/crack-0.1.1.gem +0 -0
- data/vendor/gems/cache/fakeweb-1.2.5.gem +0 -0
- data/vendor/gems/cache/json-1.1.3.gem +0 -0
- data/vendor/gems/cache/rest-client-1.0.1.gem +0 -0
- data/vendor/gems/cache/simple-rss-1.2.gem +0 -0
- data/vendor/gems/cache/wycats-moneta-0.6.0.gem +0 -0
- data/vendor/gems/environment.rb +0 -83
- data/vendor/gems/gems/crack-0.1.1/LICENSE +0 -20
- data/vendor/gems/gems/crack-0.1.1/README.rdoc +0 -22
- data/vendor/gems/gems/crack-0.1.1/VERSION.yml +0 -4
- data/vendor/gems/gems/crack-0.1.1/lib/crack.rb +0 -7
- data/vendor/gems/gems/crack-0.1.1/lib/crack/core_extensions.rb +0 -126
- data/vendor/gems/gems/crack-0.1.1/lib/crack/json.rb +0 -66
- data/vendor/gems/gems/crack-0.1.1/lib/crack/xml.rb +0 -211
- data/vendor/gems/gems/crack-0.1.1/test/crack_test.rb +0 -4
- data/vendor/gems/gems/crack-0.1.1/test/json_test.rb +0 -42
- data/vendor/gems/gems/crack-0.1.1/test/test_helper.rb +0 -12
- data/vendor/gems/gems/crack-0.1.1/test/xml_test.rb +0 -451
- data/vendor/gems/gems/fakeweb-1.2.5/CHANGELOG +0 -163
- data/vendor/gems/gems/fakeweb-1.2.5/LICENSE.txt +0 -281
- data/vendor/gems/gems/fakeweb-1.2.5/README.rdoc +0 -193
- data/vendor/gems/gems/fakeweb-1.2.5/Rakefile +0 -76
- data/vendor/gems/gems/fakeweb-1.2.5/lib/fake_web.rb +0 -172
- data/vendor/gems/gems/fakeweb-1.2.5/lib/fake_web/ext/net_http.rb +0 -71
- data/vendor/gems/gems/fakeweb-1.2.5/lib/fake_web/registry.rb +0 -103
- data/vendor/gems/gems/fakeweb-1.2.5/lib/fake_web/responder.rb +0 -113
- data/vendor/gems/gems/fakeweb-1.2.5/lib/fake_web/response.rb +0 -10
- data/vendor/gems/gems/fakeweb-1.2.5/lib/fake_web/stub_socket.rb +0 -15
- data/vendor/gems/gems/fakeweb-1.2.5/lib/fake_web/utility.rb +0 -22
- data/vendor/gems/gems/fakeweb-1.2.5/lib/fakeweb.rb +0 -2
- data/vendor/gems/gems/fakeweb-1.2.5/test/fixtures/google_response_from_curl +0 -12
- data/vendor/gems/gems/fakeweb-1.2.5/test/fixtures/google_response_with_transfer_encoding +0 -17
- data/vendor/gems/gems/fakeweb-1.2.5/test/fixtures/google_response_without_transfer_encoding +0 -11
- data/vendor/gems/gems/fakeweb-1.2.5/test/fixtures/test_example.txt +0 -1
- data/vendor/gems/gems/fakeweb-1.2.5/test/fixtures/test_txt_file +0 -3
- data/vendor/gems/gems/fakeweb-1.2.5/test/test_allow_net_connect.rb +0 -85
- data/vendor/gems/gems/fakeweb-1.2.5/test/test_deprecations.rb +0 -54
- data/vendor/gems/gems/fakeweb-1.2.5/test/test_fake_authentication.rb +0 -92
- data/vendor/gems/gems/fakeweb-1.2.5/test/test_fake_web.rb +0 -518
- data/vendor/gems/gems/fakeweb-1.2.5/test/test_fake_web_open_uri.rb +0 -58
- data/vendor/gems/gems/fakeweb-1.2.5/test/test_helper.rb +0 -74
- data/vendor/gems/gems/fakeweb-1.2.5/test/test_missing_open_uri.rb +0 -25
- data/vendor/gems/gems/fakeweb-1.2.5/test/test_precedence.rb +0 -51
- data/vendor/gems/gems/fakeweb-1.2.5/test/test_query_string.rb +0 -45
- data/vendor/gems/gems/fakeweb-1.2.5/test/test_regexes.rb +0 -103
- data/vendor/gems/gems/fakeweb-1.2.5/test/test_response_headers.rb +0 -67
- data/vendor/gems/gems/fakeweb-1.2.5/test/test_trailing_slashes.rb +0 -53
- data/vendor/gems/gems/fakeweb-1.2.5/test/test_utility.rb +0 -70
- data/vendor/gems/gems/json-1.1.3/CHANGES +0 -93
- data/vendor/gems/gems/json-1.1.3/GPL +0 -340
- data/vendor/gems/gems/json-1.1.3/README +0 -78
- data/vendor/gems/gems/json-1.1.3/RUBY +0 -58
- data/vendor/gems/gems/json-1.1.3/Rakefile +0 -309
- data/vendor/gems/gems/json-1.1.3/TODO +0 -1
- data/vendor/gems/gems/json-1.1.3/VERSION +0 -1
- data/vendor/gems/gems/json-1.1.3/benchmarks/benchmark.txt +0 -133
- data/vendor/gems/gems/json-1.1.3/benchmarks/benchmark_generator.rb +0 -48
- data/vendor/gems/gems/json-1.1.3/benchmarks/benchmark_parser.rb +0 -26
- data/vendor/gems/gems/json-1.1.3/benchmarks/benchmark_rails.rb +0 -26
- data/vendor/gems/gems/json-1.1.3/bin/edit_json.rb +0 -10
- data/vendor/gems/gems/json-1.1.3/bin/prettify_json.rb +0 -76
- data/vendor/gems/gems/json-1.1.3/data/example.json +0 -1
- data/vendor/gems/gems/json-1.1.3/data/index.html +0 -38
- data/vendor/gems/gems/json-1.1.3/data/prototype.js +0 -4184
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/generator.bundle +0 -0
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/generator/Makefile +0 -150
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/generator/extconf.rb +0 -9
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/generator/generator.bundle +0 -0
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/generator/generator.c +0 -875
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/generator/generator.o +0 -0
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/generator/unicode.c +0 -182
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/generator/unicode.h +0 -53
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/generator/unicode.o +0 -0
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/parser.bundle +0 -0
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/parser/Makefile +0 -150
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/parser/extconf.rb +0 -9
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/parser/parser.bundle +0 -0
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/parser/parser.c +0 -1758
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/parser/parser.o +0 -0
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/parser/parser.rl +0 -638
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/parser/unicode.c +0 -154
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/parser/unicode.h +0 -58
- data/vendor/gems/gems/json-1.1.3/ext/json/ext/parser/unicode.o +0 -0
- data/vendor/gems/gems/json-1.1.3/install.rb +0 -26
- data/vendor/gems/gems/json-1.1.3/lib/json.rb +0 -235
- data/vendor/gems/gems/json-1.1.3/lib/json/Array.xpm +0 -21
- data/vendor/gems/gems/json-1.1.3/lib/json/FalseClass.xpm +0 -21
- data/vendor/gems/gems/json-1.1.3/lib/json/Hash.xpm +0 -21
- data/vendor/gems/gems/json-1.1.3/lib/json/Key.xpm +0 -73
- data/vendor/gems/gems/json-1.1.3/lib/json/NilClass.xpm +0 -21
- data/vendor/gems/gems/json-1.1.3/lib/json/Numeric.xpm +0 -28
- data/vendor/gems/gems/json-1.1.3/lib/json/String.xpm +0 -96
- data/vendor/gems/gems/json-1.1.3/lib/json/TrueClass.xpm +0 -21
- data/vendor/gems/gems/json-1.1.3/lib/json/add/core.rb +0 -135
- data/vendor/gems/gems/json-1.1.3/lib/json/add/rails.rb +0 -58
- data/vendor/gems/gems/json-1.1.3/lib/json/common.rb +0 -354
- data/vendor/gems/gems/json-1.1.3/lib/json/editor.rb +0 -1362
- data/vendor/gems/gems/json-1.1.3/lib/json/ext.rb +0 -13
- data/vendor/gems/gems/json-1.1.3/lib/json/json.xpm +0 -1499
- data/vendor/gems/gems/json-1.1.3/lib/json/pure.rb +0 -75
- data/vendor/gems/gems/json-1.1.3/lib/json/pure/generator.rb +0 -394
- data/vendor/gems/gems/json-1.1.3/lib/json/pure/parser.rb +0 -259
- data/vendor/gems/gems/json-1.1.3/lib/json/version.rb +0 -9
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail1.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail10.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail11.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail12.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail13.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail14.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail18.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail19.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail2.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail20.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail21.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail22.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail23.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail24.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail25.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail27.json +0 -2
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail28.json +0 -2
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail3.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail4.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail5.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail6.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail7.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail8.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/fail9.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/pass1.json +0 -56
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/pass15.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/pass16.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/pass17.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/pass2.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/pass26.json +0 -1
- data/vendor/gems/gems/json-1.1.3/tests/fixtures/pass3.json +0 -6
- data/vendor/gems/gems/json-1.1.3/tests/runner.rb +0 -25
- data/vendor/gems/gems/json-1.1.3/tests/test_json.rb +0 -293
- data/vendor/gems/gems/json-1.1.3/tests/test_json_addition.rb +0 -161
- data/vendor/gems/gems/json-1.1.3/tests/test_json_fixtures.rb +0 -30
- data/vendor/gems/gems/json-1.1.3/tests/test_json_generate.rb +0 -100
- data/vendor/gems/gems/json-1.1.3/tests/test_json_rails.rb +0 -118
- data/vendor/gems/gems/json-1.1.3/tests/test_json_unicode.rb +0 -61
- data/vendor/gems/gems/json-1.1.3/tools/fuzz.rb +0 -140
- data/vendor/gems/gems/json-1.1.3/tools/server.rb +0 -62
- data/vendor/gems/gems/rest-client-1.0.1/README.rdoc +0 -151
- data/vendor/gems/gems/rest-client-1.0.1/Rakefile +0 -85
- data/vendor/gems/gems/rest-client-1.0.1/bin/restclient +0 -87
- data/vendor/gems/gems/rest-client-1.0.1/lib/rest_client.rb +0 -2
- data/vendor/gems/gems/rest-client-1.0.1/lib/restclient.rb +0 -93
- data/vendor/gems/gems/rest-client-1.0.1/lib/restclient/exceptions.rb +0 -84
- data/vendor/gems/gems/rest-client-1.0.1/lib/restclient/mixin/response.rb +0 -43
- data/vendor/gems/gems/rest-client-1.0.1/lib/restclient/raw_response.rb +0 -30
- data/vendor/gems/gems/rest-client-1.0.1/lib/restclient/request.rb +0 -236
- data/vendor/gems/gems/rest-client-1.0.1/lib/restclient/resource.rb +0 -146
- data/vendor/gems/gems/rest-client-1.0.1/lib/restclient/response.rb +0 -20
- data/vendor/gems/gems/rest-client-1.0.1/spec/base.rb +0 -4
- data/vendor/gems/gems/rest-client-1.0.1/spec/exceptions_spec.rb +0 -54
- data/vendor/gems/gems/rest-client-1.0.1/spec/mixin/response_spec.rb +0 -46
- data/vendor/gems/gems/rest-client-1.0.1/spec/raw_response_spec.rb +0 -17
- data/vendor/gems/gems/rest-client-1.0.1/spec/request_spec.rb +0 -462
- data/vendor/gems/gems/rest-client-1.0.1/spec/resource_spec.rb +0 -75
- data/vendor/gems/gems/rest-client-1.0.1/spec/response_spec.rb +0 -16
- data/vendor/gems/gems/rest-client-1.0.1/spec/restclient_spec.rb +0 -53
- data/vendor/gems/gems/simple-rss-1.2/LICENSE +0 -429
- data/vendor/gems/gems/simple-rss-1.2/README +0 -43
- data/vendor/gems/gems/simple-rss-1.2/Rakefile +0 -212
- data/vendor/gems/gems/simple-rss-1.2/lib/simple-rss.rb +0 -149
- data/vendor/gems/gems/simple-rss-1.2/test/base/base_test.rb +0 -51
- data/vendor/gems/gems/simple-rss-1.2/test/data/atom.xml +0 -45
- data/vendor/gems/gems/simple-rss-1.2/test/data/not-rss.xml +0 -8
- data/vendor/gems/gems/simple-rss-1.2/test/data/rss09.rdf +0 -79
- data/vendor/gems/gems/simple-rss-1.2/test/data/rss20.xml +0 -818
- data/vendor/gems/gems/simple-rss-1.2/test/test_helper.rb +0 -4
- data/vendor/gems/gems/wycats-moneta-0.6.0/LICENSE +0 -20
- data/vendor/gems/gems/wycats-moneta-0.6.0/README +0 -50
- data/vendor/gems/gems/wycats-moneta-0.6.0/Rakefile +0 -60
- data/vendor/gems/gems/wycats-moneta-0.6.0/TODO +0 -4
- data/vendor/gems/gems/wycats-moneta-0.6.0/lib/moneta.rb +0 -76
- data/vendor/gems/gems/wycats-moneta-0.6.0/lib/moneta/datamapper.rb +0 -117
- data/vendor/gems/gems/wycats-moneta-0.6.0/lib/moneta/file.rb +0 -91
- data/vendor/gems/gems/wycats-moneta-0.6.0/lib/moneta/memcache.rb +0 -52
- data/vendor/gems/gems/wycats-moneta-0.6.0/lib/moneta/memory.rb +0 -11
- data/vendor/gems/gems/wycats-moneta-0.6.0/lib/moneta/xattr.rb +0 -58
- data/vendor/gems/specifications/crack-0.1.1.gemspec +0 -29
- data/vendor/gems/specifications/fakeweb-1.2.5.gemspec +0 -34
- data/vendor/gems/specifications/json-1.1.3.gemspec +0 -33
- data/vendor/gems/specifications/rest-client-1.0.1.gemspec +0 -30
- data/vendor/gems/specifications/simple-rss-1.2.gemspec +0 -27
- data/vendor/gems/specifications/wycats-moneta-0.6.0.gemspec +0 -29
@@ -1,43 +0,0 @@
|
|
1
|
-
== Welcome to Simple RSS
|
2
|
-
|
3
|
-
Simple RSS is 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.
|
4
|
-
|
5
|
-
== Download
|
6
|
-
|
7
|
-
* gem install simple-rss
|
8
|
-
* http://rubyforge.org/projects/simple-rss
|
9
|
-
* svn co http://rufy.com/svn/simple-rss/trunk
|
10
|
-
|
11
|
-
=== Usage
|
12
|
-
The API is similar to Ruby's standard RSS parser:
|
13
|
-
|
14
|
-
require 'rubygems'
|
15
|
-
require 'simple-rss'
|
16
|
-
require 'open-uri'
|
17
|
-
|
18
|
-
rss = SimpleRSS.parse open('http://slashdot.org/index.rdf')
|
19
|
-
|
20
|
-
rss.channel.title # => "Slashdot"
|
21
|
-
rss.channel.link # => "http://slashdot.org/"
|
22
|
-
rss.items.first.link # => "http://books.slashdot.org/article.pl?sid=05/08/29/1319236&from=rss"
|
23
|
-
|
24
|
-
But since the parser can read Atom feeds as easily as RSS feeds, there are optional aliases that allow more atom like reading:
|
25
|
-
|
26
|
-
rss.feed.title # => "Slashdot"
|
27
|
-
rss.feed.link # => "http://slashdot.org/"
|
28
|
-
rss.entries.first.link # => "http://books.slashdot.org/article.pl?sid=05/08/29/1319236&from=rss"
|
29
|
-
|
30
|
-
The parser does not care about the correctness of the XML as it does not use an XML library to read the information. Thus it is flexible and allows for easy extending via:
|
31
|
-
|
32
|
-
SimpleRSS.feed_tags << :some_new_tag
|
33
|
-
SimpleRSS.item_tags << :"item+myrel" # this will extend SimpleRSS to be able to parse RSS items or ATOM entries that have a rel specified, common in many blogger feeds
|
34
|
-
SimpleRSS.item_tags << :"feedburner:origLink" # this will extend SimpleRSS to be able to parse RSS items or ATOM entries that have a specific pre-tag specified, common in many feedburner feeds
|
35
|
-
|
36
|
-
|
37
|
-
== Authors
|
38
|
-
* Lucas Carlson (mailto:lucas@rufy.com)
|
39
|
-
|
40
|
-
Inspired by Blagg (http://www.raelity.org/lang/perl/blagg) from Rael Dornfest.
|
41
|
-
|
42
|
-
This library is released under the terms of the GNU LGPL.
|
43
|
-
|
@@ -1,212 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
require 'rake/testtask'
|
4
|
-
require 'rake/rdoctask'
|
5
|
-
require 'rake/gempackagetask'
|
6
|
-
require 'rake/contrib/rubyforgepublisher'
|
7
|
-
require File.dirname(__FILE__) + '/lib/simple-rss'
|
8
|
-
|
9
|
-
PKG_VERSION = SimpleRSS::VERSION
|
10
|
-
PKG_NAME = "simple-rss"
|
11
|
-
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
12
|
-
RUBY_FORGE_PROJECT = "simple-rss"
|
13
|
-
RUBY_FORGE_USER = ENV['RUBY_FORGE_USER'] || "cardmagic"
|
14
|
-
RELEASE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
15
|
-
|
16
|
-
PKG_FILES = FileList[
|
17
|
-
"lib/*", "bin/*", "test/**/*", "[A-Z]*", "Rakefile", "html/**/*"
|
18
|
-
]
|
19
|
-
|
20
|
-
desc "Default Task"
|
21
|
-
task :default => [ :test ]
|
22
|
-
|
23
|
-
# Run the unit tests
|
24
|
-
desc "Run all unit tests"
|
25
|
-
Rake::TestTask.new("test") { |t|
|
26
|
-
t.libs << "lib"
|
27
|
-
t.pattern = 'test/*/*_test.rb'
|
28
|
-
t.verbose = true
|
29
|
-
}
|
30
|
-
|
31
|
-
# Make a console, useful when working on tests
|
32
|
-
desc "Generate a test console"
|
33
|
-
task :console do
|
34
|
-
verbose( false ) { sh "irb -I lib/ -r 'simple-rss'" }
|
35
|
-
end
|
36
|
-
|
37
|
-
# Genereate the RDoc documentation
|
38
|
-
desc "Create documentation"
|
39
|
-
Rake::RDocTask.new("doc") { |rdoc|
|
40
|
-
rdoc.title = "Simple RSS - A Flexible RSS and Atom reader for Ruby"
|
41
|
-
rdoc.rdoc_dir = 'html'
|
42
|
-
rdoc.rdoc_files.include('README')
|
43
|
-
rdoc.rdoc_files.include('lib/*.rb')
|
44
|
-
}
|
45
|
-
|
46
|
-
# Genereate the package
|
47
|
-
spec = Gem::Specification.new do |s|
|
48
|
-
|
49
|
-
#### Basic information.
|
50
|
-
|
51
|
-
s.name = 'simple-rss'
|
52
|
-
s.version = PKG_VERSION
|
53
|
-
s.summary = <<-EOF
|
54
|
-
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.
|
55
|
-
EOF
|
56
|
-
s.description = <<-EOF
|
57
|
-
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.
|
58
|
-
EOF
|
59
|
-
|
60
|
-
#### Which files are to be included in this gem? Everything! (Except CVS directories.)
|
61
|
-
|
62
|
-
s.files = PKG_FILES
|
63
|
-
|
64
|
-
#### Load-time details: library and application (you will need one or both).
|
65
|
-
|
66
|
-
s.require_path = 'lib'
|
67
|
-
|
68
|
-
#### Documentation and testing.
|
69
|
-
|
70
|
-
s.has_rdoc = true
|
71
|
-
|
72
|
-
#### Author and project details.
|
73
|
-
|
74
|
-
s.author = "Lucas Carlson"
|
75
|
-
s.email = "lucas@rufy.com"
|
76
|
-
s.homepage = "http://simple-rss.rubyforge.org/"
|
77
|
-
end
|
78
|
-
|
79
|
-
Rake::GemPackageTask.new(spec) do |pkg|
|
80
|
-
pkg.need_zip = true
|
81
|
-
pkg.need_tar = true
|
82
|
-
end
|
83
|
-
|
84
|
-
desc "Report code statistics (KLOCs, etc) from the application"
|
85
|
-
task :stats do
|
86
|
-
require 'code_statistics'
|
87
|
-
CodeStatistics.new(
|
88
|
-
["Library", "lib"],
|
89
|
-
["Units", "test"]
|
90
|
-
).to_s
|
91
|
-
end
|
92
|
-
|
93
|
-
desc "Publish new documentation"
|
94
|
-
task :publish do
|
95
|
-
Rake::RubyForgePublisher.new('simple-rss', 'cardmagic').upload
|
96
|
-
end
|
97
|
-
|
98
|
-
|
99
|
-
desc "Publish the release files to RubyForge."
|
100
|
-
task :upload => [:package] do
|
101
|
-
files = ["gem", "tar.gz", "zip"].map { |ext| "pkg/#{PKG_FILE_NAME}.#{ext}" }
|
102
|
-
|
103
|
-
if RUBY_FORGE_PROJECT then
|
104
|
-
require 'net/http'
|
105
|
-
require 'open-uri'
|
106
|
-
|
107
|
-
project_uri = "http://rubyforge.org/projects/#{RUBY_FORGE_PROJECT}/"
|
108
|
-
project_data = open(project_uri) { |data| data.read }
|
109
|
-
group_id = project_data[/[?&]group_id=(\d+)/, 1]
|
110
|
-
raise "Couldn't get group id" unless group_id
|
111
|
-
|
112
|
-
# This echos password to shell which is a bit sucky
|
113
|
-
if ENV["RUBY_FORGE_PASSWORD"]
|
114
|
-
password = ENV["RUBY_FORGE_PASSWORD"]
|
115
|
-
else
|
116
|
-
print "#{RUBY_FORGE_USER}@rubyforge.org's password: "
|
117
|
-
password = STDIN.gets.chomp
|
118
|
-
end
|
119
|
-
|
120
|
-
login_response = Net::HTTP.start("rubyforge.org", 80) do |http|
|
121
|
-
data = [
|
122
|
-
"login=1",
|
123
|
-
"form_loginname=#{RUBY_FORGE_USER}",
|
124
|
-
"form_pw=#{password}"
|
125
|
-
].join("&")
|
126
|
-
http.post("/account/login.php", data)
|
127
|
-
end
|
128
|
-
|
129
|
-
cookie = login_response["set-cookie"]
|
130
|
-
raise "Login failed" unless cookie
|
131
|
-
headers = { "Cookie" => cookie }
|
132
|
-
|
133
|
-
release_uri = "http://rubyforge.org/frs/admin/?group_id=#{group_id}"
|
134
|
-
release_data = open(release_uri, headers) { |data| data.read }
|
135
|
-
package_id = release_data[/[?&]package_id=(\d+)/, 1]
|
136
|
-
raise "Couldn't get package id" unless package_id
|
137
|
-
|
138
|
-
first_file = true
|
139
|
-
release_id = ""
|
140
|
-
|
141
|
-
files.each do |filename|
|
142
|
-
basename = File.basename(filename)
|
143
|
-
file_ext = File.extname(filename)
|
144
|
-
file_data = File.open(filename, "rb") { |file| file.read }
|
145
|
-
|
146
|
-
puts "Releasing #{basename}..."
|
147
|
-
|
148
|
-
release_response = Net::HTTP.start("rubyforge.org", 80) do |http|
|
149
|
-
release_date = Time.now.strftime("%Y-%m-%d %H:%M")
|
150
|
-
type_map = {
|
151
|
-
".zip" => "3000",
|
152
|
-
".tgz" => "3110",
|
153
|
-
".gz" => "3110",
|
154
|
-
".gem" => "1400"
|
155
|
-
}; type_map.default = "9999"
|
156
|
-
type = type_map[file_ext]
|
157
|
-
boundary = "rubyqMY6QN9bp6e4kS21H4y0zxcvoor"
|
158
|
-
|
159
|
-
query_hash = if first_file then
|
160
|
-
{
|
161
|
-
"group_id" => group_id,
|
162
|
-
"package_id" => package_id,
|
163
|
-
"release_name" => RELEASE_NAME,
|
164
|
-
"release_date" => release_date,
|
165
|
-
"type_id" => type,
|
166
|
-
"processor_id" => "8000", # Any
|
167
|
-
"release_notes" => "",
|
168
|
-
"release_changes" => "",
|
169
|
-
"preformatted" => "1",
|
170
|
-
"submit" => "1"
|
171
|
-
}
|
172
|
-
else
|
173
|
-
{
|
174
|
-
"group_id" => group_id,
|
175
|
-
"release_id" => release_id,
|
176
|
-
"package_id" => package_id,
|
177
|
-
"step2" => "1",
|
178
|
-
"type_id" => type,
|
179
|
-
"processor_id" => "8000", # Any
|
180
|
-
"submit" => "Add This File"
|
181
|
-
}
|
182
|
-
end
|
183
|
-
|
184
|
-
query = "?" + query_hash.map do |(name, value)|
|
185
|
-
[name, URI.encode(value)].join("=")
|
186
|
-
end.join("&")
|
187
|
-
|
188
|
-
data = [
|
189
|
-
"--" + boundary,
|
190
|
-
"Content-Disposition: form-data; name=\"userfile\"; filename=\"#{basename}\"",
|
191
|
-
"Content-Type: application/octet-stream",
|
192
|
-
"Content-Transfer-Encoding: binary",
|
193
|
-
"", file_data, ""
|
194
|
-
].join("\x0D\x0A")
|
195
|
-
|
196
|
-
release_headers = headers.merge(
|
197
|
-
"Content-Type" => "multipart/form-data; boundary=#{boundary}"
|
198
|
-
)
|
199
|
-
|
200
|
-
target = first_file ? "/frs/admin/qrs.php" : "/frs/admin/editrelease.php"
|
201
|
-
http.post(target + query, data, release_headers)
|
202
|
-
end
|
203
|
-
|
204
|
-
if first_file then
|
205
|
-
release_id = release_response.body[/release_id=(\d+)/, 1]
|
206
|
-
raise("Couldn't get release id") unless release_id
|
207
|
-
end
|
208
|
-
|
209
|
-
first_file = false
|
210
|
-
end
|
211
|
-
end
|
212
|
-
end
|
@@ -1,149 +0,0 @@
|
|
1
|
-
require 'cgi'
|
2
|
-
require 'time'
|
3
|
-
|
4
|
-
class SimpleRSS
|
5
|
-
VERSION = "1.2"
|
6
|
-
|
7
|
-
attr_reader :items, :source
|
8
|
-
alias :entries :items
|
9
|
-
|
10
|
-
@@feed_tags = [
|
11
|
-
:id,
|
12
|
-
:title, :subtitle, :link,
|
13
|
-
:description,
|
14
|
-
:author, :webMaster, :managingEditor, :contributor,
|
15
|
-
:pubDate, :lastBuildDate, :updated, :'dc:date',
|
16
|
-
:generator, :language, :docs, :cloud,
|
17
|
-
:ttl, :skipHours, :skipDays,
|
18
|
-
:image, :logo, :icon, :rating,
|
19
|
-
:rights, :copyright,
|
20
|
-
:textInput, :'feedburner:browserFriendly',
|
21
|
-
:'itunes:author', :'itunes:category'
|
22
|
-
]
|
23
|
-
|
24
|
-
@@item_tags = [
|
25
|
-
:id,
|
26
|
-
:title, :link, :'link+alternate', :'link+self', :'link+edit', :'link+replies',
|
27
|
-
:author, :contributor,
|
28
|
-
:description, :summary, :content, :'content:encoded', :comments,
|
29
|
-
:pubDate, :published, :updated, :expirationDate, :modified, :'dc:date',
|
30
|
-
:category, :guid,
|
31
|
-
:'trackback:ping', :'trackback:about',
|
32
|
-
:'dc:creator', :'dc:title', :'dc:subject', :'dc:rights', :'dc:publisher',
|
33
|
-
:'feedburner:origLink'
|
34
|
-
]
|
35
|
-
|
36
|
-
def initialize(source)
|
37
|
-
@source = source.respond_to?(:read) ? source.read : source.to_s
|
38
|
-
@items = Array.new
|
39
|
-
|
40
|
-
parse
|
41
|
-
end
|
42
|
-
|
43
|
-
def channel() self end
|
44
|
-
alias :feed :channel
|
45
|
-
|
46
|
-
class << self
|
47
|
-
def feed_tags
|
48
|
-
@@feed_tags
|
49
|
-
end
|
50
|
-
def feed_tags=(ft)
|
51
|
-
@@feed_tags = ft
|
52
|
-
end
|
53
|
-
|
54
|
-
def item_tags
|
55
|
-
@@item_tags
|
56
|
-
end
|
57
|
-
def item_tags=(it)
|
58
|
-
@@item_tags = it
|
59
|
-
end
|
60
|
-
|
61
|
-
# The strict attribute is for compatibility with Ruby's standard RSS parser
|
62
|
-
def parse(source, do_validate=true, ignore_unknown_element=true, parser_class=false)
|
63
|
-
new source
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
private
|
68
|
-
|
69
|
-
def parse
|
70
|
-
raise SimpleRSSError, "Poorly formatted feed" unless @source =~ %r{<(channel|feed).*?>.*?</(channel|feed)>}mi
|
71
|
-
|
72
|
-
# Feed's title and link
|
73
|
-
feed_content = $1 if @source =~ %r{(.*?)<(rss:|atom:)?(item|entry).*?>.*?</(rss:|atom:)?(item|entry)>}mi
|
74
|
-
|
75
|
-
@@feed_tags.each do |tag|
|
76
|
-
if feed_content && feed_content =~ %r{<(rss:|atom:)?#{tag}(.*?)>(.*?)</(rss:|atom:)?#{tag}>}mi
|
77
|
-
nil
|
78
|
-
elsif feed_content && feed_content =~ %r{<(rss:|atom:)?#{tag}(.*?)\/\s*>}mi
|
79
|
-
nil
|
80
|
-
elsif @source =~ %r{<(rss:|atom:)?#{tag}(.*?)>(.*?)</(rss:|atom:)?#{tag}>}mi
|
81
|
-
nil
|
82
|
-
elsif @source =~ %r{<(rss:|atom:)?#{tag}(.*?)\/\s*>}mi
|
83
|
-
nil
|
84
|
-
end
|
85
|
-
|
86
|
-
if $2 || $3
|
87
|
-
tag_cleaned = clean_tag(tag)
|
88
|
-
eval %{ @#{ tag_cleaned } = clean_content(tag, $2, $3) }
|
89
|
-
self.class.class_eval %{ attr_reader :#{ tag_cleaned } }
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
# RSS items' title, link, and description
|
94
|
-
@source.scan( %r{<(rss:|atom:)?(item|entry)([\s][^>]*)?>(.*?)</(rss:|atom:)?(item|entry)>}mi ) do |match|
|
95
|
-
item = Hash.new
|
96
|
-
@@item_tags.each do |tag|
|
97
|
-
if tag.to_s.include?("+")
|
98
|
-
tag_data = tag.to_s.split("+")
|
99
|
-
tag = tag_data[0]
|
100
|
-
rel = tag_data[1]
|
101
|
-
|
102
|
-
if match[3] =~ %r{<(rss:|atom:)?#{tag}(.*?)rel=['"]#{rel}['"](.*?)>(.*?)</(rss:|atom:)?#{tag}>}mi
|
103
|
-
nil
|
104
|
-
elsif match[3] =~ %r{<(rss:|atom:)?#{tag}(.*?)rel=['"]#{rel}['"](.*?)/\s*>}mi
|
105
|
-
nil
|
106
|
-
end
|
107
|
-
item[clean_tag("#{tag}+#{rel}")] = clean_content(tag, $3, $4) if $3 || $4
|
108
|
-
else
|
109
|
-
if match[3] =~ %r{<(rss:|atom:)?#{tag}(.*?)>(.*?)</(rss:|atom:)?#{tag}>}mi
|
110
|
-
nil
|
111
|
-
elsif match[3] =~ %r{<(rss:|atom:)?#{tag}(.*?)/\s*>}mi
|
112
|
-
nil
|
113
|
-
end
|
114
|
-
item[clean_tag(tag)] = clean_content(tag, $2, $3) if $2 || $3
|
115
|
-
end
|
116
|
-
end
|
117
|
-
def item.method_missing(name, *args) self[name] end
|
118
|
-
@items << item
|
119
|
-
end
|
120
|
-
|
121
|
-
end
|
122
|
-
|
123
|
-
def clean_content(tag, attrs, content)
|
124
|
-
content = content.to_s
|
125
|
-
case tag
|
126
|
-
when :pubDate, :lastBuildDate, :published, :updated, :expirationDate, :modified, :'dc:date'
|
127
|
-
Time.parse(content) rescue unescape(content)
|
128
|
-
when :author, :contributor, :skipHours, :skipDays
|
129
|
-
unescape(content.gsub(/<.*?>/,''))
|
130
|
-
else
|
131
|
-
content.empty? && "#{attrs} " =~ /href=['"]?([^'"]*)['" ]/mi ? $1.strip : unescape(content)
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
135
|
-
def clean_tag(tag)
|
136
|
-
tag.to_s.gsub(':','_').intern
|
137
|
-
end
|
138
|
-
|
139
|
-
def unescape(content)
|
140
|
-
if content =~ /([^-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]%)/n then
|
141
|
-
CGI.unescape(content).gsub(/(<!\[CDATA\[|\]\]>)/,'').strip
|
142
|
-
else
|
143
|
-
content.gsub(/(<!\[CDATA\[|\]\]>)/,'').strip
|
144
|
-
end
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
class SimpleRSSError < StandardError
|
149
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
-
class BaseTest < Test::Unit::TestCase
|
3
|
-
def setup
|
4
|
-
@rss09 = SimpleRSS.parse open(File.dirname(__FILE__) + '/../data/rss09.rdf'), true
|
5
|
-
@rss20 = SimpleRSS.parse open(File.dirname(__FILE__) + '/../data/rss20.xml'), false
|
6
|
-
@atom = SimpleRSS.parse open(File.dirname(__FILE__) + '/../data/atom.xml')
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_channel
|
10
|
-
assert_equal @rss09, @rss09.channel
|
11
|
-
assert_equal @rss20, @rss20.channel
|
12
|
-
assert_equal @atom, @atom.feed
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_items
|
16
|
-
assert_kind_of Array, @rss09.items
|
17
|
-
assert_kind_of Array, @rss20.items
|
18
|
-
assert_kind_of Array, @atom.entries
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_rss09
|
22
|
-
assert_equal 10, @rss09.items.size
|
23
|
-
assert_equal "Slashdot", @rss09.title
|
24
|
-
assert_equal "http://slashdot.org/", @rss09.channel.link
|
25
|
-
assert_equal "http://books.slashdot.org/article.pl?sid=05/08/29/1319236&from=rss", @rss09.items.first.link
|
26
|
-
assert_equal "http://books.slashdot.org/article.pl?sid=05/08/29/1319236&from=rss", @rss09.items.first[:link]
|
27
|
-
assert_equal Time.parse("Wed Aug 24 13:33:34 UTC 2005"), @rss20.items.first.pubDate
|
28
|
-
assert_equal Time.parse("Fri Sep 09 02:52:31 PDT 2005"), @rss09.channel.dc_date
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_rss20
|
32
|
-
assert_equal 10, @rss20.items.size
|
33
|
-
assert_equal "Technoblog", @rss20.title
|
34
|
-
assert_equal "http://tech.rufy.com", @rss20.channel.link
|
35
|
-
assert_equal "http://feeds.feedburner.com/rufytech?m=68", @rss20.items.first.link
|
36
|
-
assert_equal "http://feeds.feedburner.com/rufytech?m=68", @rss20.items.first[:link]
|
37
|
-
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
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_atom
|
41
|
-
assert_equal 1, @atom.entries.size
|
42
|
-
assert_equal "dive into mark", @atom.title
|
43
|
-
assert_equal "http://example.org/", @atom.feed.link
|
44
|
-
assert_equal "http://example.org/2005/04/02/atom", @atom.entries.first.link
|
45
|
-
assert_equal "http://example.org/2005/04/02/atom", @atom.entries.first[:link]
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_bad_feed
|
49
|
-
assert_raise(SimpleRSSError) { SimpleRSS.parse(open(File.dirname(__FILE__) + '/../data/not-rss.xml')) }
|
50
|
-
end
|
51
|
-
end
|