lsegal-mmmail 0.1.0

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/LICENSE +22 -0
  2. data/README.markdown +81 -0
  3. data/Rakefile +42 -0
  4. metadata +55 -0
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2009 Loren Segal
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown ADDED
@@ -0,0 +1,81 @@
1
+ MmMail
2
+ ======
3
+
4
+ Mmmm, a Minimalist mail library for Ruby. Works with SMTP or sendmail.
5
+ One method call to send out emails. You're done. Easy tastes good. Oh,
6
+ and it works with Ruby 1.9.
7
+
8
+ Join the discussion: #mmmail on freenode
9
+
10
+ Install
11
+ -------
12
+
13
+ $ git clone git://github.com/lsegal/mmmail
14
+ $ cd mmmail
15
+ $ rake install
16
+
17
+ or use GitHub gems:
18
+
19
+ $ sudo gem install lsegal-mmmail --source http://gems.github.com
20
+
21
+ Use
22
+ ---
23
+
24
+ **An easy example**:
25
+
26
+ require 'mmmail'
27
+ MmMail.send(to: 'me@gmail.com', from: 'me@yahoo.com',
28
+ subject: 'hello joe', body: <<-eof)
29
+ Hey Joe,
30
+
31
+ You left the kitchen light on.
32
+ It started a fire and burned down your house.
33
+ Have fun in Hawaii.
34
+
35
+ Jake.
36
+ eof
37
+
38
+ Yes, that's Ruby 1.9 syntax, get used to it. It should work out
39
+ with the inferior 1.8 hash syntax too.
40
+
41
+ **More complex stuff, like using sendmail instead of Net::SMTP:**
42
+
43
+ require 'mmmail'
44
+ MmMail::Transport::DefaultConfig.method = :sendmail
45
+ MmMail.send(...)
46
+
47
+ Okay it wasn't that hard. You can also specify the path to sendmail with
48
+
49
+ MmMail::Transport::DefaultConfig.sendmail_binary = '/bin/sendmail'
50
+
51
+ **Dealing with SMTP auth and separate hosts:**
52
+
53
+ My ISP makes me do this:
54
+
55
+ require 'mmmail'
56
+ config = MmMail::Transport::DefaultConfig
57
+ config.host = 'smtp.myisp.com'
58
+ config.port = 587
59
+ config.auth_type = :plain # or :md5cram or :login
60
+ config.auth_user = 'myuser'
61
+ config.auth_pass = 'mypass'
62
+
63
+ Yours might too. Okay, it doesn't make me do *all* of that, but these are
64
+ just examples, right?
65
+
66
+ You can also create a `MmMail::Transport::Config` object to pass to `#mail`
67
+ if you need multiple configurations:
68
+
69
+ config = MmMail::Transport::Config.new
70
+ config.host = 'mail.someOtherIspHost.com'
71
+
72
+ MmMail.send({...}, config)
73
+ # or
74
+ msg = MmMail::Message.new(to: ..., from: ..., subject: ..., body: ...)
75
+ transport = MmMail::Transport.new(config)
76
+ transport.send(msg, config)
77
+
78
+ Documentation
79
+ -------------
80
+
81
+ [http://lsegal.github.com/mmmail/docs]()
data/Rakefile ADDED
@@ -0,0 +1,42 @@
1
+ require 'rubygems'
2
+ require 'rake/gempackagetask'
3
+
4
+ begin
5
+ require 'spec'
6
+ require 'spec/rake/spectask'
7
+ rescue LoadError; end
8
+
9
+ begin
10
+ require 'yard'
11
+ rescue LoadError; end
12
+
13
+ WINDOWS = (PLATFORM =~ /win32|cygwin/ ? true : false) rescue false
14
+ SUDO = WINDOWS ? '' : 'sudo'
15
+
16
+ task :default => :specs
17
+
18
+ load 'mmmail.gemspec'
19
+ Rake::GemPackageTask.new(SPEC) do |pkg|
20
+ pkg.gem_spec = SPEC
21
+ pkg.need_zip = true
22
+ pkg.need_tar = true
23
+ end
24
+
25
+ desc "Install the gem locally"
26
+ task :install => :package do
27
+ sh "#{SUDO} gem install pkg/#{SPEC.name}-#{SPEC.version}.gem --local"
28
+ sh "#{SUDO} rm -rf pkg/#{SPEC.name}-#{SPEC.version}" unless ENV['KEEP_FILES']
29
+ end
30
+
31
+ begin
32
+ desc "Run all specs"
33
+ Spec::Rake::SpecTask.new("specs") do |t|
34
+ $DEBUG = true if ENV['DEBUG']
35
+ t.spec_opts = ["--format", "specdoc", "--colour"]
36
+ t.spec_files = Dir["spec/**/*_spec.rb"].sort
37
+ end
38
+ rescue LoadError; end
39
+
40
+ begin
41
+ YARD::Rake::YardocTask.new
42
+ rescue LoadError; end
metadata ADDED
@@ -0,0 +1,55 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lsegal-mmmail
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Loren Segal
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-02-22 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: lsegal@soen.ca
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - LICENSE
26
+ - README.markdown
27
+ - Rakefile
28
+ has_rdoc: false
29
+ homepage: http://github.com/lsegal/mmmail
30
+ post_install_message:
31
+ rdoc_options: []
32
+
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: "0"
40
+ version:
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
46
+ version:
47
+ requirements: []
48
+
49
+ rubyforge_project:
50
+ rubygems_version: 1.2.0
51
+ signing_key:
52
+ specification_version: 2
53
+ summary: Mmmm, a Minimalist mail library for Ruby. Works with SMTP or sendmail.
54
+ test_files: []
55
+