bbc_data_service 0.1.20 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bbc_data_service.gemspec +1 -0
- data/lib/bbc_data_service/fixture_loader.rb +2 -0
- data/lib/bbc_data_service/version.rb +1 -1
- data/lib/bbc_data_service/xml_parser.rb +7 -0
- data/lib/bbc_data_service.rb +2 -0
- data/spec/fixture_loader_spec.rb +5 -0
- data/spec/fixtures/test-xml-feed.xml +26 -0
- data/spec/fixtures/test_config.rb +4 -0
- metadata +121 -56
data/bbc_data_service.gemspec
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_dependency("activemodel", "~>3.1.0")
|
23
23
|
#s.add_dependency("rdf-rdfxml", "~>0.3.4")
|
24
24
|
s.add_dependency("rdf-json", "~>0.3.0")
|
25
|
+
s.add_dependency("nokogiri", "1.5.0")
|
25
26
|
# Development Dependencies
|
26
27
|
s.add_development_dependency("rspec", "~>2.6.0")
|
27
28
|
s.add_development_dependency("turn", "~>0.8.2")
|
data/lib/bbc_data_service.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
require "rubygems"
|
2
2
|
require "sinatra"
|
3
|
+
require "nokogiri"
|
3
4
|
require "active_model"
|
4
5
|
require "bbc_data_service/service_config"
|
5
6
|
require "bbc_data_service/version"
|
6
7
|
require "bbc_data_service/rdf_parser"
|
7
8
|
require "bbc_data_service/json_parser"
|
8
9
|
require "bbc_data_service/app_fixture"
|
10
|
+
require "bbc_data_service/xml_parser"
|
9
11
|
require "bbc_data_service/fixture_loader"
|
10
12
|
|
11
13
|
module BBCDataService
|
data/spec/fixture_loader_spec.rb
CHANGED
@@ -50,4 +50,9 @@ describe BBCDataService::FixtureLoader do
|
|
50
50
|
object.name.should == "Athletics"
|
51
51
|
end
|
52
52
|
|
53
|
+
it "should allow parsing of XML" do
|
54
|
+
object = BBCDataService::FixtureLoader.load_fixture(:xml_test)
|
55
|
+
object.class.should == Nokogiri::HTML::Document
|
56
|
+
end
|
57
|
+
|
53
58
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
|
3
|
+
<feed xmlns="http://www.w3.org/2005/Atom">
|
4
|
+
|
5
|
+
<title>Example Feed</title>
|
6
|
+
<subtitle>A subtitle.</subtitle>
|
7
|
+
<link href="http://example.org/feed/" rel="self" />
|
8
|
+
<link href="http://example.org/" />
|
9
|
+
<id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
|
10
|
+
<updated>2003-12-13T18:30:02Z</updated>
|
11
|
+
<author>
|
12
|
+
<name>John Doe</name>
|
13
|
+
<email>johndoe@example.com</email>
|
14
|
+
</author>
|
15
|
+
|
16
|
+
<entry>
|
17
|
+
<title>Atom-Powered Robots Run Amok</title>
|
18
|
+
<link href="http://example.org/2003/12/13/atom03" />
|
19
|
+
<link rel="alternate" type="text/html" href="http://example.org/2003/12/13/atom03.html"/>
|
20
|
+
<link rel="edit" href="http://example.org/2003/12/13/atom03/edit"/>
|
21
|
+
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
|
22
|
+
<updated>2003-12-13T18:30:02Z</updated>
|
23
|
+
<summary>Some text.</summary>
|
24
|
+
</entry>
|
25
|
+
|
26
|
+
</feed>
|
metadata
CHANGED
@@ -1,90 +1,143 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: bbc_data_service
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
version: "0.2"
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Matthew Crouch
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
|
17
|
+
date: 2011-10-12 00:00:00 Z
|
18
|
+
dependencies:
|
19
|
+
- !ruby/object:Gem::Dependency
|
15
20
|
name: sinatra
|
16
|
-
|
21
|
+
prerelease: false
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
23
|
none: false
|
18
|
-
requirements:
|
24
|
+
requirements:
|
19
25
|
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 19
|
28
|
+
segments:
|
29
|
+
- 1
|
30
|
+
- 2
|
31
|
+
- 6
|
21
32
|
version: 1.2.6
|
22
33
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
26
36
|
name: activemodel
|
27
|
-
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
39
|
none: false
|
29
|
-
requirements:
|
40
|
+
requirements:
|
30
41
|
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 3
|
46
|
+
- 1
|
47
|
+
- 0
|
32
48
|
version: 3.1.0
|
33
49
|
type: :runtime
|
34
|
-
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
37
52
|
name: rdf-json
|
38
|
-
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
39
55
|
none: false
|
40
|
-
requirements:
|
56
|
+
requirements:
|
41
57
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 19
|
60
|
+
segments:
|
61
|
+
- 0
|
62
|
+
- 3
|
63
|
+
- 0
|
43
64
|
version: 0.3.0
|
44
65
|
type: :runtime
|
66
|
+
version_requirements: *id003
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: nokogiri
|
45
69
|
prerelease: false
|
46
|
-
|
47
|
-
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - "="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 3
|
76
|
+
segments:
|
77
|
+
- 1
|
78
|
+
- 5
|
79
|
+
- 0
|
80
|
+
version: 1.5.0
|
81
|
+
type: :runtime
|
82
|
+
version_requirements: *id004
|
83
|
+
- !ruby/object:Gem::Dependency
|
48
84
|
name: rspec
|
49
|
-
|
85
|
+
prerelease: false
|
86
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
50
87
|
none: false
|
51
|
-
requirements:
|
88
|
+
requirements:
|
52
89
|
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
hash: 23
|
92
|
+
segments:
|
93
|
+
- 2
|
94
|
+
- 6
|
95
|
+
- 0
|
54
96
|
version: 2.6.0
|
55
97
|
type: :development
|
56
|
-
|
57
|
-
|
58
|
-
- !ruby/object:Gem::Dependency
|
98
|
+
version_requirements: *id005
|
99
|
+
- !ruby/object:Gem::Dependency
|
59
100
|
name: turn
|
60
|
-
|
101
|
+
prerelease: false
|
102
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
61
103
|
none: false
|
62
|
-
requirements:
|
104
|
+
requirements:
|
63
105
|
- - ~>
|
64
|
-
- !ruby/object:Gem::Version
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
hash: 59
|
108
|
+
segments:
|
109
|
+
- 0
|
110
|
+
- 8
|
111
|
+
- 2
|
65
112
|
version: 0.8.2
|
66
113
|
type: :development
|
67
|
-
|
68
|
-
|
69
|
-
- !ruby/object:Gem::Dependency
|
114
|
+
version_requirements: *id006
|
115
|
+
- !ruby/object:Gem::Dependency
|
70
116
|
name: rake
|
71
|
-
|
117
|
+
prerelease: false
|
118
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
72
119
|
none: false
|
73
|
-
requirements:
|
120
|
+
requirements:
|
74
121
|
- - ~>
|
75
|
-
- !ruby/object:Gem::Version
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
hash: 63
|
124
|
+
segments:
|
125
|
+
- 0
|
126
|
+
- 9
|
127
|
+
- 2
|
76
128
|
version: 0.9.2
|
77
129
|
type: :development
|
78
|
-
|
79
|
-
version_requirements: *2152007640
|
130
|
+
version_requirements: *id007
|
80
131
|
description: BBC Data Service for fixture management
|
81
|
-
email:
|
132
|
+
email:
|
82
133
|
- matthew.crouch@bbc.co.uk
|
83
|
-
executables:
|
134
|
+
executables:
|
84
135
|
- bbc_data_service
|
85
136
|
extensions: []
|
137
|
+
|
86
138
|
extra_rdoc_files: []
|
87
|
-
|
139
|
+
|
140
|
+
files:
|
88
141
|
- .gitignore
|
89
142
|
- Gemfile
|
90
143
|
- Rakefile
|
@@ -100,44 +153,56 @@ files:
|
|
100
153
|
- lib/bbc_data_service/service_config.rb
|
101
154
|
- lib/bbc_data_service/version.rb
|
102
155
|
- lib/bbc_data_service/vocabulary.rb
|
156
|
+
- lib/bbc_data_service/xml_parser.rb
|
103
157
|
- spec/fixture_loader_spec.rb
|
104
158
|
- spec/fixtures/countries.rdf.json
|
105
159
|
- spec/fixtures/country.rdf.json
|
106
160
|
- spec/fixtures/groups-individual.json
|
107
161
|
- spec/fixtures/groups.json
|
108
162
|
- spec/fixtures/sports.json
|
163
|
+
- spec/fixtures/test-xml-feed.xml
|
109
164
|
- spec/fixtures/test_config.rb
|
110
165
|
- spec/spec_helper.rb
|
111
166
|
homepage: https://github.com/mobzilla/bbc-data-service
|
112
167
|
licenses: []
|
168
|
+
|
113
169
|
post_install_message:
|
114
170
|
rdoc_options: []
|
115
|
-
|
171
|
+
|
172
|
+
require_paths:
|
116
173
|
- lib
|
117
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
174
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
118
175
|
none: false
|
119
|
-
requirements:
|
120
|
-
- -
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
|
123
|
-
|
176
|
+
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
hash: 3
|
180
|
+
segments:
|
181
|
+
- 0
|
182
|
+
version: "0"
|
183
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
184
|
none: false
|
125
|
-
requirements:
|
126
|
-
- -
|
127
|
-
- !ruby/object:Gem::Version
|
128
|
-
|
185
|
+
requirements:
|
186
|
+
- - ">="
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
hash: 3
|
189
|
+
segments:
|
190
|
+
- 0
|
191
|
+
version: "0"
|
129
192
|
requirements: []
|
193
|
+
|
130
194
|
rubyforge_project: bbc-data-service
|
131
195
|
rubygems_version: 1.8.10
|
132
196
|
signing_key:
|
133
197
|
specification_version: 3
|
134
198
|
summary: BBC Data Service
|
135
|
-
test_files:
|
199
|
+
test_files:
|
136
200
|
- spec/fixture_loader_spec.rb
|
137
201
|
- spec/fixtures/countries.rdf.json
|
138
202
|
- spec/fixtures/country.rdf.json
|
139
203
|
- spec/fixtures/groups-individual.json
|
140
204
|
- spec/fixtures/groups.json
|
141
205
|
- spec/fixtures/sports.json
|
206
|
+
- spec/fixtures/test-xml-feed.xml
|
142
207
|
- spec/fixtures/test_config.rb
|
143
208
|
- spec/spec_helper.rb
|