JunKikuchi-simple-mailer 0.0.0 → 0.0.1

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.
Files changed (4) hide show
  1. data/README.rdoc +10 -8
  2. data/VERSION +1 -1
  3. data/lib/simple-mailer.rb +2 -2
  4. metadata +2 -2
data/README.rdoc CHANGED
@@ -2,14 +2,8 @@
2
2
 
3
3
  require 'rubygems'
4
4
  require 'lib/simple-mailer'
5
-
6
- SimpleMailer::SMTP.new(:host => 'localhost', :port => 25) do
7
- message(:encoding => 'iso-2022-jp') do
8
- from 'hoge@example.com'
9
- to 'foo@example.com', 'Foo'
10
- to 'bar@example.com'
11
- subject 'Hello'
12
- body <<END
5
+
6
+ body =<<END
13
7
  Hi,
14
8
 
15
9
  How are you doing?
@@ -17,5 +11,13 @@
17
11
  --
18
12
  hoge
19
13
  END
14
+
15
+ SimpleMailer::SMTP.new(:host => 'localhost', :port => 25) do |smtp|
16
+ smtp.message(:encoding => 'iso-2022-jp') do |msg|
17
+ msg.from 'hoge@example.com'
18
+ msg.to 'foo@example.com', 'Foo'
19
+ msg.to 'bar@example.com'
20
+ msg.subject 'Hello'
21
+ msg.body body_en
20
22
  end
21
23
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
data/lib/simple-mailer.rb CHANGED
@@ -13,7 +13,7 @@ class SimpleMailer
13
13
  }.merge(params)
14
14
 
15
15
  @smtp = Net::SMTP.start(@params[:host], @params[:port].to_i)
16
- instance_eval(&block)
16
+ block.call(self)
17
17
  @smtp.finish
18
18
  end
19
19
 
@@ -75,7 +75,7 @@ class SimpleMailer
75
75
  @subject = ''
76
76
  @body = ''
77
77
 
78
- instance_eval(&block)
78
+ block.call(self)
79
79
  end
80
80
 
81
81
  def encode_header(val)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: JunKikuchi-simple-mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jun Kikuchi
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-13 00:00:00 -07:00
12
+ date: 2009-09-14 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15