maillogger 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MGQ4ZWU4OTVlMDVjMzMyZTg2ZWY3ZDFkMzg5MjIxZDZiMWM2YzZhZQ==
5
+ data.tar.gz: !binary |-
6
+ ODI1NTA4MWNkNzdlNDNiYmI2N2ZkMzQ5NjcxMWJkYWNiZmRjNDdhMQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZWFjMDAxMzliOGViYWZhYTdlMGZiMDYwNDZkZGNlMDViNDhkMGM0ZWEwZWJm
10
+ NWI2NTEyY2FiZTkwOTU3ZWNhYThlZDFmYTc2NTViMjBiZGRmNTc4OWIyNDk2
11
+ YmEzNTk2YjM1NDBiYjQ2MGE3ODEwYTUwMzk1ZTNlZDA4YThiNGQ=
12
+ data.tar.gz: !binary |-
13
+ YWFhMWRkNzVmNWZhZWUwZjg0ZTVhN2Y3MmNmNDY1OWE3OWE0MjRkN2ZiYTJk
14
+ OWRlNmMwNTllYzRkOWE2NTQ5MjAwNzFkNWQ3NjgzMGYwYTUzOWNkNDIwNDNm
15
+ MzhlYTlmYzZlYjRlNGViN2JlY2UwMjc0ZDhhOTkzMmQyMzEyNGI=
@@ -1,20 +1,165 @@
1
- Copyright (c) 2012 Darwin
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2012 Björn Blomqvist
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
@@ -0,0 +1,46 @@
1
+ maillogger
2
+ ==========
3
+
4
+ A delivery method that wrapps another delivery method and logs all successfull deliveries. It logs to ```./log/emails/\#{Time.now....}.eml```
5
+
6
+ Usage
7
+ -----
8
+
9
+ In Gemfile
10
+
11
+ gem 'maillogger', "~> 0.2"
12
+
13
+ Loading mail configuration in development.rb
14
+
15
+ mail_options = {....}
16
+ MailLogger.delivery_method(Mail::SMTP, mail_options)
17
+ Mail.defaults do
18
+ delivery_method MailLogger
19
+ end
20
+
21
+ The result is that all email that you call deliver on ends up in ```./log/emails/``` as ```20140707_1348.18-UTC.eml``` or ```delivery_failure_20140707_1348.18-UTC.eml```
22
+
23
+ Change log
24
+ ----------
25
+
26
+ ### 0.2.0
27
+
28
+ - Fixed so that failure to send email is also logged.
29
+ - Changed to LGPL
30
+ - Updated the reamde to actualy say something
31
+
32
+
33
+ Contributing to maillogger
34
+ --------------------------
35
+
36
+ * Fork the project.
37
+ * Start a feature/bugfix branch.
38
+ * Commit and push until you are happy with your contribution.
39
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
40
+
41
+ Copyright
42
+ ---------
43
+
44
+ Copyright (c) 2012 - 2014 Darwin. See LICENSE.txt for
45
+ further details.
46
+
data/Rakefile CHANGED
@@ -16,7 +16,7 @@ Jeweler::Tasks.new do |gem|
16
16
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
17
  gem.name = "maillogger"
18
18
  gem.homepage = "http://github.com/bjornblomqvist/maillogger"
19
- gem.license = "MIT"
19
+ gem.license = "LGPL"
20
20
  gem.summary = %Q{A simple logger for the mail gem.}
21
21
  gem.description = %Q{A delivery method that wrapps another delivery method and logs all successfull deliveries. It logs to ./log/emails/#\{Time.now....\}.eml}
22
22
  gem.email = "darwin.git@marianna.se"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.0
@@ -22,18 +22,22 @@ class MailLogger
22
22
  def deliver!(mail)
23
23
  # run super
24
24
  @@clazz.new(@@options).deliver!(mail)
25
-
26
25
  # save to disk
27
26
  log(mail)
27
+ rescue => e
28
+ # save to disk
29
+ log(mail, true)
30
+ raise e
28
31
  end
29
32
 
30
33
  private
31
34
 
32
- def log mail
35
+ def log mail, delivery_failure = false
33
36
 
34
37
  FileUtils.mkdir_p(@@path) unless File.exist?(@@path)
35
38
 
36
39
  file_name = "#{Time.now.utc.strftime("%Y%m%d_%H%M.%S-UTC")}.eml"
40
+ file_name = "delivery_failure_" + file_name if delivery_failure
37
41
 
38
42
  File.open("#{@@path}/#{file_name}",'w') do |file|
39
43
  file.write(mail.to_s)
@@ -2,26 +2,26 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: maillogger 0.2.0 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "maillogger"
8
- s.version = "0.1.1"
9
+ s.version = "0.2.0"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
12
  s.authors = ["Darwin"]
12
- s.date = "2012-12-26"
13
+ s.date = "2014-11-30"
13
14
  s.description = "A delivery method that wrapps another delivery method and logs all successfull deliveries. It logs to ./log/emails/\#{Time.now....}.eml"
14
15
  s.email = "darwin.git@marianna.se"
15
16
  s.extra_rdoc_files = [
16
17
  "LICENSE.txt",
17
- "README.rdoc"
18
+ "README.md"
18
19
  ]
19
20
  s.files = [
20
21
  ".document",
21
22
  "Gemfile",
22
- "Gemfile.lock",
23
23
  "LICENSE.txt",
24
- "README.rdoc",
24
+ "README.md",
25
25
  "Rakefile",
26
26
  "VERSION",
27
27
  "lib/maillogger.rb",
@@ -30,13 +30,13 @@ Gem::Specification.new do |s|
30
30
  "test/test_maillogger.rb"
31
31
  ]
32
32
  s.homepage = "http://github.com/bjornblomqvist/maillogger"
33
- s.licenses = ["MIT"]
33
+ s.licenses = ["LGPL"]
34
34
  s.require_paths = ["lib"]
35
- s.rubygems_version = "1.8.24"
35
+ s.rubygems_version = "2.1.10"
36
36
  s.summary = "A simple logger for the mail gem."
37
37
 
38
38
  if s.respond_to? :specification_version then
39
- s.specification_version = 3
39
+ s.specification_version = 4
40
40
 
41
41
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
42
42
  s.add_runtime_dependency(%q<mail>, [">= 0"])
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maillogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Darwin
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-26 00:00:00.000000000 Z
11
+ date: 2014-11-30 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: mail
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -30,19 +27,19 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: jeweler
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
37
- version: 1.8.4
33
+ version: !binary |-
34
+ MS44LjQ=
38
35
  type: :development
39
36
  prerelease: false
40
37
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
38
  requirements:
43
39
  - - ~>
44
40
  - !ruby/object:Gem::Version
45
- version: 1.8.4
41
+ version: !binary |-
42
+ MS44LjQ=
46
43
  description: A delivery method that wrapps another delivery method and logs all successfull
47
44
  deliveries. It logs to ./log/emails/#{Time.now....}.eml
48
45
  email: darwin.git@marianna.se
@@ -50,13 +47,12 @@ executables: []
50
47
  extensions: []
51
48
  extra_rdoc_files:
52
49
  - LICENSE.txt
53
- - README.rdoc
50
+ - README.md
54
51
  files:
55
52
  - .document
56
53
  - Gemfile
57
- - Gemfile.lock
58
54
  - LICENSE.txt
59
- - README.rdoc
55
+ - README.md
60
56
  - Rakefile
61
57
  - VERSION
62
58
  - lib/maillogger.rb
@@ -65,30 +61,26 @@ files:
65
61
  - test/test_maillogger.rb
66
62
  homepage: http://github.com/bjornblomqvist/maillogger
67
63
  licenses:
68
- - MIT
64
+ - LGPL
65
+ metadata: {}
69
66
  post_install_message:
70
67
  rdoc_options: []
71
68
  require_paths:
72
69
  - lib
73
70
  required_ruby_version: !ruby/object:Gem::Requirement
74
- none: false
75
71
  requirements:
76
72
  - - ! '>='
77
73
  - !ruby/object:Gem::Version
78
74
  version: '0'
79
- segments:
80
- - 0
81
- hash: 310786927877376588
82
75
  required_rubygems_version: !ruby/object:Gem::Requirement
83
- none: false
84
76
  requirements:
85
77
  - - ! '>='
86
78
  - !ruby/object:Gem::Version
87
79
  version: '0'
88
80
  requirements: []
89
81
  rubyforge_project:
90
- rubygems_version: 1.8.24
82
+ rubygems_version: 2.1.10
91
83
  signing_key:
92
- specification_version: 3
84
+ specification_version: 4
93
85
  summary: A simple logger for the mail gem.
94
86
  test_files: []
@@ -1,30 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- git (1.2.5)
5
- i18n (0.6.1)
6
- jeweler (1.8.4)
7
- bundler (~> 1.0)
8
- git (>= 1.2.5)
9
- rake
10
- rdoc
11
- json (1.7.5)
12
- mail (2.5.3)
13
- i18n (>= 0.4.0)
14
- mime-types (~> 1.16)
15
- treetop (~> 1.4.8)
16
- mime-types (1.19)
17
- polyglot (0.3.3)
18
- rake (10.0.3)
19
- rdoc (3.12)
20
- json (~> 1.4)
21
- treetop (1.4.12)
22
- polyglot
23
- polyglot (>= 0.3.1)
24
-
25
- PLATFORMS
26
- ruby
27
-
28
- DEPENDENCIES
29
- jeweler (~> 1.8.4)
30
- mail
@@ -1,19 +0,0 @@
1
- = maillogger
2
-
3
- Description goes here.
4
-
5
- == Contributing to maillogger
6
-
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
- * Fork the project.
10
- * Start a feature/bugfix branch.
11
- * Commit and push until you are happy with your contribution.
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2012 Darwin. See LICENSE.txt for
18
- further details.
19
-