viewpoint 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -55,10 +55,11 @@ module Viewpoint
55
55
  (resp.status == 'Success') || (raise EwsError, "Could not send message. #{resp.code}: #{resp.message}")
56
56
  msg_key = resp.items.first.keys.first
57
57
  msg_id = resp.items.first[msg_key][:item_id]
58
- msg_id = add_attachments(msg_id, file_attachments) unless file_attachments.nil?
58
+ msg_id = add_attachments(msg_id, file_attachments) unless (file_attachments.nil? || file_attachments.empty?)
59
59
  if !draft
60
60
  resp = conn.ews.send_item([msg_id])
61
61
  (resp.status == 'Success') || (raise EwsError, "Could not send message. #{resp.code}: #{resp.message}")
62
+ self.get_item(msg_id)
62
63
  else
63
64
  self.new({:item_id => msg_id})
64
65
  end
@@ -298,17 +298,18 @@ module Viewpoint
298
298
  node.add("#{NS_EWS_MESSAGES}:SyncState", sync_state)
299
299
  end
300
300
 
301
- # @todo Add support of ItemAttachment
302
301
  def attachments!(node, files, items)
302
+ # Order matters and ruby 1.8.x does not have ordered hashes.
303
+ order=[:name, :content]
303
304
  node.add("#{NS_EWS_MESSAGES}:Attachments") do |att|
304
305
  files.each do |f|
305
306
  att.add("#{NS_EWS_TYPES}:FileAttachment") do |fatt|
306
- add_hierarchy!(fatt, f)
307
+ item!(fatt, f, order)
307
308
  end
308
309
  end
309
310
  end
310
311
  end
311
-
312
+
312
313
  def attachment_ids!(node, attachment_ids)
313
314
  node.add("#{NS_EWS_MESSAGES}:AttachmentIds") do |att|
314
315
  attachment_ids.each do |id|
@@ -515,10 +515,12 @@ module Viewpoint
515
515
 
516
516
  def update_item
517
517
  action = "#{SOAP_ACTION_PREFIX}/UpdateItem"
518
- resp = invoke("#{NS_EWS_MESSAGES}:UpdateItem", :soap_action => action) do |update_item|
519
- build_update_item!(update_item)
518
+ resp = invoke("#{NS_EWS_MESSAGES}:UpdateItem", :soap_action => action) do |root|
519
+ build!(root) do
520
+ end
520
521
  end
521
- parse_update_item(resp)
522
+ resp
523
+ #parse_update_item(resp)
522
524
  end
523
525
 
524
526
  # Used to send e-mail messages that are located in the Exchange store.
@@ -84,7 +84,7 @@ module Viewpoint
84
84
  # and you should not need to pass this parameter.
85
85
  def self.endpoint=(endpoint, version = 1)
86
86
  @@endpoint = endpoint
87
- SOAP::ExchangeWebService.endpoint(:uri => endpoint, :version => version)
87
+ SOAP::ExchangeWebService.endpoint(:uri => endpoint, :version => version) && true
88
88
  end
89
89
 
90
90
  # Fetch the current endpoint
@@ -97,7 +97,7 @@ module Viewpoint
97
97
  # @param [String] pass The password
98
98
  def self.set_auth(user,pass)
99
99
  @@user = user
100
- SOAP::ExchangeWebService.set_auth(user,pass)
100
+ SOAP::ExchangeWebService.set_auth(user,pass) && true
101
101
  end
102
102
 
103
103
  # Set the http driver that the SOAP back-end will use.
@@ -15,8 +15,9 @@ describe "Test the basic functionality of Items" do
15
15
  @ews = Viewpoint::EWS::EWS.instance
16
16
  end
17
17
 
18
- it 'should create a new Message Item that we can test with.' do
19
- $message = Viewpoint::EWS::Message.send('RSPEC test subject', 'RSPEC test body', [@ews.me.email_address],nil,nil,nil,true)
18
+ it 'should create a new Message Item (with attachments) that we can test with.' do
19
+ f = File.open(File.expand_path(__FILE__), 'r+')
20
+ $message = Viewpoint::EWS::Message.send('RSPEC test subject', 'RSPEC test body', [@ews.me.email_address],nil,nil,[f],true)
20
21
  $message.should be_instance_of(Viewpoint::EWS::Message)
21
22
  end
22
23
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dan Wanek
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-29 00:00:00 -05:00
17
+ date: 2010-11-02 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency