malone 1.0.0.rc1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +57 -46
  2. data/malone.gemspec +1 -1
  3. metadata +8 -8
data/README.md CHANGED
@@ -1,71 +1,82 @@
1
- Originally taken from my initial draft [here][blogpost].
2
-
3
- [blogpost]: http://www.pipetodevnull.com/past/2010/11/27/simple_mailer/
1
+ malone(1) -- send mail using smtp without any fuss
2
+ ==================================================
4
3
 
5
4
  ## USAGE
6
5
 
7
- ```ruby
8
- $ gem install malone
6
+ require "malone"
7
+
8
+ # Typically you would do this somewhere in the bootstrapping
9
+ # part of your application
9
10
 
10
- require "malone"
11
+ m = Malone.connect(url: "smtp://foo%40bar.com:pass@smtp.gmail.com:587",
12
+ domain: "mysite.com")
11
13
 
12
- # Typically you would do this somewhere in the bootstrapping
13
- # part of your application
14
+ m.deliver(from: "me@me.com", to: "you@me.com",
15
+ subject: "Test subject", text: "Great!")
14
16
 
15
- m = Malone.connect(url: "smtp://foo%40bar.com:pass1234@smtp.gmail.com:587",
16
- domain: "mysite.com")
17
+ # Malone.current will now remember the last configuration you setup.
18
+ Malone.current.config == m.config
17
19
 
18
- m.deliver(from: "me@me.com", to: "you@me.com",
19
- subject: "Test subject", text: "Great!")
20
+ # Now you can also do Malone.deliver, which is syntactic sugar
21
+ # for Malone.current.deliver
22
+ Malone.deliver(from: "me@me.com", to: "you@me.com",
23
+ subject: "Test subject", text: "Great!")
20
24
 
21
- # Malone.current will now remember the last configuration you setup.
22
- Malone.current.config == m.config
25
+ # Also starting with Malone 1.0, you can pass in :html
26
+ # for multipart emails.
23
27
 
24
- # Now you can also do Malone.deliver, which is syntactic sugar
25
- # for Malone.current.deliver
26
- Malone.deliver(from: "me@me.com", to: "you@me.com",
27
- subject: "Test subject", text: "Great!")
28
+ Malone.deliver(from: "me@me.com", to: "you@me.com",
29
+ subject: "Test subject",
30
+ text: "Great!", html: "<b>Great!</b>")
28
31
 
29
- # Also starting with Malone 1.0, you can also pass in :html
30
- # for multipart emails.
31
32
 
32
- m.deliver(from: "me@me.com", to: "you@me.com",
33
- subject: "Test subject",
34
- text: "Great!", html: "<b>Great!</b>")
33
+ ## TESTING
35
34
 
36
- ```
35
+ require "malone/test"
37
36
 
38
- That's it!
37
+ m = Malone.connect(url: "smtp://foo%40bar.com:pass@smtp.gmail.com:587",
38
+ domain: "mysite.com")
39
39
 
40
- ## TESTING
40
+ m.deliver(from: "me@me.com", to: "you@me.com",
41
+ subject: "Test subject", text: "Great!")
42
+
43
+ Malone.deliveries.size == 1
44
+ # => true
45
+
46
+ mail = Malone.deliveries.first
47
+
48
+ "me@me.com" == mail.from
49
+ # => true
50
+
51
+ "you@me.com" == mail.to
52
+ # => true
41
53
 
42
- ```ruby
43
- require "malone/test"
54
+ "FooBar" == mail.text
55
+ # => true
44
56
 
45
- m = Malone.connect(url: "smtp://foo%40bar.com:pass1234@smtp.gmail.com:587",
46
- domain: "mysite.com")
57
+ "Hello World" == envelope.subject
58
+ # => true
47
59
 
48
- m.deliver(from: "me@me.com", to: "you@me.com",
49
- subject: "Test subject", text: "Great!")
60
+ ## INSTALLATION
50
61
 
51
- Malone.deliveries.size == 1
52
- # => true
62
+ gem install malone
53
63
 
54
- mail = Malone.deliveries.first
64
+ ## CONFIGURATION TIPS
55
65
 
56
- "me@me.com" == mail.from
57
- # => true
66
+ If you're used to doing configuration via environment
67
+ variables, similar to how Heroku does configuration, then
68
+ you can simply set an environment variable in your
69
+ production machine like so:
58
70
 
59
- "you@me.com" == mail.to
60
- # => true
71
+ export MALONE_URL=smtp://foo%40bar.com:pass@smtp.gmail.com:587
61
72
 
62
- "FooBar" == mail.text
63
- # => true
73
+ Then you can connect using the environment variable in your
74
+ code like so:
64
75
 
65
- "Hello World" == envelope.subject
66
- # => true
67
- ```
76
+ Malone.connect(url: ENV["MALONE_URL"])
68
77
 
69
- ## LICENSE
78
+ # or quite simply
79
+ Malone.connect
70
80
 
71
- MIT
81
+ By default Malone tries for the environment variable `MALONE_URL` when
82
+ you call `Malone.connect` without any arguments.
data/malone.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'malone'
3
- s.version = "1.0.0.rc1"
3
+ s.version = "1.0.0"
4
4
  s.summary = %{Dead-simple Ruby mailing solution which always delivers.}
5
5
  s.date = "2011-01-10"
6
6
  s.author = "Cyril David"
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: malone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc1
5
- prerelease: 6
4
+ version: 1.0.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Cyril David
@@ -13,7 +13,7 @@ date: 2011-01-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mailfactory
16
- requirement: &70255670212260 !ruby/object:Gem::Requirement
16
+ requirement: &70338423965500 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.4'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70255670212260
24
+ version_requirements: *70338423965500
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: cutest
27
- requirement: &70255670211520 !ruby/object:Gem::Requirement
27
+ requirement: &70338423965000 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70255670211520
35
+ version_requirements: *70338423965000
36
36
  description:
37
37
  email: me@cyrildavid.com
38
38
  executables: []
@@ -62,9 +62,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
62
62
  required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
- - - ! '>'
65
+ - - ! '>='
66
66
  - !ruby/object:Gem::Version
67
- version: 1.3.1
67
+ version: '0'
68
68
  requirements: []
69
69
  rubyforge_project:
70
70
  rubygems_version: 1.8.11