ruby_odata 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -2
- data/.travis.yml +2 -1
- data/.yardopts +6 -0
- data/CHANGELOG.md +102 -0
- data/Guardfile +14 -0
- data/README.md +285 -0
- data/Rakefile +0 -7
- data/features/basic_auth.feature +3 -2
- data/features/batch_request.feature +7 -6
- data/features/cassettes/basic_auth_protected_resource.yml +57 -0
- data/features/cassettes/batch_request_additions.yml +69 -0
- data/features/cassettes/batch_request_deletes.yml +69 -0
- data/features/cassettes/batch_request_updates.yml +69 -0
- data/features/cassettes/clean_database_for_testing.yml +46 -0
- data/features/cassettes/cucumber_tags/basic_auth.yml +297 -0
- data/features/cassettes/cucumber_tags/batch_request.yml +1459 -0
- data/features/cassettes/cucumber_tags/complex_types.yml +326 -0
- data/features/cassettes/cucumber_tags/error_handling.yml +64 -0
- data/features/cassettes/cucumber_tags/query_builder.yml +2025 -0
- data/features/cassettes/cucumber_tags/service.yml +234 -0
- data/features/cassettes/cucumber_tags/service_manage.yml +937 -0
- data/features/cassettes/cucumber_tags/service_methods.yml +647 -0
- data/features/cassettes/cucumber_tags/ssl.yml +203 -0
- data/features/cassettes/cucumber_tags/type_conversion.yml +337 -0
- data/features/cassettes/service_manage_additions.yml +65 -0
- data/features/cassettes/service_manage_deletions.yml +58 -0
- data/features/cassettes/service_manage_deletions_2.yml +58 -0
- data/features/cassettes/unsecured_metadata.yml +89 -0
- data/features/complex_types.feature +4 -3
- data/features/error_handling.feature +14 -0
- data/features/query_builder.feature +30 -9
- data/features/service.feature +4 -3
- data/features/service_manage.feature +6 -5
- data/features/service_methods.feature +3 -2
- data/features/ssl.feature +8 -8
- data/features/step_definitions/service_steps.rb +38 -24
- data/features/support/env.rb +1 -3
- data/features/support/hooks.rb +3 -2
- data/features/support/pickle.rb +29 -18
- data/features/support/vcr.rb +24 -0
- data/features/type_conversion.feature +16 -17
- data/lib/ruby_odata/association.rb +7 -6
- data/lib/ruby_odata/class_builder.rb +6 -7
- data/lib/ruby_odata/exceptions.rb +4 -0
- data/lib/ruby_odata/helpers.rb +11 -0
- data/lib/ruby_odata/operation.rb +5 -6
- data/lib/ruby_odata/property_metadata.rb +4 -5
- data/lib/ruby_odata/query_builder.rb +98 -63
- data/lib/ruby_odata/service.rb +118 -103
- data/lib/ruby_odata/version.rb +3 -1
- data/lib/ruby_odata.rb +20 -18
- data/ruby_odata.gemspec +16 -12
- data/spec/query_builder_spec.rb +78 -14
- data/spec/service_spec.rb +83 -83
- data/spec/support/sample_service_matcher.rb +15 -0
- data/test/RubyODataService/RubyODataService/App_Data/.gitkeep +0 -0
- data/test/blueprints.rb +15 -9
- data/test/usage_samples/querying.rb +5 -1
- data/test/usage_samples/sample_data.rb +1 -3
- metadata +213 -39
- data/CHANGELOG.rdoc +0 -88
- data/README.rdoc +0 -259
@@ -0,0 +1,234 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://win7dev:8989/SampleService/RubyOData.svc/Categories
|
6
|
+
body:
|
7
|
+
encoding: ASCII-8BIT
|
8
|
+
string: ! '{"Name":"Test Category","AuditFields":{"CreatedBy":"Machinist"}}'
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*; q=0.5, application/xml'
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
Content-Length:
|
17
|
+
- '64'
|
18
|
+
User-Agent:
|
19
|
+
- Ruby
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 201
|
23
|
+
message: Created
|
24
|
+
headers:
|
25
|
+
Cache-Control:
|
26
|
+
- no-cache
|
27
|
+
Content-Length:
|
28
|
+
- '1249'
|
29
|
+
Content-Type:
|
30
|
+
- application/atom+xml;type=entry;charset=utf-8
|
31
|
+
Location:
|
32
|
+
- http://win7dev:8989/SampleService/RubyOData.svc/Categories(1)
|
33
|
+
Server:
|
34
|
+
- Microsoft-IIS/7.5
|
35
|
+
Set-Cookie:
|
36
|
+
- ASP.NET_SessionId=ga1wgtwnw3be1stztnho25m2; path=/; HttpOnly
|
37
|
+
X-Content-Type-Options:
|
38
|
+
- nosniff
|
39
|
+
Dataserviceversion:
|
40
|
+
- 1.0;
|
41
|
+
X-Aspnet-Version:
|
42
|
+
- 4.0.30319
|
43
|
+
X-Powered-By:
|
44
|
+
- ASP.NET
|
45
|
+
Date:
|
46
|
+
- Tue, 07 Aug 2012 21:21:48 GMT
|
47
|
+
body:
|
48
|
+
encoding: US-ASCII
|
49
|
+
string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/RubyOData.svc/"
|
50
|
+
xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
|
51
|
+
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
|
52
|
+
xmlns:gml="http://www.opengis.net/gml"><id>http://win7dev:8989/SampleService/RubyOData.svc/Categories(1)</id><category
|
53
|
+
term="RubyODataService.Category" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
|
54
|
+
/><link rel="edit" title="Category" href="Categories(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
|
55
|
+
type="application/atom+xml;type=feed" title="Products" href="Categories(1)/Products"
|
56
|
+
/><title /><updated>2012-08-07T21:21:48Z</updated><author><name /></author><content
|
57
|
+
type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Test
|
58
|
+
Category</d:Name><d:AuditFields m:type="RubyODataService.AuditFields"><d:CreateDate
|
59
|
+
m:type="Edm.DateTime">2012-08-07T21:21:48.5625Z</d:CreateDate><d:ModifiedDate
|
60
|
+
m:type="Edm.DateTime">2012-08-07T21:21:48.5625Z</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
|
61
|
+
http_version: !!null
|
62
|
+
recorded_at: Tue, 07 Aug 2012 21:21:48 GMT
|
63
|
+
- request:
|
64
|
+
method: get
|
65
|
+
uri: http://win7dev:8989/SampleService/RubyOData.svc/Categories(1)
|
66
|
+
body:
|
67
|
+
encoding: US-ASCII
|
68
|
+
string: ''
|
69
|
+
headers:
|
70
|
+
Accept:
|
71
|
+
- ! '*/*; q=0.5, application/xml'
|
72
|
+
Accept-Encoding:
|
73
|
+
- gzip, deflate
|
74
|
+
User-Agent:
|
75
|
+
- Ruby
|
76
|
+
response:
|
77
|
+
status:
|
78
|
+
code: 200
|
79
|
+
message: OK
|
80
|
+
headers:
|
81
|
+
Cache-Control:
|
82
|
+
- no-cache
|
83
|
+
Content-Length:
|
84
|
+
- '1245'
|
85
|
+
Content-Type:
|
86
|
+
- application/atom+xml;type=entry;charset=utf-8
|
87
|
+
Server:
|
88
|
+
- Microsoft-IIS/7.5
|
89
|
+
Set-Cookie:
|
90
|
+
- ASP.NET_SessionId=gylpmoalyq35y504lhqo0bei; path=/; HttpOnly
|
91
|
+
X-Content-Type-Options:
|
92
|
+
- nosniff
|
93
|
+
Dataserviceversion:
|
94
|
+
- 1.0;
|
95
|
+
X-Aspnet-Version:
|
96
|
+
- 4.0.30319
|
97
|
+
X-Powered-By:
|
98
|
+
- ASP.NET
|
99
|
+
Date:
|
100
|
+
- Tue, 07 Aug 2012 21:21:48 GMT
|
101
|
+
body:
|
102
|
+
encoding: US-ASCII
|
103
|
+
string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/RubyOData.svc/"
|
104
|
+
xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
|
105
|
+
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
|
106
|
+
xmlns:gml="http://www.opengis.net/gml"><id>http://win7dev:8989/SampleService/RubyOData.svc/Categories(1)</id><category
|
107
|
+
term="RubyODataService.Category" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
|
108
|
+
/><link rel="edit" title="Category" href="Categories(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
|
109
|
+
type="application/atom+xml;type=feed" title="Products" href="Categories(1)/Products"
|
110
|
+
/><title /><updated>2012-08-07T21:21:48Z</updated><author><name /></author><content
|
111
|
+
type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Test
|
112
|
+
Category</d:Name><d:AuditFields m:type="RubyODataService.AuditFields"><d:CreateDate
|
113
|
+
m:type="Edm.DateTime">2012-08-07T21:21:48.563</d:CreateDate><d:ModifiedDate
|
114
|
+
m:type="Edm.DateTime">2012-08-07T21:21:48.563</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
|
115
|
+
http_version: !!null
|
116
|
+
recorded_at: Tue, 07 Aug 2012 21:21:48 GMT
|
117
|
+
- request:
|
118
|
+
method: post
|
119
|
+
uri: http://win7dev:8989/SampleService/RubyOData.svc/Products
|
120
|
+
body:
|
121
|
+
encoding: ASCII-8BIT
|
122
|
+
string: ! '{"Name":"Widget 0060","Description":"Test Widget","Price":"10.25","Category":{"Name":"Category
|
123
|
+
0062","AuditFields":{"CreatedBy":"Machinist"}},"AuditFields":{"CreatedBy":"Machinist"}}'
|
124
|
+
headers:
|
125
|
+
Accept:
|
126
|
+
- ! '*/*; q=0.5, application/xml'
|
127
|
+
Accept-Encoding:
|
128
|
+
- gzip, deflate
|
129
|
+
Content-Type:
|
130
|
+
- application/json
|
131
|
+
Content-Length:
|
132
|
+
- '182'
|
133
|
+
User-Agent:
|
134
|
+
- Ruby
|
135
|
+
response:
|
136
|
+
status:
|
137
|
+
code: 201
|
138
|
+
message: Created
|
139
|
+
headers:
|
140
|
+
Cache-Control:
|
141
|
+
- no-cache
|
142
|
+
Content-Length:
|
143
|
+
- '1436'
|
144
|
+
Content-Type:
|
145
|
+
- application/atom+xml;type=entry;charset=utf-8
|
146
|
+
Location:
|
147
|
+
- http://win7dev:8989/SampleService/RubyOData.svc/Products(1)
|
148
|
+
Server:
|
149
|
+
- Microsoft-IIS/7.5
|
150
|
+
Set-Cookie:
|
151
|
+
- ASP.NET_SessionId=2h2ktex1otob3k3ccc2phazs; path=/; HttpOnly
|
152
|
+
X-Content-Type-Options:
|
153
|
+
- nosniff
|
154
|
+
Dataserviceversion:
|
155
|
+
- 1.0;
|
156
|
+
X-Aspnet-Version:
|
157
|
+
- 4.0.30319
|
158
|
+
X-Powered-By:
|
159
|
+
- ASP.NET
|
160
|
+
Date:
|
161
|
+
- Tue, 07 Aug 2012 21:21:48 GMT
|
162
|
+
body:
|
163
|
+
encoding: US-ASCII
|
164
|
+
string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/RubyOData.svc/"
|
165
|
+
xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
|
166
|
+
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
|
167
|
+
xmlns:gml="http://www.opengis.net/gml"><id>http://win7dev:8989/SampleService/RubyOData.svc/Products(1)</id><category
|
168
|
+
term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
|
169
|
+
/><link rel="edit" title="Product" href="Products(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
|
170
|
+
type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category"
|
171
|
+
/><title /><updated>2012-08-07T21:21:48Z</updated><author><name /></author><content
|
172
|
+
type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Widget
|
173
|
+
0060</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">10.25</d:Price><d:DiscontinuedDate
|
174
|
+
m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">1</d:CategoryId><d:AuditFields
|
175
|
+
m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2012-08-07T21:21:48.96875Z</d:CreateDate><d:ModifiedDate
|
176
|
+
m:type="Edm.DateTime">2012-08-07T21:21:48.96875Z</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
|
177
|
+
http_version: !!null
|
178
|
+
recorded_at: Tue, 07 Aug 2012 21:21:49 GMT
|
179
|
+
- request:
|
180
|
+
method: get
|
181
|
+
uri: http://win7dev:8989/SampleService/RubyOData.svc/Products(1)
|
182
|
+
body:
|
183
|
+
encoding: US-ASCII
|
184
|
+
string: ''
|
185
|
+
headers:
|
186
|
+
Accept:
|
187
|
+
- ! '*/*; q=0.5, application/xml'
|
188
|
+
Accept-Encoding:
|
189
|
+
- gzip, deflate
|
190
|
+
User-Agent:
|
191
|
+
- Ruby
|
192
|
+
response:
|
193
|
+
status:
|
194
|
+
code: 200
|
195
|
+
message: OK
|
196
|
+
headers:
|
197
|
+
Cache-Control:
|
198
|
+
- no-cache
|
199
|
+
Content-Length:
|
200
|
+
- '1430'
|
201
|
+
Content-Type:
|
202
|
+
- application/atom+xml;type=entry;charset=utf-8
|
203
|
+
Server:
|
204
|
+
- Microsoft-IIS/7.5
|
205
|
+
Set-Cookie:
|
206
|
+
- ASP.NET_SessionId=nzeip31l14cdhu5tw5g5imsc; path=/; HttpOnly
|
207
|
+
X-Content-Type-Options:
|
208
|
+
- nosniff
|
209
|
+
Dataserviceversion:
|
210
|
+
- 1.0;
|
211
|
+
X-Aspnet-Version:
|
212
|
+
- 4.0.30319
|
213
|
+
X-Powered-By:
|
214
|
+
- ASP.NET
|
215
|
+
Date:
|
216
|
+
- Tue, 07 Aug 2012 21:21:48 GMT
|
217
|
+
body:
|
218
|
+
encoding: US-ASCII
|
219
|
+
string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/RubyOData.svc/"
|
220
|
+
xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
|
221
|
+
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
|
222
|
+
xmlns:gml="http://www.opengis.net/gml"><id>http://win7dev:8989/SampleService/RubyOData.svc/Products(1)</id><category
|
223
|
+
term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
|
224
|
+
/><link rel="edit" title="Product" href="Products(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
|
225
|
+
type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category"
|
226
|
+
/><title /><updated>2012-08-07T21:21:49Z</updated><author><name /></author><content
|
227
|
+
type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Widget
|
228
|
+
0060</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">10.25</d:Price><d:DiscontinuedDate
|
229
|
+
m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">1</d:CategoryId><d:AuditFields
|
230
|
+
m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2012-08-07T21:21:48.967</d:CreateDate><d:ModifiedDate
|
231
|
+
m:type="Edm.DateTime">2012-08-07T21:21:48.967</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
|
232
|
+
http_version: !!null
|
233
|
+
recorded_at: Tue, 07 Aug 2012 21:21:49 GMT
|
234
|
+
recorded_with: VCR 2.2.4
|