gmail_contacts 1.4.1 → 1.5

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/.autotest ADDED
@@ -0,0 +1,3 @@
1
+ Autotest.add_hook :initialize do |at|
2
+ at.testlib = 'minitest/unit'
3
+ end
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 1.5 / 2009-08-20
2
+
3
+ * 1 minor enhancement
4
+ * #fetch_photo now accepts a photo URL as well
5
+
1
6
  === 1.4.1 / 2009-05-20
2
7
 
3
8
  * 1 bug fix
data/Manifest.txt CHANGED
@@ -1,3 +1,4 @@
1
+ .autotest
1
2
  .document
2
3
  History.txt
3
4
  Manifest.txt
data/Rakefile CHANGED
@@ -2,17 +2,18 @@
2
2
 
3
3
  require 'rubygems'
4
4
  require 'hoe'
5
- require './lib/gmail_contacts.rb'
6
5
 
7
- Hoe.new('gmail_contacts', GmailContacts::VERSION) do |p|
8
- p.rubyforge_name = 'seattlerb' # if different than lowercase project name
9
- p.developer 'Eric Hodel', 'drbrain@segment7.net'
6
+ Hoe.plugin :seattlerb
10
7
 
11
- p.testlib = :minitest
8
+ Hoe.spec 'gmail_contacts' do
9
+ developer 'Eric Hodel', 'drbrain@segment7.net'
12
10
 
13
- p.extra_deps << ['gdata', '~> 1.1']
14
- p.extra_deps << ['nokogiri', '~> 1.2']
15
- p.extra_dev_deps << ['minitest', '~> 1.3']
11
+ self.rubyforge_name = 'seattlerb'
12
+ self.testlib = :minitest
13
+
14
+ extra_deps << ['gdata', '~> 1.1']
15
+ extra_deps << ['nokogiri', '~> 1.2']
16
+ extra_dev_deps << ['minitest', '~> 1.3']
16
17
  end
17
18
 
18
19
  # vim: syntax=Ruby
@@ -10,7 +10,7 @@ require 'nokogiri'
10
10
 
11
11
  class GmailContacts
12
12
 
13
- VERSION = '1.4.1'
13
+ VERSION = '1.5'
14
14
 
15
15
  Contact = Struct.new :title, :emails, :ims, :phone_numbers, :addresses,
16
16
  :photo_url
@@ -110,10 +110,15 @@ class GmailContacts
110
110
  end
111
111
 
112
112
  ##
113
- # Fetches the photo data for +contact+
113
+ # Fetches the photo data for +contact+ which may be a photo URL
114
114
 
115
115
  def fetch_photo(contact)
116
- res = @contact_api.get contact.photo_url
116
+ photo_url = if String === contact then
117
+ contact
118
+ else
119
+ contact.photo_url
120
+ end
121
+ res = @contact_api.get photo_url
117
122
 
118
123
  res.body
119
124
  end
@@ -84,6 +84,14 @@ class TestGmailContacts < MiniTest::Unit::TestCase
84
84
  assert_equal 'THIS IS A PHOTO!', photo
85
85
  end
86
86
 
87
+ def test_fetch_photo_url
88
+ @api.stub_data << 'THIS IS A PHOTO!'
89
+
90
+ photo = @gc.fetch_photo @eric.photo_url
91
+
92
+ assert_equal 'THIS IS A PHOTO!', photo
93
+ end
94
+
87
95
  def test_parse
88
96
  @gc.parse Nokogiri::XML(GmailContacts::TestStub::CONTACTS)
89
97
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gmail_contacts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: "1.5"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel
@@ -30,7 +30,7 @@ cert_chain:
30
30
  x52qPcexcYZR7w==
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2009-05-20 00:00:00 -07:00
33
+ date: 2009-08-20 00:00:00 -07:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
@@ -71,7 +71,7 @@ dependencies:
71
71
  requirements:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: 1.12.1
74
+ version: 2.3.3
75
75
  version:
76
76
  description: |-
77
77
  Simple Gmail contacts extraction using GData.
@@ -88,6 +88,7 @@ extra_rdoc_files:
88
88
  - Manifest.txt
89
89
  - README.txt
90
90
  files:
91
+ - .autotest
91
92
  - .document
92
93
  - History.txt
93
94
  - Manifest.txt
@@ -122,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
123
  requirements: []
123
124
 
124
125
  rubyforge_project: seattlerb
125
- rubygems_version: 1.3.3
126
+ rubygems_version: 1.3.5
126
127
  signing_key:
127
128
  specification_version: 3
128
129
  summary: Simple Gmail contacts extraction using GData
metadata.gz.sig CHANGED
Binary file