cloudsponge 0.9.8 → 0.9.9a
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/lib/cloudsponge.rb +1 -0
- data/lib/cloudsponge/contact.rb +2 -2
- data/lib/cloudsponge/version.rb +1 -1
- data/test/test_contact_importer.rb +4 -4
- data/test/test_helper.rb +3 -3
- metadata +27 -4
data/lib/cloudsponge.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/cloudsponge/version')
|
1
2
|
require File.expand_path(File.dirname(__FILE__) + '/cloudsponge/contact_importer')
|
2
3
|
require File.expand_path(File.dirname(__FILE__) + '/cloudsponge/contact')
|
3
4
|
require File.expand_path(File.dirname(__FILE__) + '/cloudsponge/event')
|
data/lib/cloudsponge/contact.rb
CHANGED
@@ -24,7 +24,7 @@ module Cloudsponge
|
|
24
24
|
self.add_array_value(self.emails, email['address'], email['type'])
|
25
25
|
end
|
26
26
|
|
27
|
-
@addresses = contact_data['
|
27
|
+
@addresses = contact_data['address'] && contact_data['address'].inject([]) do |memo, address|
|
28
28
|
memo << {
|
29
29
|
:type => address['type'],
|
30
30
|
:street => address["street"],
|
@@ -51,7 +51,7 @@ module Cloudsponge
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def address
|
54
|
-
|
54
|
+
self.addresses && self.addresses.first && "#{self.addresses.first[:street]} #{self.addresses.first[:city]} #{self.addresses.first[:region]}".strip
|
55
55
|
end
|
56
56
|
|
57
57
|
def add_array_value(collection, value, type = nil)
|
data/lib/cloudsponge/version.rb
CHANGED
@@ -5,8 +5,8 @@ class TestContactImporter < Test::Unit::TestCase
|
|
5
5
|
assert Cloudsponge::VERSION
|
6
6
|
end
|
7
7
|
|
8
|
-
DOMAIN_KEY = "
|
9
|
-
DOMAIN_PASSWORD = "
|
8
|
+
DOMAIN_KEY = "Domain Key"
|
9
|
+
DOMAIN_PASSWORD = "Domain Password"
|
10
10
|
|
11
11
|
def test_u_p_import
|
12
12
|
importer = Cloudsponge::ContactImporter.new(DOMAIN_KEY, DOMAIN_PASSWORD)
|
@@ -25,9 +25,9 @@ class TestContactImporter < Test::Unit::TestCase
|
|
25
25
|
|
26
26
|
def test_contacts_with_mailing_addresses
|
27
27
|
importer = Cloudsponge::ContactImporter.new(DOMAIN_KEY, DOMAIN_PASSWORD, nil, {"include" => "mailing_address"})
|
28
|
-
importer.begin_import('
|
28
|
+
importer.begin_import('PLAXO', 'u', 'p')
|
29
29
|
contacts = events_wait(importer)
|
30
|
-
assert contacts[0].detect{ |contact| contact.addresses }
|
30
|
+
assert contacts[0].detect{ |contact| contact.addresses.any? }
|
31
31
|
end
|
32
32
|
|
33
33
|
private
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudsponge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
hash: 3856097
|
5
|
+
prerelease: true
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 9
|
9
|
+
- 9a
|
10
|
+
version: 0.9.9a
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- Graeme Rouse
|
@@ -10,7 +15,7 @@ autorequire:
|
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date: 2011-09-
|
18
|
+
date: 2011-09-27 00:00:00 -07:00
|
14
19
|
default_executable:
|
15
20
|
dependencies:
|
16
21
|
- !ruby/object:Gem::Dependency
|
@@ -21,6 +26,11 @@ dependencies:
|
|
21
26
|
requirements:
|
22
27
|
- - ">="
|
23
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 23
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 0
|
33
|
+
- 0
|
24
34
|
version: 1.0.0
|
25
35
|
type: :development
|
26
36
|
version_requirements: *id001
|
@@ -32,6 +42,11 @@ dependencies:
|
|
32
42
|
requirements:
|
33
43
|
- - ">="
|
34
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 13
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 6
|
49
|
+
- 1
|
35
50
|
version: 1.6.1
|
36
51
|
type: :runtime
|
37
52
|
version_requirements: *id002
|
@@ -80,17 +95,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
95
|
requirements:
|
81
96
|
- - ">="
|
82
97
|
- !ruby/object:Gem::Version
|
98
|
+
hash: 3
|
99
|
+
segments:
|
100
|
+
- 0
|
83
101
|
version: "0"
|
84
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
103
|
none: false
|
86
104
|
requirements:
|
87
105
|
- - ">="
|
88
106
|
- !ruby/object:Gem::Version
|
107
|
+
hash: 23
|
108
|
+
segments:
|
109
|
+
- 1
|
110
|
+
- 3
|
111
|
+
- 6
|
89
112
|
version: 1.3.6
|
90
113
|
requirements: []
|
91
114
|
|
92
115
|
rubyforge_project: cloudsponge
|
93
|
-
rubygems_version: 1.
|
116
|
+
rubygems_version: 1.3.7
|
94
117
|
signing_key:
|
95
118
|
specification_version: 3
|
96
119
|
summary: CloudSponge integration library for Ruby
|