rews 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -1,6 +1,6 @@
1
1
  module Rews
2
2
  class Client
3
- attr_reader :client
3
+ attr_reader :savon_client
4
4
  attr_accessor :logdev
5
5
 
6
6
  # create a +Client+ to access Exchange Web Services
@@ -13,7 +13,7 @@ module Rews
13
13
  @auth_type = auth_type
14
14
  @user=user
15
15
  @password=password
16
- @client = Savon::Client.new do
16
+ @savon_client = Savon::Client.new do
17
17
  wsdl.endpoint = endpoint
18
18
  wsdl.namespace = SCHEMA_MESSAGES
19
19
 
@@ -32,7 +32,7 @@ module Rews
32
32
  # * get a folder from another mailbox
33
33
  # client.distinguished_folder_id('inbox', 'foo@bar.com')
34
34
  def distinguished_folder_id(id, mailbox_email=nil)
35
- Folder::DistinguishedFolderId.new(client, id, mailbox_email)
35
+ Folder::DistinguishedFolderId.new(self, id, mailbox_email)
36
36
  end
37
37
 
38
38
  # yield a +Logger+ if +logdev+ has been set
@@ -96,7 +96,7 @@ module Rews
96
96
  opts = check_opts(FIND_FOLDER_OPTS, opts)
97
97
 
98
98
  r = with_error_check(client, :find_folder_response, :response_messages, :find_folder_response_message) do
99
- client.request(:wsdl, "FindFolder", "Traversal"=>"Shallow") do
99
+ client.savon_client.request(:wsdl, "FindFolder", "Traversal"=>"Shallow") do
100
100
  soap.namespaces["xmlns:t"]=SCHEMA_TYPES
101
101
  xml = Builder::XmlMarkup.new
102
102
 
@@ -143,7 +143,7 @@ module Rews
143
143
  opts = check_opts(FIND_ITEM_OPTS, opts)
144
144
 
145
145
  r = with_error_check(client, :find_item_response, :response_messages, :find_item_response_message) do
146
- client.request(:wsdl, "FindItem", "Traversal"=>"Shallow") do
146
+ client.savon_client.request(:wsdl, "FindItem", "Traversal"=>"Shallow") do
147
147
  soap.namespaces["xmlns:t"]=SCHEMA_TYPES
148
148
 
149
149
  xml = Builder::XmlMarkup.new
@@ -191,7 +191,7 @@ module Rews
191
191
  message_ids = message_ids.result if message_ids.is_a?(FindResult)
192
192
 
193
193
  r = with_error_check(client, :get_item_response,:response_messages,:get_item_response_message) do
194
- client.request(:wsdl, "GetItem") do
194
+ client.savon_client.request(:wsdl, "GetItem") do
195
195
  soap.namespaces["xmlns:t"]=SCHEMA_TYPES
196
196
 
197
197
  xml = Builder::XmlMarkup.new
@@ -223,7 +223,7 @@ module Rews
223
223
  message_ids = message_ids.result if message_ids.is_a?(FindResult)
224
224
 
225
225
  r = with_error_check(client, :delete_item_response, :response_messages, :delete_item_response_message) do
226
- client.request(:wsdl, "DeleteItem", :DeleteType=>opts[:delete_type]) do
226
+ client.savon_client.request(:wsdl, "DeleteItem", :DeleteType=>opts[:delete_type]) do
227
227
  soap.namespaces["xmlns:t"]=SCHEMA_TYPES
228
228
 
229
229
  xml = Builder::XmlMarkup.new
@@ -91,7 +91,7 @@ module Rews
91
91
  def get_item(opts={})
92
92
  opts = check_opts(GET_ITEM_OPTS, opts)
93
93
  r = with_error_check(client, :get_item_response,:response_messages,:get_item_response_message) do
94
- client.request(:wsdl, "GetItem") do
94
+ client.savon_client.request(:wsdl, "GetItem") do
95
95
  soap.namespaces["xmlns:t"]=SCHEMA_TYPES
96
96
 
97
97
  xml = Builder::XmlMarkup.new
@@ -116,7 +116,7 @@ module Rews
116
116
  def delete_item(opts={})
117
117
  opts = check_opts(DELETE_ITEM_OPTS, opts)
118
118
  r = with_error_check(client, :delete_item_response, :response_messages, :delete_item_response_message) do
119
- client.request(:wsdl, "DeleteItem", :DeleteType=>opts[:delete_type]) do
119
+ client.savon_client.request(:wsdl, "DeleteItem", :DeleteType=>opts[:delete_type]) do
120
120
  soap.namespaces["xmlns:t"]=SCHEMA_TYPES
121
121
 
122
122
  xml = Builder::XmlMarkup.new
@@ -5,7 +5,7 @@ module Rews
5
5
  it "should create new DistinguishedFolderIds for arbitrary mailboxes" do
6
6
  client = Client.new("https://foo/EWS/Exchange.asmx", :ntlm, "EXCHDOM\\foo", "password")
7
7
 
8
- mock(Folder::DistinguishedFolderId).new(client.client, 'inbox', 'foo@bar.com')
8
+ mock(Folder::DistinguishedFolderId).new(client, 'inbox', 'foo@bar.com')
9
9
 
10
10
  client.distinguished_folder_id('inbox', 'foo@bar.com')
11
11
  end
@@ -13,7 +13,7 @@ module Rews
13
13
  it "should create new DistinguishedFolderIds for the default mailbox" do
14
14
  client = Client.new("https://foo/EWS/Exchange.asmx", :ntlm, "EXCHDOM\\foo", "password")
15
15
 
16
- mock(Folder::DistinguishedFolderId).new(client.client, 'inbox', nil)
16
+ mock(Folder::DistinguishedFolderId).new(client, 'inbox', nil)
17
17
 
18
18
  client.distinguished_folder_id('inbox')
19
19
  end
@@ -69,7 +69,7 @@ module Rews
69
69
  describe Folder::BaseFolderId do
70
70
  def mock_request(client, action, attrs, response)
71
71
  # deal with different call arity
72
- mock(client).request(*[:wsdl, action, attrs].compact) do |*args|
72
+ mock(client).savon_client.mock!.request(*[:wsdl, action, attrs].compact) do |*args|
73
73
  block = args.last # block is the last arg
74
74
 
75
75
  ctx = RequestProxy.new()
@@ -42,7 +42,7 @@ module Rews
42
42
 
43
43
  def mock_request(client, action, attrs, response)
44
44
  # deal with different call arity
45
- mock(client).request(*[:wsdl, action, attrs].compact) do |*args|
45
+ mock(client).savon_client.mock!.request(*[:wsdl, action, attrs].compact) do |*args|
46
46
  block = args.last # block is the last arg
47
47
 
48
48
  ctx = RequestProxy.new()
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rews
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Trampoline Systems Ltd
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-16 00:00:00 +00:00
18
+ date: 2011-03-17 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency