contacts 1.0.15 → 1.0.16

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/README CHANGED
@@ -38,6 +38,7 @@ See the examples/ directory.
38
38
 
39
39
  * Britt Selvitelle from Twitter (mailto:anotherbritt@gmail.com) - http://twitter.com
40
40
  * Tony Targonski from GigPark (mailto:tony@gigpark.com) - http://gigpark.com
41
+ * Waheed Barghouthi from Watwet (mailto:waheed.barghouthi@gmail.com) - http://watwet.com
41
42
 
42
43
  This library is released under the terms of the BSD.
43
44
 
@@ -8,7 +8,7 @@ require "thread"
8
8
 
9
9
  class Contacts
10
10
  TYPES = {}
11
- VERSION = "1.0.15"
11
+ VERSION = "1.0.16"
12
12
 
13
13
  class Base
14
14
  def initialize(login, password)
@@ -1,13 +1,12 @@
1
- begin
2
- # If the json gem is available, use it
3
- require "json/add/rails"
4
- rescue MissingSourceFile
5
- # Otherwise wrap the ActiveSupport JSON implementation for our simple use case
1
+ # Use ActiveSupport's version of JSON if available
2
+ if Object.const_defined?('ActiveSupport') && ActiveSupport.const_defined?('JSON')
6
3
  class JSON
7
4
  def self.parse(i)
8
5
  ActiveSupport::JSON.decode(i)
9
6
  end
10
7
  end
8
+ else
9
+ require 'json/add/rails'
11
10
  end
12
11
 
13
12
  class Contacts
@@ -34,10 +34,18 @@ class Contacts
34
34
  elsif code == '200'
35
35
  @contacts = []
36
36
  doc.elements.each('//contact') do |cont|
37
- name = cont.elements['fullName'].nil? ? cont.elements['displayName'].text : cont.elements['fullName'].text
38
- email = cont.elements['email1'].text
39
- @contacts << [name, email]
40
- end.compact
37
+ name = if cont.elements['fullName']
38
+ cont.elements['fullName'].text
39
+ elsif cont.elements['displayName']
40
+ cont.elements['displayName'].text
41
+ end
42
+ email = if cont.elements['email1']
43
+ cont.elements['email1'].text
44
+ end
45
+ if name || email
46
+ @contacts << [name, email]
47
+ end
48
+ end
41
49
  @contacts
42
50
  else
43
51
  raise ConnectionError, PROTOCOL_ERROR
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contacts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.15
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Carlson
@@ -9,7 +9,7 @@ autorequire: contacts
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-11 00:00:00 -07:00
12
+ date: 2009-10-10 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -22,7 +22,7 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 0.4.1
24
24
  version:
25
- description: Ridiculously easy contact list information from various providers including Yahoo, Gmail, and Hotmail
25
+ description: " Ridiculously easy contact list information from various providers including Yahoo, Gmail, and Hotmail\n"
26
26
  email: lucas@rufy.com
27
27
  executables: []
28
28
 
@@ -31,7 +31,6 @@ extensions: []
31
31
  extra_rdoc_files: []
32
32
 
33
33
  files:
34
- - lib/contacts
35
34
  - lib/contacts/base.rb
36
35
  - lib/contacts/gmail.rb
37
36
  - lib/contacts/hotmail.rb
@@ -41,7 +40,6 @@ files:
41
40
  - test/example_accounts.yml
42
41
  - test/test_helper.rb
43
42
  - test/test_suite.rb
44
- - test/unit
45
43
  - test/unit/gmail_contact_importer_test.rb
46
44
  - test/unit/hotmail_contact_importer_test.rb
47
45
  - test/unit/test_accounts_test.rb
@@ -52,6 +50,8 @@ files:
52
50
  - examples/grab_contacts.rb
53
51
  has_rdoc: true
54
52
  homepage: http://rubyforge.org/projects/contacts
53
+ licenses: []
54
+
55
55
  post_install_message:
56
56
  rdoc_options: []
57
57
 
@@ -72,9 +72,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - A json parser
74
74
  rubyforge_project:
75
- rubygems_version: 1.3.1
75
+ rubygems_version: 1.3.5
76
76
  signing_key:
77
- specification_version: 2
77
+ specification_version: 3
78
78
  summary: Ridiculously easy contact list information from various providers including Yahoo, Gmail, and Hotmail
79
79
  test_files: []
80
80