mlist 0.1.16 → 0.1.17

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/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ *0.1.17 [Bug Fix] (2010-05-04)
2
+
3
+ * Fixed bug where rfc822 was missing. [mikehale]
4
+
1
5
  *0.1.16 [Bug Fix] (2010-04-13)
2
6
 
3
7
  * Fixed bug where encoding was lost when adding footers. [aiwilliams]
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ source :gemcutter
2
+
3
+ gem 'activerecord', '= 2.3.4'
4
+ gem 'activesupport', '= 2.3.4'
5
+ gem 'uuid', '>= 2.0.1'
6
+ gem 'hpricot', '>= 0.8.2'
7
+ gem 'tmail', '= 1.2.1'
8
+
9
+ group :development do
10
+ gem 'jeweler'
11
+ gem 'dataset'
12
+ gem 'rake'
13
+ gem "sqlite3-ruby"
14
+ gem "rspec", :require => "spec"
15
+ gem "rr", "0.10.0"
16
+ gem "ruby-debug"
17
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,97 @@
1
+ ---
2
+ specs:
3
+ - rake:
4
+ version: 0.8.7
5
+ - activesupport:
6
+ version: 2.3.4
7
+ - activerecord:
8
+ version: 2.3.4
9
+ - columnize:
10
+ version: 0.3.1
11
+ - dataset:
12
+ version: 1.3.2
13
+ - json_pure:
14
+ version: 1.4.2
15
+ - gemcutter:
16
+ version: 0.5.0
17
+ - git:
18
+ version: 1.2.5
19
+ - hpricot:
20
+ version: 0.8.2
21
+ - rubyforge:
22
+ version: 2.0.4
23
+ - jeweler:
24
+ version: 1.4.0
25
+ - linecache:
26
+ version: "0.43"
27
+ - macaddr:
28
+ version: 1.0.0
29
+ - rr:
30
+ version: 0.10.0
31
+ - rspec:
32
+ version: 1.3.0
33
+ - ruby-debug-base:
34
+ version: 0.10.3
35
+ - ruby-debug:
36
+ version: 0.10.3
37
+ - sqlite3-ruby:
38
+ version: 1.2.5
39
+ - tmail:
40
+ version: 1.2.1
41
+ - uuid:
42
+ version: 2.3.0
43
+ hash: f114a3759c0acf377d0d1d01f36996ba24a98ef7
44
+ sources:
45
+ - Rubygems:
46
+ uri: http://gemcutter.org
47
+ dependencies:
48
+ ruby-debug:
49
+ version: ">= 0"
50
+ group:
51
+ - :development
52
+ sqlite3-ruby:
53
+ version: ">= 0"
54
+ group:
55
+ - :development
56
+ rr:
57
+ version: = 0.10.0
58
+ group:
59
+ - :development
60
+ activerecord:
61
+ version: = 2.3.4
62
+ group:
63
+ - :default
64
+ rspec:
65
+ version: ">= 0"
66
+ require:
67
+ - spec
68
+ group:
69
+ - :development
70
+ rake:
71
+ version: ">= 0"
72
+ group:
73
+ - :development
74
+ tmail:
75
+ version: = 1.2.1
76
+ group:
77
+ - :default
78
+ uuid:
79
+ version: ">= 2.0.1"
80
+ group:
81
+ - :default
82
+ dataset:
83
+ version: ">= 0"
84
+ group:
85
+ - :development
86
+ jeweler:
87
+ version: ">= 0"
88
+ group:
89
+ - :development
90
+ hpricot:
91
+ version: ">= 0.8.2"
92
+ group:
93
+ - :default
94
+ activesupport:
95
+ version: = 2.3.4
96
+ group:
97
+ - :default
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
- $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
2
-
3
1
  require 'rubygems'
2
+ require "bundler"
3
+ Bundler.setup
4
+
4
5
  require 'spec/rake/spectask'
5
6
 
6
7
  task :default => :spec
@@ -22,6 +23,7 @@ begin
22
23
  s.description = s.summary
23
24
  s.authors = ['Adam Williams']
24
25
  end
26
+ Jeweler::GemcutterTasks.new
25
27
  rescue LoadError
26
28
  puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
27
29
  end
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 16
3
2
  :major: 0
4
3
  :build:
5
4
  :minor: 1
5
+ :patch: 17
@@ -55,8 +55,10 @@ module MList
55
55
  end
56
56
 
57
57
  def process_message_id(id)
58
- content = @imap.fetch(id, 'RFC822')[0].attr['RFC822']
59
- process_message(content)
58
+ if rfc822 = @imap.fetch(id, 'RFC822')
59
+ content = rfc822[0].attr['RFC822']
60
+ process_message(content)
61
+ end
60
62
  end
61
63
 
62
64
  def process_message(content)
@@ -55,6 +55,11 @@ describe MList::EmailServer::Imap, 'processing' do
55
55
  @imap.process_message_id(1)
56
56
  end
57
57
 
58
+ it 'should not blow up if an RFC822 does not exist' do
59
+ mock(@imap_server).fetch(1, 'RFC822') { nil }
60
+ lambda { @imap.process_message_id(1) }.should_not raise_error
61
+ end
62
+
58
63
  it 'should wrap up RFC822 content in a TMail::Mail object' do
59
64
  tmail = 'mock_tmail'
60
65
  mock(TMail::Mail).parse('email content') { tmail }
@@ -396,7 +396,7 @@ describe MList::MailList do
396
396
  it 'should append the list footer to text/plain emails' do
397
397
  @post_tmail.body = "My Email\n\n\n\n\n"
398
398
  mock(@manager_list).footer_content(is_a(MList::Message)) { 'my footer' }
399
- process_post.body.should == "My Email\n\n\n\n\n#{MList::MailList::FOOTER_BLOCK_START}\nmy footer\n#{MList::MailList::FOOTER_BLOCK_END}=\n"
399
+ process_post.body.should == "My Email\n\n\n\n\n#{MList::MailList::FOOTER_BLOCK_START}\nmy footer\n#{MList::MailList::FOOTER_BLOCK_END}"
400
400
  end
401
401
 
402
402
  it 'should append the list footer to multipart/alternative, text/plain part of emails' do
@@ -414,7 +414,7 @@ describe MList::MailList do
414
414
  it 'should handle whitespace well when appending footer' do
415
415
  @post_tmail.body = "My Email"
416
416
  mock(@manager_list).footer_content(is_a(MList::Message)) { 'my footer' }
417
- process_post.body.should == "My Email\n\n#{MList::MailList::FOOTER_BLOCK_START}\nmy footer\n#{MList::MailList::FOOTER_BLOCK_END}=\n"
417
+ process_post.body.should == "My Email\n\n#{MList::MailList::FOOTER_BLOCK_START}\nmy footer\n#{MList::MailList::FOOTER_BLOCK_END}"
418
418
  end
419
419
 
420
420
  it 'should strip out any existing text footers from the list' do
@@ -433,7 +433,7 @@ describe MList::MailList do
433
433
  this is without any in front
434
434
  #{MList::MailList::FOOTER_BLOCK_END}
435
435
  }
436
- process_post.body.should == "My Email\n\n#{MList::MailList::FOOTER_BLOCK_START}\nmy footer\n#{MList::MailList::FOOTER_BLOCK_END}=\n"
436
+ process_post.body.should == "My Email\n\n#{MList::MailList::FOOTER_BLOCK_START}\nmy footer\n#{MList::MailList::FOOTER_BLOCK_END}"
437
437
  end
438
438
 
439
439
  it 'should strip out any existing html footers from the list' do
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,11 @@
1
1
  require 'rubygems'
2
+ require "bundler"
3
+ Bundler.setup
4
+
2
5
  require 'spec'
3
6
  require 'rr'
4
7
  require 'ostruct'
8
+ require 'ruby-debug'
5
9
 
6
10
  Spec::Runner.configure do |config|
7
11
  config.mock_with :rr
@@ -73,4 +77,4 @@ def visualize_email(email, recipient_address)
73
77
  end
74
78
 
75
79
  require 'mlist'
76
- require 'mlist/email_server/fake'
80
+ require 'mlist/email_server/fake'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 16
9
- version: 0.1.16
8
+ - 17
9
+ version: 0.1.17
10
10
  platform: ruby
11
11
  authors:
12
12
  - Adam Williams
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-13 00:00:00 -04:00
17
+ date: 2010-05-04 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -29,6 +29,8 @@ extra_rdoc_files:
29
29
  - TODO
30
30
  files:
31
31
  - CHANGELOG
32
+ - Gemfile
33
+ - Gemfile.lock
32
34
  - README
33
35
  - Rakefile
34
36
  - TODO