exchanger 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -15,20 +15,26 @@ Supported operations
15
15
  Installing
16
16
  ==========
17
17
 
18
- gem install exchanger
18
+ ```bash
19
+ gem install exchanger
20
+ ```
19
21
 
20
22
  Configuration
21
23
  =============
22
24
 
23
- Exchanger.configure do |config|
24
- config.endpoint = "https://domain.com/EWS/Exchanger.asmx"
25
- config.username = "username"
26
- config.password = "password"
27
- end
25
+ ```ruby
26
+ Exchanger.configure do |config|
27
+ config.endpoint = "https://domain.com/EWS/Exchanger.asmx"
28
+ config.username = "username"
29
+ config.password = "password"
30
+ end
31
+ ```
28
32
 
29
33
  or configure from YAML
30
34
 
31
- Exchanger::Config.instance.from_hash(YAML.load_file("#{Rails.root}/config/exchanger.yml")[Rails.env])
35
+ ```ruby
36
+ Exchanger::Config.instance.from_hash(YAML.load_file("#{Rails.root}/config/exchanger.yml")[Rails.env])
37
+ ```
32
38
 
33
39
  Examples
34
40
  ========
@@ -36,24 +42,27 @@ Examples
36
42
  Creating and updating contacts
37
43
  ------------------------------
38
44
 
39
- folder = Exchanger::Folder.find(:contacts)
40
- contact = folder.new_contact
41
- contact.given_name = "Edgars"
42
- contact.surname = "Beigarts"
43
- contact.email_addresses = [ Exchanger::EmailAddress.new(:key => "EmailAddress1", :text => "me@domain.com") ]
44
- contact.phone_numbers = [ Exchanger::PhoneNumber.new(:key => "MobilePhone", :text => "+371 80000000") ]
45
- contact.save # CreateItem operation
46
- contact.company_name = "Tieto"
47
- contact.save # UpdateItem operation
48
- contact.destroy # DeleteItem operation
45
+ ```ruby
46
+ folder = Exchanger::Folder.find(:contacts)
47
+ contact = folder.new_contact
48
+ contact.given_name = "Edgars"
49
+ contact.surname = "Beigarts"
50
+ contact.email_addresses = [ Exchanger::EmailAddress.new(:key => "EmailAddress1", :text => "me@example.com") ]
51
+ contact.phone_numbers = [ Exchanger::PhoneNumber.new(:key => "MobilePhone", :text => "+371 80000000") ]
52
+ contact.save # CreateItem operation
53
+ contact.company_name = "Example Inc."
54
+ contact.save # UpdateItem operation
55
+ contact.destroy # DeleteItem operation
56
+ ```
49
57
 
50
58
  Searching in Global Address Book
51
59
  --------------------------------
52
60
 
53
- mailboxes = Exchanger::Mailbox.search("John")
61
+ ```ruby
62
+ mailboxes = Exchanger::Mailbox.search("John")
63
+ ```
54
64
 
55
65
  Alternatives
56
66
  ============
57
67
 
58
- * [github.com/jrun/ews-api](http://github.com/jrun/ews-api)
59
- * [github.com/zenchild/Viewpoint](http://github.com/zenchild/Viewpoint)
68
+ * [Exchange Clients in Ruby Toolbox](https://www.ruby-toolbox.com/categories/Exchange_Clients)
@@ -5,26 +5,28 @@ module Exchanger
5
5
  include Exchanger::Dirty
6
6
  include Exchanger::Persistence
7
7
 
8
- class_inheritable_accessor :elements
9
- class_inheritable_accessor :keys
10
- class_inheritable_accessor :field_uri_namespace
11
- class_inheritable_accessor :identifier_name
8
+ class_attribute :elements
9
+ class_attribute :keys
10
+ class_attribute :field_uri_namespace
11
+ class_attribute :identifier_name
12
12
 
13
- # Exchanger expects elements to be in the same order as defined in types.xsd
13
+ # Exchange expects elements to be in the same order as defined in types.xsd
14
14
  self.elements = ActiveSupport::OrderedHash.new
15
15
  self.keys = []
16
16
 
17
17
  # Define a new child element.
18
18
  def self.element(name, options = {})
19
19
  options[:field_uri_namespace] ||= self.field_uri_namespace
20
- elements[name] = Field.new(name, options)
20
+ self.elements = self.elements.dup
21
+ self.elements[name] = Field.new(name, options)
21
22
  create_element_accessors(name)
22
23
  add_dirty_methods(name)
23
24
  end
24
25
 
25
26
  # Defina a new element attribute.
26
27
  def self.key(name, options = {})
27
- keys << name
28
+ self.keys = self.keys.dup
29
+ self.keys << name
28
30
  create_element_accessors(name)
29
31
  add_dirty_methods(name)
30
32
  end
@@ -131,7 +133,7 @@ module Exchanger
131
133
  # Create or update existing fields
132
134
  if changes.include?(name.to_s)
133
135
  field.to_xml_updates(value) do |field_uri_xml, element_xml|
134
- # Exchanger does not like updating to nil, so delete those.
136
+ # Exchange does not like updating to nil, so delete those.
135
137
  if element_xml.text.present?
136
138
  set_item_field = doc.create_element("SetItemField")
137
139
  set_item_field << field_uri_xml
@@ -1,7 +1,7 @@
1
1
  module Exchanger
2
2
  # Abstract class for operations.
3
3
  #
4
- # Exchanger Web Services provides many operations that enable you to access
4
+ # Exchange Web Services provides many operations that enable you to access
5
5
  # information from the Exchanger store.
6
6
  #
7
7
  # http://msdn.microsoft.com/en-us/library/bb409286.aspx
@@ -1,3 +1,3 @@
1
1
  module Exchanger
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exchanger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-09 00:00:00.000000000Z
12
+ date: 2012-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &2155949560 !ruby/object:Gem::Requirement
16
+ requirement: &2153120980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.2.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2155949560
24
+ version_requirements: *2153120980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &2155948180 !ruby/object:Gem::Requirement
27
+ requirement: &2153120460 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.3.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2155948180
35
+ version_requirements: *2153120460
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: httpclient
38
- requirement: &2155946420 !ruby/object:Gem::Requirement
38
+ requirement: &2153119980 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.1.5.2
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2155946420
46
+ version_requirements: *2153119980
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rubyntlm
49
- requirement: &2155944760 !ruby/object:Gem::Requirement
49
+ requirement: &2153119500 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.1.1
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2155944760
57
+ version_requirements: *2153119500
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rake
60
- requirement: &2155943420 !ruby/object:Gem::Requirement
60
+ requirement: &2153119120 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2155943420
68
+ version_requirements: *2153119120
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: i18n
71
- requirement: &2155941920 !ruby/object:Gem::Requirement
71
+ requirement: &2153118660 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2155941920
79
+ version_requirements: *2153118660
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &2155940420 !ruby/object:Gem::Requirement
82
+ requirement: &2153118140 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 2.6.0
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2155940420
90
+ version_requirements: *2153118140
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rcov
93
- requirement: &2155939500 !ruby/object:Gem::Requirement
93
+ requirement: &2153117720 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *2155939500
101
+ version_requirements: *2153117720
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: yard
104
- requirement: &2155938420 !ruby/object:Gem::Requirement
104
+ requirement: &2153117260 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *2155938420
112
+ version_requirements: *2153117260
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: BlueCloth
115
- requirement: &2155937360 !ruby/object:Gem::Requirement
115
+ requirement: &2153116840 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,7 +120,7 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *2155937360
123
+ version_requirements: *2153116840
124
124
  description: Ruby library for accessing Microsoft Exchange using Exchange Web Services
125
125
  email: 1@wb4.lv
126
126
  executables: []
@@ -199,7 +199,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
199
199
  version: '0'
200
200
  segments:
201
201
  - 0
202
- hash: 4456452976116017583
202
+ hash: -2432050375325580757
203
203
  required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  none: false
205
205
  requirements:
@@ -208,10 +208,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  version: '0'
209
209
  segments:
210
210
  - 0
211
- hash: 4456452976116017583
211
+ hash: -2432050375325580757
212
212
  requirements: []
213
213
  rubyforge_project:
214
- rubygems_version: 1.8.6
214
+ rubygems_version: 1.8.10
215
215
  signing_key:
216
216
  specification_version: 3
217
217
  summary: Ruby library for accessing Microsoft Exchange using Exchange Web Services