ruby_odata 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +8 -1
- data/LICENSE +1 -1
- data/lib/ruby_odata/service.rb +5 -1
- data/lib/ruby_odata/version.rb +1 -1
- data/ruby_odata.gemspec +1 -0
- data/spec/service_spec.rb +26 -1
- metadata +21 -5
data/CHANGELOG.md
CHANGED
@@ -108,4 +108,11 @@
|
|
108
108
|
* Added the ability to pass in :rest_options to the service constructor within the options hash.
|
109
109
|
|
110
110
|
* Bug Fixes
|
111
|
-
* Prevented `svc.load_property` from mutating the obj's metadata uri (thanks [@sillylogger](https://github.com/sillylogger))
|
111
|
+
* Prevented `svc.load_property` from mutating the obj's metadata uri (thanks [@sillylogger](https://github.com/sillylogger))
|
112
|
+
|
113
|
+
### 0.1.3
|
114
|
+
* Bug Fixes
|
115
|
+
* Persists the additional_params for partial calls (thanks [@levelboy](https://github.com/levelboy))
|
116
|
+
|
117
|
+
* Other
|
118
|
+
* Specified v2.3.4 of the addressable gem since there was a bug when testing ruby_odata against Ruby 1.8.7
|
data/LICENSE
CHANGED
data/lib/ruby_odata/service.rb
CHANGED
@@ -437,7 +437,11 @@ class Service
|
|
437
437
|
def extract_partial(doc)
|
438
438
|
next_links = doc.xpath('//atom:link[@rel="next"]', @ds_namespaces)
|
439
439
|
@has_partial = next_links.any?
|
440
|
-
|
440
|
+
if @has_partial
|
441
|
+
uri = Addressable::URI.parse(next_links[0]['href'])
|
442
|
+
uri.query_values = uri.query_values.merge @additional_params unless @additional_params.empty?
|
443
|
+
@next_uri = uri.to_s
|
444
|
+
end
|
441
445
|
end
|
442
446
|
|
443
447
|
def handle_partial
|
data/lib/ruby_odata/version.rb
CHANGED
data/ruby_odata.gemspec
CHANGED
data/spec/service_spec.rb
CHANGED
@@ -377,6 +377,31 @@ module OData
|
|
377
377
|
end
|
378
378
|
results.count.should eq 3
|
379
379
|
end
|
380
|
+
|
381
|
+
context "with additional_params" do
|
382
|
+
before(:each) do
|
383
|
+
stub_request(:get, "http://test.com/test.svc/$metadata?extra_param=value").
|
384
|
+
with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate'}).
|
385
|
+
to_return(:status => 200, :body => File.new(File.expand_path("../fixtures/partial/partial_feed_metadata.xml", __FILE__)), :headers => {})
|
386
|
+
|
387
|
+
stub_request(:get, "http://test.com/test.svc/Partials?extra_param=value").
|
388
|
+
with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate'}).
|
389
|
+
to_return(:status => 200, :body => File.new(File.expand_path("../fixtures/partial/partial_feed_part_1.xml", __FILE__)), :headers => {})
|
390
|
+
|
391
|
+
stub_request(:get, "http://test.com/test.svc/Partials?$skiptoken='ERNSH'&extra_param=value").
|
392
|
+
with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate'}).
|
393
|
+
to_return(:status => 200, :body => File.new(File.expand_path("../fixtures/partial/partial_feed_part_2.xml", __FILE__)), :headers => {})
|
394
|
+
end
|
395
|
+
|
396
|
+
it "should persist the additional parameters for the next call" do
|
397
|
+
svc = OData::Service.new("http://test.com/test.svc/", :eager_partial => false, :additional_params => { :extra_param => 'value' })
|
398
|
+
svc.Partials
|
399
|
+
svc.execute
|
400
|
+
svc.next
|
401
|
+
|
402
|
+
a_request(:get, "http://test.com/test.svc/Partials?$skiptoken='ERNSH'&extra_param=value").should have_been_made
|
403
|
+
end
|
404
|
+
end
|
380
405
|
end
|
381
406
|
|
382
407
|
describe "link queries" do
|
@@ -733,7 +758,7 @@ module OData
|
|
733
758
|
|
734
759
|
describe "restful options" do
|
735
760
|
it "should allow " do
|
736
|
-
|
761
|
+
|
737
762
|
end
|
738
763
|
end
|
739
764
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_odata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: addressable
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.3.4
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.3.4
|
14
30
|
- !ruby/object:Gem::Dependency
|
15
31
|
name: i18n
|
16
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -472,7 +488,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
472
488
|
version: '0'
|
473
489
|
segments:
|
474
490
|
- 0
|
475
|
-
hash:
|
491
|
+
hash: -2874722226866545325
|
476
492
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
477
493
|
none: false
|
478
494
|
requirements:
|
@@ -481,10 +497,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
481
497
|
version: '0'
|
482
498
|
segments:
|
483
499
|
- 0
|
484
|
-
hash:
|
500
|
+
hash: -2874722226866545325
|
485
501
|
requirements: []
|
486
502
|
rubyforge_project: ruby-odata
|
487
|
-
rubygems_version: 1.8.
|
503
|
+
rubygems_version: 1.8.25
|
488
504
|
signing_key:
|
489
505
|
specification_version: 3
|
490
506
|
summary: Ruby consumer of OData services.
|