bjornblomqvist-emailer 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
data/emailer.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{emailer}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Erik Hansson", "Bjorn Blomqvist"]
12
- s.date = %q{2009-09-17}
12
+ s.date = %q{2009-09-18}
13
13
  s.description = %q{}
14
14
  s.email = %q{erik@bits2life.com}
15
15
  s.extra_rdoc_files = [
@@ -26,11 +26,13 @@ Gem::Specification.new do |s|
26
26
  "emailer.gemspec",
27
27
  "lib/emailer.rb",
28
28
  "lib/emailer/authsmtp_facade.rb",
29
+ "lib/emailer/logger_smtp_facade.rb",
29
30
  "lib/emailer/mail_queue.rb",
30
31
  "lib/emailer/mock_smtp_facade.rb",
31
32
  "lib/emailer/smtp_facade.rb",
32
33
  "lib/emailer/string_utilities.rb",
33
34
  "spec/emailer/authsmtp_facade_spec.rb",
35
+ "spec/emailer/logger_smtp_facade_spec.rb",
34
36
  "spec/emailer/mail_queue_spec.rb",
35
37
  "spec/emailer/mock_smtp_facade_spec.rb",
36
38
  "spec/emailer/smtp_facade_spec.rb",
@@ -44,6 +46,7 @@ Gem::Specification.new do |s|
44
46
  s.summary = %q{A really simple way to send emails...}
45
47
  s.test_files = [
46
48
  "spec/emailer/authsmtp_facade_spec.rb",
49
+ "spec/emailer/logger_smtp_facade_spec.rb",
47
50
  "spec/emailer/mail_queue_spec.rb",
48
51
  "spec/emailer/mock_smtp_facade_spec.rb",
49
52
  "spec/emailer/smtp_facade_spec.rb",
@@ -0,0 +1,12 @@
1
+ module Emailer
2
+
3
+ class LoggerSmtpFacade < MockSmtpFacade
4
+
5
+ # And save, don't send, write to a singel file
6
+ def send_mail(options)
7
+ super options
8
+
9
+ end
10
+
11
+ end
12
+ end
@@ -24,7 +24,7 @@ module Emailer
24
24
  def open
25
25
  @open = true
26
26
  open_connection
27
- yield
27
+ yield self
28
28
  ensure
29
29
  @open = false
30
30
  close_connection
@@ -0,0 +1,38 @@
1
+ module Emailer
2
+
3
+ LOGGER_OPTIONS = {
4
+ :temp_dir => 'smtp.host.com',
5
+ :use => MockSmtpFacade.new
6
+ }
7
+
8
+ describe LoggerSmtpFacade do
9
+
10
+ describe :initialize do
11
+ it "should accept only known options" do
12
+ lambda do
13
+ LoggerSmtpFacade.new :foobar => 'fail'
14
+ end.should raise_error
15
+ end
16
+
17
+ it "should accept all known options" do
18
+ LoggerSmtpFacade.new LOGGER_OPTIONS
19
+ end
20
+
21
+ it "should demand temp_dir option" do
22
+ lambda do
23
+ LoggerSmtpFacade.new
24
+ end.shouldh raise_error
25
+ end
26
+ end
27
+
28
+
29
+ # Should be able to wrap another smtp facade
30
+ # Should have temp directory configurable
31
+ # Should be abel to log to one file
32
+ # Should be able to log to many files
33
+ # Should write to many files as html files viewable in a browser
34
+ # Should write to one file as ruby code style
35
+ # Should bork if no directory is supplied
36
+
37
+ end
38
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bjornblomqvist-emailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Hansson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-09-17 00:00:00 -07:00
13
+ date: 2009-09-18 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -52,11 +52,13 @@ files:
52
52
  - emailer.gemspec
53
53
  - lib/emailer.rb
54
54
  - lib/emailer/authsmtp_facade.rb
55
+ - lib/emailer/logger_smtp_facade.rb
55
56
  - lib/emailer/mail_queue.rb
56
57
  - lib/emailer/mock_smtp_facade.rb
57
58
  - lib/emailer/smtp_facade.rb
58
59
  - lib/emailer/string_utilities.rb
59
60
  - spec/emailer/authsmtp_facade_spec.rb
61
+ - spec/emailer/logger_smtp_facade_spec.rb
60
62
  - spec/emailer/mail_queue_spec.rb
61
63
  - spec/emailer/mock_smtp_facade_spec.rb
62
64
  - spec/emailer/smtp_facade_spec.rb
@@ -90,6 +92,7 @@ specification_version: 2
90
92
  summary: A really simple way to send emails...
91
93
  test_files:
92
94
  - spec/emailer/authsmtp_facade_spec.rb
95
+ - spec/emailer/logger_smtp_facade_spec.rb
93
96
  - spec/emailer/mail_queue_spec.rb
94
97
  - spec/emailer/mock_smtp_facade_spec.rb
95
98
  - spec/emailer/smtp_facade_spec.rb