ratom-nokogiri 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/.travis.yml +6 -0
- data/Gemfile +7 -0
- data/History.txt +164 -0
- data/LICENSE +20 -0
- data/README.rdoc +309 -0
- data/Rakefile +10 -0
- data/lib/atom.rb +797 -0
- data/lib/atom/configuration.rb +24 -0
- data/lib/atom/pub.rb +243 -0
- data/lib/atom/version.rb +3 -0
- data/lib/atom/xml/parser.rb +413 -0
- data/ratom.gemspec +27 -0
- data/spec/app/member_entry.atom +31 -0
- data/spec/app/service.xml +36 -0
- data/spec/app/service_xml_base.xml +37 -0
- data/spec/atom/pub_spec.rb +517 -0
- data/spec/atom_spec.rb +1449 -0
- data/spec/conformance/atom.rng +600 -0
- data/spec/conformance/baseuri.atom +19 -0
- data/spec/conformance/divtest.atom +32 -0
- data/spec/conformance/linktests.xml +103 -0
- data/spec/conformance/nondefaultnamespace-baseline.atom +25 -0
- data/spec/conformance/nondefaultnamespace-xhtml.atom +25 -0
- data/spec/conformance/nondefaultnamespace.atom +25 -0
- data/spec/conformance/ordertest.xml +112 -0
- data/spec/conformance/title/html-cdata.atom +22 -0
- data/spec/conformance/title/html-entity.atom +22 -0
- data/spec/conformance/title/html-ncr.atom +22 -0
- data/spec/conformance/title/text-cdata.atom +22 -0
- data/spec/conformance/title/text-entity.atom +21 -0
- data/spec/conformance/title/text-ncr.atom +21 -0
- data/spec/conformance/title/xhtml-entity.atom +21 -0
- data/spec/conformance/title/xhtml-ncr.atom +21 -0
- data/spec/conformance/unknown-namespace.atom +25 -0
- data/spec/conformance/xmlbase.atom +133 -0
- data/spec/fixtures/complex_single_entry.atom +45 -0
- data/spec/fixtures/created_entry.atom +31 -0
- data/spec/fixtures/entry.atom +30 -0
- data/spec/fixtures/entry_with_custom_content_type.atom +10 -0
- data/spec/fixtures/entry_with_custom_extensions.atom +8 -0
- data/spec/fixtures/entry_with_simple_extensions.atom +31 -0
- data/spec/fixtures/entry_with_single_custom_extension.atom +6 -0
- data/spec/fixtures/external_content_single_entry.atom +21 -0
- data/spec/fixtures/multiple_entry.atom +0 -0
- data/spec/fixtures/simple_single_entry.atom +21 -0
- data/spec/fixtures/with_stylesheet.atom +8 -0
- data/spec/paging/first_paged_feed.atom +21 -0
- data/spec/paging/last_paged_feed.atom +21 -0
- data/spec/paging/middle_paged_feed.atom +22 -0
- data/spec/property.rb +31 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +40 -0
- metadata +201 -0
File without changes
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<feed xmlns="http://www.w3.org/2005/Atom">
|
3
|
+
|
4
|
+
<title>Example Feed</title>
|
5
|
+
<link href="http://example.org/"/>
|
6
|
+
<updated>2003-12-13T18:30:02Z</updated>
|
7
|
+
<author>
|
8
|
+
<name>John Doe</name>
|
9
|
+
</author>
|
10
|
+
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
|
11
|
+
|
12
|
+
<entry>
|
13
|
+
<title>Atom-Powered Robots Run Amok</title>
|
14
|
+
<link href="http://example.org/2003/12/13/atom03"/>
|
15
|
+
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
|
16
|
+
<content type="html">This <em>is</em> html.</content>
|
17
|
+
<updated>2003-12-13T18:30:02Z</updated>
|
18
|
+
<summary>Some text.</summary>
|
19
|
+
</entry>
|
20
|
+
|
21
|
+
</feed>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?>
|
3
|
+
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'>
|
4
|
+
<id>tag:blogger.com,1999:blog-3343849602113720282</id>
|
5
|
+
<updated>2008-07-26T09:01:19.322+01:00</updated>
|
6
|
+
<title type='text'>Blockstack.tv</title>
|
7
|
+
<link rel='alternate' type='text/html' href='http://blockstack.blogspot.com/'/>
|
8
|
+
</feed>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<feed xmlns="http://www.w3.org/2005/Atom">
|
3
|
+
<title>Example Feed</title>
|
4
|
+
<link href="http://example.org/"/>
|
5
|
+
<link rel="self" href="http://example.org/index.atom"/>
|
6
|
+
<link rel="first" href="http://example.org/index.atom"/>
|
7
|
+
<link rel="next" href="http://example.org/index.atom?page=2"/>
|
8
|
+
<link rel="last" href="http://example.org/index.atom?page=10"/>
|
9
|
+
<updated>2003-12-13T18:30:02Z</updated>
|
10
|
+
<author>
|
11
|
+
<name>John Doe</name>
|
12
|
+
</author>
|
13
|
+
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
|
14
|
+
<entry>
|
15
|
+
<title>Atom-Powered Robots Run Amok</title>
|
16
|
+
<link href="http://example.org/2003/12/13/atom03"/>
|
17
|
+
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
|
18
|
+
<updated>2003-12-13T18:30:02Z</updated>
|
19
|
+
<summary>Some text.</summary>
|
20
|
+
</entry>
|
21
|
+
</feed>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<feed xmlns="http://www.w3.org/2005/Atom">
|
3
|
+
<title>Example Feed</title>
|
4
|
+
<link href="http://example.org/"/>
|
5
|
+
<link rel="self" href="http://example.org/index.atom?page=10"/>
|
6
|
+
<link rel="first" href="http://example.org/index.atom"/>
|
7
|
+
<link rel="prev" href="http://example.org/index.atom?page=9"/>
|
8
|
+
<link rel="last" href="http://example.org/index.atom?page=10"/>
|
9
|
+
<updated>2003-12-13T18:30:02Z</updated>
|
10
|
+
<author>
|
11
|
+
<name>John Doe</name>
|
12
|
+
</author>
|
13
|
+
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
|
14
|
+
<entry>
|
15
|
+
<title>Atom-Powered Robots Run Amok</title>
|
16
|
+
<link href="http://example.org/2003/12/13/atom03"/>
|
17
|
+
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
|
18
|
+
<updated>2003-11-10T18:30:02Z</updated>
|
19
|
+
<summary>Some text.</summary>
|
20
|
+
</entry>
|
21
|
+
</feed>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<feed xmlns="http://www.w3.org/2005/Atom">
|
3
|
+
<title>Example Feed</title>
|
4
|
+
<link href="http://example.org/"/>
|
5
|
+
<link rel="self" href="http://example.org/index.atom?page=3"/>
|
6
|
+
<link rel="first" href="http://example.org/index.atom"/>
|
7
|
+
<link rel="prev" href="http://example.org/index.atom?page=2"/>
|
8
|
+
<link rel="next" href="http://example.org/index.atom?page=4"/>
|
9
|
+
<link rel="last" href="http://example.org/index.atom?page=10"/>
|
10
|
+
<updated>2003-12-13T18:30:02Z</updated>
|
11
|
+
<author>
|
12
|
+
<name>John Doe</name>
|
13
|
+
</author>
|
14
|
+
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
|
15
|
+
<entry>
|
16
|
+
<title>Atom-Powered Robots Run Amok</title>
|
17
|
+
<link href="http://example.org/2003/12/13/atom03"/>
|
18
|
+
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
|
19
|
+
<updated>2003-11-15T18:30:02Z</updated>
|
20
|
+
<summary>Some text.</summary>
|
21
|
+
</entry>
|
22
|
+
</feed>
|
data/spec/property.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
module Atom
|
2
|
+
module Extensions
|
3
|
+
class Property
|
4
|
+
include Atom::Xml::Parseable
|
5
|
+
|
6
|
+
namespace "http://custom.namespace"
|
7
|
+
attribute :name, :value
|
8
|
+
|
9
|
+
def initialize(name = nil, value = nil)
|
10
|
+
if name && value
|
11
|
+
initialize_with_o :name => name, :value => value
|
12
|
+
else
|
13
|
+
initialize_with_o(name) { yield if block_given? }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def initialize_with_o(o = nil)
|
18
|
+
case o
|
19
|
+
when String, Nokogiri::XML::Reader
|
20
|
+
parse o, :once => true
|
21
|
+
when Hash
|
22
|
+
o.each do |name,value|
|
23
|
+
self.send :"#{name}=", value
|
24
|
+
end
|
25
|
+
else
|
26
|
+
yield(self) if block_given?
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# Copyright (c) 2008 The Kaphan Foundation
|
2
|
+
#
|
3
|
+
# For licensing information see LICENSE.
|
4
|
+
#
|
5
|
+
# Please visit http://www.peerworks.org/contact for further information.
|
6
|
+
#
|
7
|
+
|
8
|
+
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
9
|
+
require 'atom'
|
10
|
+
|
11
|
+
RSpec.configure do |config|
|
12
|
+
|
13
|
+
def mock_response(klass, body, headers = {})
|
14
|
+
response = klass.new(nil, nil, nil)
|
15
|
+
response.stub!(:body).and_return(body)
|
16
|
+
|
17
|
+
headers.each do |k, v|
|
18
|
+
response.stub!(:[]).with(k).and_return(v)
|
19
|
+
end
|
20
|
+
|
21
|
+
response
|
22
|
+
end
|
23
|
+
|
24
|
+
def mock_http_get(url, response, user = nil, pass = nil)
|
25
|
+
req = mock('request')
|
26
|
+
Net::HTTP::Get.should_receive(:new).with(url.request_uri).and_return(req)
|
27
|
+
|
28
|
+
if user && pass
|
29
|
+
req.should_receive(:basic_auth).with(user, pass)
|
30
|
+
end
|
31
|
+
|
32
|
+
http = mock('http')
|
33
|
+
http.should_receive(:request).with(req).and_return(response)
|
34
|
+
http.stub!(:use_ssl=)
|
35
|
+
http.stub!(:ca_path=)
|
36
|
+
http.stub!(:verify_mode=)
|
37
|
+
http.stub!(:verify_depth=)
|
38
|
+
Net::HTTP.should_receive(:new).with(url.host, url.port).and_return(http)
|
39
|
+
end
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ratom-nokogiri
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.10.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Peerworks
|
8
|
+
- Sean Geoghegan
|
9
|
+
- Brian Palmer
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2015-08-04 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: nokogiri
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - ">="
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.5.6
|
22
|
+
- - "<"
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '1.7'
|
25
|
+
type: :runtime
|
26
|
+
prerelease: false
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: 1.5.6
|
32
|
+
- - "<"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '1.7'
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: bundler
|
37
|
+
requirement: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '1.1'
|
42
|
+
type: :development
|
43
|
+
prerelease: false
|
44
|
+
version_requirements: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '1.1'
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: rspec
|
51
|
+
requirement: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 2.10.0
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 2.10.0
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: rake
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 0.9.2
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 0.9.2
|
77
|
+
description: A fast Atom Syndication and Publication API based on libxml
|
78
|
+
email: eng@instructure.com
|
79
|
+
executables: []
|
80
|
+
extensions: []
|
81
|
+
extra_rdoc_files:
|
82
|
+
- LICENSE
|
83
|
+
- README.rdoc
|
84
|
+
files:
|
85
|
+
- ".gitignore"
|
86
|
+
- ".travis.yml"
|
87
|
+
- Gemfile
|
88
|
+
- History.txt
|
89
|
+
- LICENSE
|
90
|
+
- README.rdoc
|
91
|
+
- Rakefile
|
92
|
+
- lib/atom.rb
|
93
|
+
- lib/atom/configuration.rb
|
94
|
+
- lib/atom/pub.rb
|
95
|
+
- lib/atom/version.rb
|
96
|
+
- lib/atom/xml/parser.rb
|
97
|
+
- ratom.gemspec
|
98
|
+
- spec/app/member_entry.atom
|
99
|
+
- spec/app/service.xml
|
100
|
+
- spec/app/service_xml_base.xml
|
101
|
+
- spec/atom/pub_spec.rb
|
102
|
+
- spec/atom_spec.rb
|
103
|
+
- spec/conformance/atom.rng
|
104
|
+
- spec/conformance/baseuri.atom
|
105
|
+
- spec/conformance/divtest.atom
|
106
|
+
- spec/conformance/linktests.xml
|
107
|
+
- spec/conformance/nondefaultnamespace-baseline.atom
|
108
|
+
- spec/conformance/nondefaultnamespace-xhtml.atom
|
109
|
+
- spec/conformance/nondefaultnamespace.atom
|
110
|
+
- spec/conformance/ordertest.xml
|
111
|
+
- spec/conformance/title/html-cdata.atom
|
112
|
+
- spec/conformance/title/html-entity.atom
|
113
|
+
- spec/conformance/title/html-ncr.atom
|
114
|
+
- spec/conformance/title/text-cdata.atom
|
115
|
+
- spec/conformance/title/text-entity.atom
|
116
|
+
- spec/conformance/title/text-ncr.atom
|
117
|
+
- spec/conformance/title/xhtml-entity.atom
|
118
|
+
- spec/conformance/title/xhtml-ncr.atom
|
119
|
+
- spec/conformance/unknown-namespace.atom
|
120
|
+
- spec/conformance/xmlbase.atom
|
121
|
+
- spec/fixtures/complex_single_entry.atom
|
122
|
+
- spec/fixtures/created_entry.atom
|
123
|
+
- spec/fixtures/entry.atom
|
124
|
+
- spec/fixtures/entry_with_custom_content_type.atom
|
125
|
+
- spec/fixtures/entry_with_custom_extensions.atom
|
126
|
+
- spec/fixtures/entry_with_simple_extensions.atom
|
127
|
+
- spec/fixtures/entry_with_single_custom_extension.atom
|
128
|
+
- spec/fixtures/external_content_single_entry.atom
|
129
|
+
- spec/fixtures/multiple_entry.atom
|
130
|
+
- spec/fixtures/simple_single_entry.atom
|
131
|
+
- spec/fixtures/with_stylesheet.atom
|
132
|
+
- spec/paging/first_paged_feed.atom
|
133
|
+
- spec/paging/last_paged_feed.atom
|
134
|
+
- spec/paging/middle_paged_feed.atom
|
135
|
+
- spec/property.rb
|
136
|
+
- spec/spec.opts
|
137
|
+
- spec/spec_helper.rb
|
138
|
+
homepage: http://github.com/instructure/ratom
|
139
|
+
licenses: []
|
140
|
+
metadata: {}
|
141
|
+
post_install_message:
|
142
|
+
rdoc_options: []
|
143
|
+
require_paths:
|
144
|
+
- lib
|
145
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
requirements: []
|
156
|
+
rubyforge_project:
|
157
|
+
rubygems_version: 2.2.3
|
158
|
+
signing_key:
|
159
|
+
specification_version: 4
|
160
|
+
summary: Atom Syndication and Publication API
|
161
|
+
test_files:
|
162
|
+
- spec/app/member_entry.atom
|
163
|
+
- spec/app/service.xml
|
164
|
+
- spec/app/service_xml_base.xml
|
165
|
+
- spec/atom/pub_spec.rb
|
166
|
+
- spec/atom_spec.rb
|
167
|
+
- spec/conformance/atom.rng
|
168
|
+
- spec/conformance/baseuri.atom
|
169
|
+
- spec/conformance/divtest.atom
|
170
|
+
- spec/conformance/linktests.xml
|
171
|
+
- spec/conformance/nondefaultnamespace-baseline.atom
|
172
|
+
- spec/conformance/nondefaultnamespace-xhtml.atom
|
173
|
+
- spec/conformance/nondefaultnamespace.atom
|
174
|
+
- spec/conformance/ordertest.xml
|
175
|
+
- spec/conformance/title/html-cdata.atom
|
176
|
+
- spec/conformance/title/html-entity.atom
|
177
|
+
- spec/conformance/title/html-ncr.atom
|
178
|
+
- spec/conformance/title/text-cdata.atom
|
179
|
+
- spec/conformance/title/text-entity.atom
|
180
|
+
- spec/conformance/title/text-ncr.atom
|
181
|
+
- spec/conformance/title/xhtml-entity.atom
|
182
|
+
- spec/conformance/title/xhtml-ncr.atom
|
183
|
+
- spec/conformance/unknown-namespace.atom
|
184
|
+
- spec/conformance/xmlbase.atom
|
185
|
+
- spec/fixtures/complex_single_entry.atom
|
186
|
+
- spec/fixtures/created_entry.atom
|
187
|
+
- spec/fixtures/entry.atom
|
188
|
+
- spec/fixtures/entry_with_custom_content_type.atom
|
189
|
+
- spec/fixtures/entry_with_custom_extensions.atom
|
190
|
+
- spec/fixtures/entry_with_simple_extensions.atom
|
191
|
+
- spec/fixtures/entry_with_single_custom_extension.atom
|
192
|
+
- spec/fixtures/external_content_single_entry.atom
|
193
|
+
- spec/fixtures/multiple_entry.atom
|
194
|
+
- spec/fixtures/simple_single_entry.atom
|
195
|
+
- spec/fixtures/with_stylesheet.atom
|
196
|
+
- spec/paging/first_paged_feed.atom
|
197
|
+
- spec/paging/last_paged_feed.atom
|
198
|
+
- spec/paging/middle_paged_feed.atom
|
199
|
+
- spec/property.rb
|
200
|
+
- spec/spec.opts
|
201
|
+
- spec/spec_helper.rb
|