minimail 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/minimail/mail.rb CHANGED
@@ -28,9 +28,17 @@ module Minimail
28
28
  def deliver
29
29
  return unless valid?
30
30
  if @attachments
31
- IO.popen("echo #{@body} | (#{@attachments}) | #{mail_command} -s '#{@subject}' #{@recipients}")
31
+ IO.popen("(#{@attachments}) | #{mail_command} -s '#{@subject}' #{@recipients}", "w") do |io|
32
+ io.write @body
33
+ io.close_write
34
+ io
35
+ end
32
36
  else
33
- IO.popen("echo #{@body} | #{mail_command} -s '#{@subject}' #{@recipients}")
37
+ IO.popen("#{mail_command} -s '#{@subject}' #{@recipients}", "w") do |io|
38
+ io.write @body
39
+ io.close_write
40
+ io
41
+ end
34
42
  end
35
43
  end
36
44
 
@@ -1,3 +1,3 @@
1
1
  module Minimail
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/readme.md CHANGED
@@ -35,9 +35,9 @@ Usage
35
35
  Run tests
36
36
  =========
37
37
 
38
- # clone source, setup ruby and gemset (I use RVM). rvm use 1.8.7; rvm gemset create minimail; rvm gemset use minimail
39
- # gem install bundler && bundle (make sure bundler "test" group gems are installed)
40
- rake # as of this writing: 6 tests, 11 assertions, 0 failures, 0 errors, 0 skips
38
+ # clone source, setup ruby and gemset (I use RVM). rvm use 1.8.7; rvm gemset create minimail; rvm gemset use minimail
39
+ # gem install bundler && bundle (make sure bundler "test" group gems are installed)
40
+ rake # as of this writing: 6 tests, 11 assertions, 0 failures, 0 errors, 0 skips
41
41
 
42
42
  Debugging
43
43
  =========
@@ -46,8 +46,8 @@ but was able to send using my cellular 3G connection (also Verizon) while tether
46
46
 
47
47
  The mail will also likely show up in the spam folder.
48
48
 
49
- # on OS X tail the mail log file
50
- tail -f /var/log/mail.log
49
+ # on OS X tail the mail log file
50
+ tail -f /var/log/mail.log
51
51
 
52
52
  Credits
53
53
  =======
@@ -35,8 +35,7 @@ class Minimail::MailTest < MiniTest::Unit::TestCase
35
35
  end
36
36
 
37
37
  def test_can_deliver_a_mail
38
- recipients = "jane@example.com"
39
- mail = Minimail::Mail.new(:recipients => recipients)
38
+ mail = Minimail::Mail.new(:recipients => "jane@example.com", :body => "check this out")
40
39
  assert_equal IO, mail.deliver.class
41
40
  end
42
41
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimail
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andy Atkinson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-19 00:00:00 -04:00
18
+ date: 2012-06-06 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency