simpleMailer 0.1.5 → 0.1.6
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/VERSION +1 -1
- data/lib/simpleMailer.rb +13 -16
- data/simpleMailer.gemspec +7 -6
- metadata +5 -7
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
data/lib/simpleMailer.rb
CHANGED
@@ -3,26 +3,24 @@ class SimpleMailer
|
|
3
3
|
require 'net/smtp'
|
4
4
|
require 'shared-mime-info'
|
5
5
|
|
6
|
-
attr_accessor :host, :port
|
7
|
-
attr_accessor :from, :to
|
8
|
-
attr_accessor :title, :message
|
9
|
-
attr_accessor :files
|
10
|
-
|
11
6
|
MARKER="THATSMAMARKER"
|
12
7
|
|
13
8
|
def initialize(host="",port=25)
|
14
9
|
@host=host
|
15
10
|
@port=port
|
16
|
-
@from=
|
17
|
-
@to=
|
18
|
-
@title=
|
19
|
-
@message=
|
11
|
+
@from=''
|
12
|
+
@to=''
|
13
|
+
@title=''
|
14
|
+
@message=''
|
15
|
+
@body=''
|
20
16
|
@files=Array.new
|
21
|
-
@body=""
|
22
17
|
end
|
23
|
-
|
18
|
+
|
19
|
+
# Want an array
|
24
20
|
def to(to)
|
25
|
-
|
21
|
+
to.each do |ad|
|
22
|
+
raise "Not a proper email address" unless ad.match(/.+@.+\..+/)
|
23
|
+
end
|
26
24
|
@to=to
|
27
25
|
self
|
28
26
|
end
|
@@ -33,7 +31,7 @@ class SimpleMailer
|
|
33
31
|
self
|
34
32
|
end
|
35
33
|
|
36
|
-
def
|
34
|
+
def title(title)
|
37
35
|
@title=title
|
38
36
|
self
|
39
37
|
end
|
@@ -44,7 +42,7 @@ class SimpleMailer
|
|
44
42
|
end
|
45
43
|
|
46
44
|
# WARNING : with_files clear @files before adding new ones
|
47
|
-
def
|
45
|
+
def attach_files(files)
|
48
46
|
@files=Array.new
|
49
47
|
files.each do |file|
|
50
48
|
raise "File #{file} doesn't exist" unless File.exists?(file)
|
@@ -69,7 +67,6 @@ Content-Transfer-Encoding: base64
|
|
69
67
|
|
70
68
|
#{b64file}
|
71
69
|
|
72
|
-
|
73
70
|
EOF
|
74
71
|
end
|
75
72
|
|
@@ -77,7 +74,7 @@ EOF
|
|
77
74
|
def generate_body
|
78
75
|
@body =<<EOF
|
79
76
|
From: #{@from}
|
80
|
-
To: #{@to}
|
77
|
+
To: #{@to.join(",")}
|
81
78
|
Subject: #{@title}
|
82
79
|
MIME-Version: 1.0
|
83
80
|
Content-Type: multipart/mixed; boundary=#{MARKER}
|
data/simpleMailer.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{simpleMailer}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Yoann LE TOUCHE"]
|
12
|
-
s.date = %q{2009-08-
|
12
|
+
s.date = %q{2009-08-31}
|
13
13
|
s.description = %q{SimpleMailer is a simple wrapper for net::smtp that let you attach files}
|
14
14
|
s.email = %q{kurotoshiro@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -28,19 +28,20 @@ Gem::Specification.new do |s|
|
|
28
28
|
"test/simpleMailer_test.rb",
|
29
29
|
"test/test_helper.rb"
|
30
30
|
]
|
31
|
+
s.has_rdoc = true
|
31
32
|
s.homepage = %q{http://github.com/Kurotoshiro/simpleMailer}
|
32
33
|
s.rdoc_options = ["--charset=UTF-8"]
|
33
34
|
s.require_paths = ["lib"]
|
34
|
-
s.rubygems_version = %q{1.3.
|
35
|
+
s.rubygems_version = %q{1.3.1}
|
35
36
|
s.summary = %q{A simple mailer gem}
|
36
37
|
s.test_files = [
|
37
|
-
"test/
|
38
|
-
"test/
|
38
|
+
"test/test_helper.rb",
|
39
|
+
"test/simpleMailer_test.rb"
|
39
40
|
]
|
40
41
|
|
41
42
|
if s.respond_to? :specification_version then
|
42
43
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
43
|
-
s.specification_version =
|
44
|
+
s.specification_version = 2
|
44
45
|
|
45
46
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
46
47
|
s.add_runtime_dependency(%q<shared-mime-info>, [">= 0"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simpleMailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoann LE TOUCHE
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-31 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -54,8 +54,6 @@ files:
|
|
54
54
|
- test/test_helper.rb
|
55
55
|
has_rdoc: true
|
56
56
|
homepage: http://github.com/Kurotoshiro/simpleMailer
|
57
|
-
licenses: []
|
58
|
-
|
59
57
|
post_install_message:
|
60
58
|
rdoc_options:
|
61
59
|
- --charset=UTF-8
|
@@ -76,10 +74,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
74
|
requirements: []
|
77
75
|
|
78
76
|
rubyforge_project:
|
79
|
-
rubygems_version: 1.3.
|
77
|
+
rubygems_version: 1.3.1
|
80
78
|
signing_key:
|
81
|
-
specification_version:
|
79
|
+
specification_version: 2
|
82
80
|
summary: A simple mailer gem
|
83
81
|
test_files:
|
84
|
-
- test/simpleMailer_test.rb
|
85
82
|
- test/test_helper.rb
|
83
|
+
- test/simpleMailer_test.rb
|