ruby_odata 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010, Visoft, Inc.
1
+ Copyright (c) 2010-2013, Visoft, Inc.
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
@@ -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
- @next_uri = next_links[0]['href'] if @has_partial
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
@@ -1,5 +1,5 @@
1
1
  # The ruby_odata namespace
2
2
  module OData
3
3
  # The current version of ruby_odata
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
@@ -14,6 +14,7 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.rubyforge_project = "ruby-odata"
16
16
 
17
+ s.add_dependency("addressable", ">= 2.3.4")
17
18
  s.add_dependency("i18n", "~> 0.6.0")
18
19
  s.add_dependency("activesupport", ">= 3.0.0")
19
20
  s.add_dependency("rest-client", ">= 1.5.1")
@@ -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.2
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-02-22 00:00:00.000000000 Z
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: 502212128112312954
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: 502212128112312954
500
+ hash: -2874722226866545325
485
501
  requirements: []
486
502
  rubyforge_project: ruby-odata
487
- rubygems_version: 1.8.24
503
+ rubygems_version: 1.8.25
488
504
  signing_key:
489
505
  specification_version: 3
490
506
  summary: Ruby consumer of OData services.