minimail 0.0.3 → 0.0.4
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/Gemfile +4 -0
- data/Rakefile +7 -0
- data/lib/minimail/version.rb +1 -1
- data/readme.md +17 -3
- data/test/minimail_test.rb +0 -3
- metadata +3 -3
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/minimail/version.rb
CHANGED
data/readme.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
Minimail sends emails. I use it to send notification emails to myself from scripts. `/usr/bin/mail -s 'hi there' bob@example.com` can be called from a shell script as well, Minimail just wraps that. Minimail wraps command-line code with descriptive method and variable names and test code, to make maintenance easier. Minimail makes it easier to share this functionality between projects thanks to Rubygems and bundler.
|
2
|
+
|
1
3
|
Installation
|
2
4
|
=========
|
3
5
|
|
@@ -16,17 +18,26 @@ Without bundler
|
|
16
18
|
Usage
|
17
19
|
=====
|
18
20
|
|
19
|
-
# Send an email one-liner
|
21
|
+
# Send an email (one-liner)
|
20
22
|
Minimail::Mail.new(:subject => "check it!", :recipients => "bob@example.com").deliver
|
21
23
|
|
22
|
-
#
|
24
|
+
# Or do the same with a DSL style
|
23
25
|
m = Minimail::Mail.new
|
24
26
|
m.draft do
|
25
27
|
subject "check it!"
|
26
28
|
recipients "bob@example.com"
|
27
29
|
end
|
28
30
|
m.deliver
|
31
|
+
|
32
|
+
# Include an attachment
|
33
|
+
Minimail::Mail.new(:subject => "check this attachment", :recipients => "bob@example.com", :attachments => File.join(Dir.pwd, 'test', 'fake_attachment.txt')).deliver
|
29
34
|
|
35
|
+
Run tests
|
36
|
+
=========
|
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
|
30
41
|
|
31
42
|
Debugging
|
32
43
|
=========
|
@@ -37,4 +48,7 @@ The mail will also likely show up in the spam folder.
|
|
37
48
|
|
38
49
|
# on OS X tail the mail log file
|
39
50
|
tail -f /var/log/mail.log
|
40
|
-
|
51
|
+
|
52
|
+
Credits
|
53
|
+
=======
|
54
|
+
Minimail was inspired by some code from Val Aleksenko. Thanks Val!
|
data/test/minimail_test.rb
CHANGED
@@ -16,9 +16,6 @@ class Minimail::MailTest < MiniTest::Unit::TestCase
|
|
16
16
|
assert_equal body, mail.instance_variable_get(:@body)
|
17
17
|
end
|
18
18
|
|
19
|
-
def test_can_prepare_simple_mail_with_multiple_recipients
|
20
|
-
end
|
21
|
-
|
22
19
|
def test_can_prepare_a_minimail_with_a_single_attachment
|
23
20
|
subject = "Check this out!"
|
24
21
|
recipients = "jane@example.com"
|
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:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andy Atkinson
|