reps_client 0.1.0 → 0.1.1
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.
- data/.rvmrc +6 -1
- data/CHANGELOG.md +16 -10
- data/README.md +47 -46
- data/lib/reps_client/version.rb +1 -1
- data/reps_client.gemspec +2 -2
- data/spec/reps_client/lead_spec.rb +4 -12
- metadata +36 -21
data/.rvmrc
CHANGED
@@ -1,2 +1,7 @@
|
|
1
|
-
|
1
|
+
if [ -z $JENKINS ]; then
|
2
|
+
branch_name=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
|
3
|
+
else
|
4
|
+
branch_name='current';
|
5
|
+
fi
|
6
|
+
|
2
7
|
rvm --create use 1.8.7@reps_client-${branch_name}
|
data/CHANGELOG.md
CHANGED
@@ -1,22 +1,28 @@
|
|
1
|
+
## 0.1.1 (2012-3-9)
|
2
|
+
|
3
|
+
* Update to latest version of modelish to pick up several bug fixes.
|
4
|
+
* Pin the version of mocha to v0.10.0, as v0.10.5 breaks savon_spec
|
5
|
+
expectations.
|
6
|
+
|
1
7
|
## 0.1.0 (2011-12-30)
|
2
8
|
|
3
9
|
* Add configuration option to enable or disable debug logging.
|
4
10
|
It is disabled by default (previously, it was always enabled).
|
5
11
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
12
|
+
``` ruby
|
13
|
+
RepsClient.configure do |config|
|
14
|
+
config.debug = true
|
15
|
+
end
|
16
|
+
```
|
11
17
|
|
12
18
|
* When logging is enabled, it defaults to logging to STDOUT, but you can
|
13
19
|
configure a custom logger.
|
14
20
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
21
|
+
``` ruby
|
22
|
+
RepsClient.configure do |config|
|
23
|
+
config.logger = Logger.new('my.log')
|
24
|
+
end
|
25
|
+
```
|
20
26
|
|
21
27
|
* Add support for ws-addressing. The REPS production environment requires
|
22
28
|
these headers on all requests.
|
data/README.md
CHANGED
@@ -6,9 +6,9 @@ This adapter provides a simple wrapper around a SOAP client for the [MDI Achieve
|
|
6
6
|
|
7
7
|
The gem is available on [RubyGems][rubygems] and can be installed via:
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
```
|
10
|
+
gem install reps_client
|
11
|
+
```
|
12
12
|
|
13
13
|
## Basics ##
|
14
14
|
|
@@ -18,32 +18,32 @@ For more details on any topic, see the [RDocs][rdocs].
|
|
18
18
|
|
19
19
|
Configuration options can be set at the module level to automatically apply it to all client instances:
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
```ruby
|
22
|
+
RepsClient.configure do |config|
|
23
|
+
config.enterprise_key = 'mykey'
|
24
|
+
end
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
client = RepsClient::Client.new
|
27
|
+
```
|
28
28
|
|
29
29
|
Or you can set it on each individual client instance:
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
```ruby
|
32
|
+
client = RepsClient::Client.new(:enterprise_key => 'mykey')
|
33
|
+
```
|
34
34
|
|
35
35
|
The external service always requires an enterprise key. Optionally, you
|
36
36
|
may also wish to change settings such as the service endpoint (which defaults
|
37
37
|
to the REPS test server) and configure debug logging (which is disabled by default).
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
39
|
+
```ruby
|
40
|
+
RepsClient.configure do |config|
|
41
|
+
config.enterprise_key = 'mykey'
|
42
|
+
config.endpoint = 'http://my.hosted.endpoint.com/lead.asmx'
|
43
|
+
config.debug = true
|
44
|
+
config.logger = Logger.new('my.log')
|
45
|
+
end
|
46
|
+
```
|
47
47
|
|
48
48
|
For a full list of configuration options, see {RepsClient::Configuration}.
|
49
49
|
|
@@ -51,37 +51,38 @@ For a full list of configuration options, see {RepsClient::Configuration}.
|
|
51
51
|
|
52
52
|
To retrieve a list of communities that belong to this enterprise in REPS:
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
54
|
+
```ruby
|
55
|
+
communities = client.get_communities
|
56
|
+
# => [#<RepsClient::Community address1="123 Anywhere Ln" city="Somewhere" community_id="2" name="Pine View Terrace" state="AK" zip="12345">, #<RepsClient::Community community_id="8" name="The Hills at Dale Valley">]
|
57
|
+
```
|
58
|
+
|
58
59
|
To retrieve a list of enumerated data types (e.g. relationship type, ad source) that are available for a particular community:
|
59
60
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
61
|
+
```ruby
|
62
|
+
pick_lists = client.get_pick_lists(2)
|
63
|
+
# => {:prefix => [#<RepsClient::Prefix prefix_id="1" value="Mr.">, #<RepsClient::Prefix prefix_id="2" value="Ms.">],
|
64
|
+
# :suffix => [#<RepsClient::Suffix suffix_id="200" value="Jr.">, #<RepsClient::Suffix suffix_id="99" value="M.D">],
|
65
|
+
# :relationship_type => [#<RepsClient::RelationshipType relationship_type_id="42" name="Self">],
|
66
|
+
# :source => [#<RepsClient::Source source_id="99" code="WEB" description="From the community website">]}
|
67
|
+
```
|
67
68
|
|
68
69
|
To save a simple lead:
|
69
70
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
71
|
+
```ruby
|
72
|
+
community_id = 2
|
73
|
+
contact = RepsClient::Contact.new(:prefix => 'Mr.',
|
74
|
+
:first_name => 'Fred',
|
75
|
+
:last_name => 'Rogers',
|
76
|
+
:email => 'misterrogers@neighborhood.com',
|
77
|
+
:relationship_to_prospect_id => 2,
|
78
|
+
:source_id => 99)
|
79
|
+
prospect = RepsClient::Prospect.new(:prefix => 'Mr.',
|
80
|
+
:first_name => 'Fred',
|
81
|
+
:last_name => 'Rogers',
|
82
|
+
:email => 'misterrogers@neighborhood.com',
|
83
|
+
:notes => 'Request for Brochure')
|
84
|
+
client.save_lead(community_id, contact, prospect)
|
85
|
+
```
|
85
86
|
|
86
87
|
[mdi]: http://mdiachieve.com
|
87
88
|
[rdocs]: http://rubydoc.info/gems/reps_client
|
data/lib/reps_client/version.rb
CHANGED
data/reps_client.gemspec
CHANGED
@@ -17,13 +17,13 @@ Gem::Specification.new do |s|
|
|
17
17
|
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
-
s.add_dependency('modelish', '>=0.
|
20
|
+
s.add_dependency('modelish', '>=0.2.2')
|
21
21
|
s.add_dependency('configlet', '~>2.1')
|
22
22
|
s.add_dependency('uuidtools', '~>2.1.2')
|
23
23
|
s.add_dependency('savon', '~>0.9.7')
|
24
24
|
|
25
25
|
s.add_development_dependency('savon_spec', '~>0.1')
|
26
|
-
|
26
|
+
s.add_development_dependency('mocha', '0.10.0') # savon_spec depends on mocha, and v0.10.5 breaks it horribly
|
27
27
|
s.add_development_dependency('rspec', '~>2.6')
|
28
28
|
s.add_development_dependency('webmock', '~>1.7')
|
29
29
|
s.add_development_dependency('fakefs', '~>0.4')
|
@@ -308,10 +308,7 @@ describe RepsClient::Contact do
|
|
308
308
|
|
309
309
|
context 'without a first name' do
|
310
310
|
before { attributes[:first_name] = nil }
|
311
|
-
|
312
|
-
it 'should raise an ArgumentError' do
|
313
|
-
expect { subject }.to raise_error ArgumentError
|
314
|
-
end
|
311
|
+
it_should_behave_like 'a contact attribute validator', :first_name
|
315
312
|
end
|
316
313
|
|
317
314
|
context 'when first name is too long' do
|
@@ -330,10 +327,7 @@ describe RepsClient::Contact do
|
|
330
327
|
|
331
328
|
context 'without a last name' do
|
332
329
|
before { attributes[:last_name] = nil }
|
333
|
-
|
334
|
-
it 'should raise an ArgumentError' do
|
335
|
-
expect { subject }.to raise_error ArgumentError
|
336
|
-
end
|
330
|
+
it_should_behave_like 'a contact attribute validator', :last_name
|
337
331
|
end
|
338
332
|
|
339
333
|
context 'when last name is too long' do
|
@@ -440,7 +434,7 @@ describe RepsClient::Contact do
|
|
440
434
|
end
|
441
435
|
|
442
436
|
its(:source_id) { should == source_id }
|
443
|
-
|
437
|
+
|
444
438
|
context 'when source id is a string representing an integer' do
|
445
439
|
let(:source_id) { '99' }
|
446
440
|
|
@@ -458,9 +452,7 @@ describe RepsClient::Contact do
|
|
458
452
|
context 'when source id is nil' do
|
459
453
|
let(:source_id) { nil }
|
460
454
|
|
461
|
-
|
462
|
-
expect { subject }.to raise_error ArgumentError
|
463
|
-
end
|
455
|
+
it_should_behave_like 'a contact attribute validator', :source_id
|
464
456
|
end
|
465
457
|
|
466
458
|
it { should be_valid }
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reps_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- maeve
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
19
|
-
default_executable:
|
18
|
+
date: 2012-03-10 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: modelish
|
@@ -26,12 +25,12 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
28
|
+
hash: 19
|
30
29
|
segments:
|
31
30
|
- 0
|
32
|
-
-
|
33
|
-
-
|
34
|
-
version: 0.
|
31
|
+
- 2
|
32
|
+
- 2
|
33
|
+
version: 0.2.2
|
35
34
|
type: :runtime
|
36
35
|
version_requirements: *id001
|
37
36
|
- !ruby/object:Gem::Dependency
|
@@ -97,9 +96,25 @@ dependencies:
|
|
97
96
|
type: :development
|
98
97
|
version_requirements: *id005
|
99
98
|
- !ruby/object:Gem::Dependency
|
100
|
-
name:
|
99
|
+
name: mocha
|
101
100
|
prerelease: false
|
102
101
|
requirement: &id006 !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
103
|
+
requirements:
|
104
|
+
- - "="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
hash: 55
|
107
|
+
segments:
|
108
|
+
- 0
|
109
|
+
- 10
|
110
|
+
- 0
|
111
|
+
version: 0.10.0
|
112
|
+
type: :development
|
113
|
+
version_requirements: *id006
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
name: rspec
|
116
|
+
prerelease: false
|
117
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
103
118
|
none: false
|
104
119
|
requirements:
|
105
120
|
- - ~>
|
@@ -110,11 +125,11 @@ dependencies:
|
|
110
125
|
- 6
|
111
126
|
version: "2.6"
|
112
127
|
type: :development
|
113
|
-
version_requirements: *
|
128
|
+
version_requirements: *id007
|
114
129
|
- !ruby/object:Gem::Dependency
|
115
130
|
name: webmock
|
116
131
|
prerelease: false
|
117
|
-
requirement: &
|
132
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
118
133
|
none: false
|
119
134
|
requirements:
|
120
135
|
- - ~>
|
@@ -125,11 +140,11 @@ dependencies:
|
|
125
140
|
- 7
|
126
141
|
version: "1.7"
|
127
142
|
type: :development
|
128
|
-
version_requirements: *
|
143
|
+
version_requirements: *id008
|
129
144
|
- !ruby/object:Gem::Dependency
|
130
145
|
name: fakefs
|
131
146
|
prerelease: false
|
132
|
-
requirement: &
|
147
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
133
148
|
none: false
|
134
149
|
requirements:
|
135
150
|
- - ~>
|
@@ -140,11 +155,11 @@ dependencies:
|
|
140
155
|
- 4
|
141
156
|
version: "0.4"
|
142
157
|
type: :development
|
143
|
-
version_requirements: *
|
158
|
+
version_requirements: *id009
|
144
159
|
- !ruby/object:Gem::Dependency
|
145
160
|
name: yard
|
146
161
|
prerelease: false
|
147
|
-
requirement: &
|
162
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
148
163
|
none: false
|
149
164
|
requirements:
|
150
165
|
- - ~>
|
@@ -155,11 +170,11 @@ dependencies:
|
|
155
170
|
- 7
|
156
171
|
version: "0.7"
|
157
172
|
type: :development
|
158
|
-
version_requirements: *
|
173
|
+
version_requirements: *id010
|
159
174
|
- !ruby/object:Gem::Dependency
|
160
175
|
name: rdiscount
|
161
176
|
prerelease: false
|
162
|
-
requirement: &
|
177
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
163
178
|
none: false
|
164
179
|
requirements:
|
165
180
|
- - ~>
|
@@ -170,7 +185,7 @@ dependencies:
|
|
170
185
|
- 6
|
171
186
|
version: "1.6"
|
172
187
|
type: :development
|
173
|
-
version_requirements: *
|
188
|
+
version_requirements: *id011
|
174
189
|
description: A simple wrapper around a SOAP client for the MDI Achieve REPS Leads web service.
|
175
190
|
email:
|
176
191
|
- maeve.revels@g5platform.com
|
@@ -222,7 +237,6 @@ files:
|
|
222
237
|
- spec/support/lead_shared_examples.rb
|
223
238
|
- spec/support/pick_list_shared_examples.rb
|
224
239
|
- spec/support/ws_addressing_shared_examples.rb
|
225
|
-
has_rdoc: true
|
226
240
|
homepage: ""
|
227
241
|
licenses: []
|
228
242
|
|
@@ -252,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
252
266
|
requirements: []
|
253
267
|
|
254
268
|
rubyforge_project: reps_client
|
255
|
-
rubygems_version: 1.
|
269
|
+
rubygems_version: 1.8.10
|
256
270
|
signing_key:
|
257
271
|
specification_version: 3
|
258
272
|
summary: Adapter for MDI Achieve REPS Leads
|
@@ -281,3 +295,4 @@ test_files:
|
|
281
295
|
- spec/support/lead_shared_examples.rb
|
282
296
|
- spec/support/pick_list_shared_examples.rb
|
283
297
|
- spec/support/ws_addressing_shared_examples.rb
|
298
|
+
has_rdoc:
|