animoto_gmail 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -43,6 +43,7 @@ There is a simple test. To test yourself, please enable INTEGRATION and add your
43
43
 
44
44
  VERSION HISTORY
45
45
  ---------------
46
+ .0.0.2 - Clean up activesupport use since it is deprecated.
46
47
  .0.0.1 - Initial gem-ification process of original code.
47
48
 
48
49
  TO DO
data/Rakefile CHANGED
@@ -2,11 +2,11 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('animoto_gmail', '0.0.1') do |p|
5
+ Echoe.new('animoto_gmail', '0.0.2') do |p|
6
6
  p.description = "Ruby Gmail Client over IMAP."
7
- p.url = "http://animoto.com"
7
+ p.url = "http://github.com/animoto/gmail"
8
8
  p.author = "Animoto"
9
9
  p.email = "theteam@animoto.com"
10
10
  p.ignore_pattern = ["tmp/*", "script/*"]
11
- p.runtime_dependencies = ["tmail", "activesupport", "logging"]
11
+ p.runtime_dependencies = ["tmail", "logging"]
12
12
  end
@@ -2,16 +2,16 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{animoto_gmail}
5
- s.version = "0.0.1"
5
+ s.version = "0.0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Animoto"]
9
- s.date = %q{2009-12-02}
9
+ s.date = %q{2010-01-11}
10
10
  s.description = %q{Ruby Gmail Client over IMAP.}
11
11
  s.email = %q{theteam@animoto.com}
12
12
  s.extra_rdoc_files = ["README", "lib/gmail.rb"]
13
13
  s.files = ["Manifest", "README", "Rakefile", "animoto_gmail.gemspec", "lib/gmail.rb", "test/gmail_test.rb", "test/test_helper.rb"]
14
- s.homepage = %q{http://animoto.com}
14
+ s.homepage = %q{http://github.com/animoto/gmail}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Animoto_gmail", "--main", "README"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = %q{animoto_gmail}
@@ -25,16 +25,13 @@ Gem::Specification.new do |s|
25
25
 
26
26
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
27
27
  s.add_runtime_dependency(%q<tmail>, [">= 0"])
28
- s.add_runtime_dependency(%q<activesupport>, [">= 0"])
29
28
  s.add_runtime_dependency(%q<logging>, [">= 0"])
30
29
  else
31
30
  s.add_dependency(%q<tmail>, [">= 0"])
32
- s.add_dependency(%q<activesupport>, [">= 0"])
33
31
  s.add_dependency(%q<logging>, [">= 0"])
34
32
  end
35
33
  else
36
34
  s.add_dependency(%q<tmail>, [">= 0"])
37
- s.add_dependency(%q<activesupport>, [">= 0"])
38
35
  s.add_dependency(%q<logging>, [">= 0"])
39
36
  end
40
37
  end
@@ -1,7 +1,6 @@
1
1
  require 'logger'
2
- require 'net/imap' #ruby imap connector
3
- require 'tmail' #ruby email parser
4
- require 'activesupport' #for cattr_accessor
2
+ require 'net/imap' #ruby imap connector
3
+ require 'tmail' #ruby email parser
5
4
 
6
5
  # Animoto::GMail
7
6
  # Search for messages in a gmail account using the IMAP interface
@@ -16,11 +15,15 @@ require 'activesupport' #for cattr_accessor
16
15
 
17
16
  module Animoto
18
17
  class GMail
19
- cattr_accessor :logger
20
18
  attr_accessor :imap
21
-
19
+ @@logger = nil
20
+
21
+ def self.logger=(l)
22
+ @@logger = l
23
+ end
24
+
22
25
  def logger
23
- self.class.logger
26
+ @@logger
24
27
  end
25
28
 
26
29
  # connects to gmail server and selects the global mailbox
@@ -58,6 +61,7 @@ module Animoto
58
61
  keys = [ *conditions.map{|k,v| [k.to_s.upcase, v] }.flatten ] + custom
59
62
  logger.info { "Executing IMAP search with #{keys.join(',')}" }
60
63
  msg_ids = @imap.search(keys)
64
+ logger.info { "Retrieved #{msg_ids.size}" }
61
65
  msg_ids = msg_ids[0, options[:limit].to_i] unless options[:limit].nil?
62
66
  retrieve_messages(msg_ids, !!options[:full_message])
63
67
  end
@@ -1,14 +1,11 @@
1
1
  require 'test_helper'
2
2
  require 'gmail'
3
- require 'gmail_util'
4
3
 
5
4
  class GMailTest < Test::Unit::TestCase
6
- EMAIL = "PUT YOUR GMAIL EMAIL HERE"
7
- PASSWORD = "PUT YOUR GMAIL PASSWORD HERE"
8
- INTEGRATION = false
5
+ EMAIL = "YOUR GMAIL ACCOUNT HERE"
6
+ PASSWORD = "YOUR GMAIL PASSWORD HERE"
9
7
 
10
8
  def test_gmail_search
11
- return if !INTEGRATION
12
9
  Animoto::GMail.logger = Logger.new(STDOUT)
13
10
  gmail = Animoto::GMail.new(EMAIL, PASSWORD)
14
11
  conditions = {:subject => "Contact [Account Inquiry] from Debora Daniel"}
@@ -18,7 +15,6 @@ class GMailTest < Test::Unit::TestCase
18
15
  end
19
16
 
20
17
  def test_gmail_search_2
21
- return if !INTEGRATION
22
18
  Animoto::GMail.logger = Logger.new(STDOUT)
23
19
  gmail = Animoto::GMail.new(EMAIL, PASSWORD)
24
20
  conditions = {:subject => "Returned mail: see transcript for details"}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: animoto_gmail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Animoto
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-02 00:00:00 -05:00
12
+ date: 2010-01-11 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -22,16 +22,6 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: "0"
24
24
  version:
25
- - !ruby/object:Gem::Dependency
26
- name: activesupport
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "0"
34
- version:
35
25
  - !ruby/object:Gem::Dependency
36
26
  name: logging
37
27
  type: :runtime
@@ -60,7 +50,7 @@ files:
60
50
  - test/gmail_test.rb
61
51
  - test/test_helper.rb
62
52
  has_rdoc: true
63
- homepage: http://animoto.com
53
+ homepage: http://github.com/animoto/gmail
64
54
  licenses: []
65
55
 
66
56
  post_install_message: