email-logger 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 892f4a76069af3a3d5b84763022cb888ee9bf3db
4
+ data.tar.gz: f8647ee44445218e01ad145009d2b8bbb21e878d
5
+ SHA512:
6
+ metadata.gz: 922da47247a76a198cbed141d2bad3ce5500b762c932c0350423381c34804baac9a23e3591ac085e87d712c152b04e761d58499a312e810462ede56668652854
7
+ data.tar.gz: c45f894b7284a2e4373bed9251a53487628f104b7f61214d593fd3829ffb6c5283ef807df2d0b485d2c1d2e4a4f235067c733bf27c3bb2569a4a84543ef93e69
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.gitignore ADDED
@@ -0,0 +1,49 @@
1
+ # rcov generated
2
+ coverage
3
+ coverage.data
4
+
5
+ # rdoc generated
6
+ rdoc
7
+
8
+ # yard generated
9
+ doc
10
+ .yardoc
11
+
12
+ # bundler
13
+ .bundle
14
+
15
+ # jeweler generated
16
+ pkg
17
+
18
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
19
+ #
20
+ # * Create a file at ~/.gitignore
21
+ # * Include files you want ignored
22
+ # * Run: git config --global core.excludesfile ~/.gitignore
23
+ #
24
+ # After doing this, these files will be ignored in all your git projects,
25
+ # saving you from having to 'pollute' every project you touch with them
26
+ #
27
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
28
+ #
29
+ # For MacOS:
30
+ #
31
+ #.DS_Store
32
+
33
+ # For TextMate
34
+ #*.tmproj
35
+ #tmtags
36
+
37
+ # For emacs:
38
+ #*~
39
+ #\#*
40
+ #.\#*
41
+
42
+ # For vim:
43
+ #*.swp
44
+
45
+ # For redcar:
46
+ #.redcar
47
+
48
+ # For rubinius:
49
+ #*.rbc
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "shoulda", ">= 0"
10
+ gem "rdoc", "~> 3.12"
11
+ gem "bundler"
12
+ gem "jeweler", "~> 1.8.4"
13
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,72 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activesupport (4.0.0)
5
+ i18n (~> 0.6, >= 0.6.4)
6
+ minitest (~> 4.2)
7
+ multi_json (~> 1.3)
8
+ thread_safe (~> 0.1)
9
+ tzinfo (~> 0.3.37)
10
+ addressable (2.3.5)
11
+ atomic (1.1.12)
12
+ builder (3.2.2)
13
+ faraday (0.8.8)
14
+ multipart-post (~> 1.2.0)
15
+ git (1.2.5)
16
+ github_api (0.10.1)
17
+ addressable
18
+ faraday (~> 0.8.1)
19
+ hashie (>= 1.2)
20
+ multi_json (~> 1.4)
21
+ nokogiri (~> 1.5.2)
22
+ oauth2
23
+ hashie (2.0.5)
24
+ highline (1.6.19)
25
+ httpauth (0.2.0)
26
+ i18n (0.6.4)
27
+ jeweler (1.8.6)
28
+ builder
29
+ bundler (~> 1.0)
30
+ git (>= 1.2.5)
31
+ github_api (= 0.10.1)
32
+ highline (>= 1.6.15)
33
+ nokogiri (= 1.5.10)
34
+ rake
35
+ rdoc
36
+ json (1.8.0)
37
+ jwt (0.1.8)
38
+ multi_json (>= 1.5)
39
+ minitest (4.7.5)
40
+ multi_json (1.7.9)
41
+ multi_xml (0.5.5)
42
+ multipart-post (1.2.0)
43
+ nokogiri (1.5.10)
44
+ oauth2 (0.9.2)
45
+ faraday (~> 0.8)
46
+ httpauth (~> 0.2)
47
+ jwt (~> 0.1.4)
48
+ multi_json (~> 1.0)
49
+ multi_xml (~> 0.5)
50
+ rack (~> 1.2)
51
+ rack (1.5.2)
52
+ rake (10.1.0)
53
+ rdoc (3.12.2)
54
+ json (~> 1.4)
55
+ shoulda (3.5.0)
56
+ shoulda-context (~> 1.0, >= 1.0.1)
57
+ shoulda-matchers (>= 1.4.1, < 3.0)
58
+ shoulda-context (1.1.4)
59
+ shoulda-matchers (2.2.0)
60
+ activesupport (>= 3.0.0)
61
+ thread_safe (0.1.2)
62
+ atomic
63
+ tzinfo (0.3.37)
64
+
65
+ PLATFORMS
66
+ ruby
67
+
68
+ DEPENDENCIES
69
+ bundler
70
+ jeweler (~> 1.8.4)
71
+ rdoc (~> 3.12)
72
+ shoulda
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Mohammad
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.
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = email-logger
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to email-logger
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) 2013 Mohammad. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile ADDED
@@ -0,0 +1,53 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "email-logger"
18
+ gem.homepage = "http://github.com/mamady/email-logger"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{TODO: one-line summary of your gem}
21
+ gem.description = %Q{TODO: longer description of your gem}
22
+ gem.email = "m@forouzani.com"
23
+ gem.authors = ["Mohammad"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rake/testtask'
29
+ Rake::TestTask.new(:test) do |test|
30
+ test.libs << 'lib' << 'test'
31
+ test.pattern = 'test/**/test_*.rb'
32
+ test.verbose = true
33
+ end
34
+
35
+ require 'rcov/rcovtask'
36
+ Rcov::RcovTask.new do |test|
37
+ test.libs << 'test'
38
+ test.pattern = 'test/**/test_*.rb'
39
+ test.verbose = true
40
+ test.rcov_opts << '--exclude "gems/*"'
41
+ end
42
+
43
+ task :default => :test
44
+
45
+ require 'rdoc/task'
46
+ Rake::RDocTask.new do |rdoc|
47
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
48
+
49
+ rdoc.rdoc_dir = 'rdoc'
50
+ rdoc.title = "email-logger #{version}"
51
+ rdoc.rdoc_files.include('README*')
52
+ rdoc.rdoc_files.include('lib/**/*.rb')
53
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.1
@@ -0,0 +1,3 @@
1
+ class EmailLog < ActiveRecord::Base
2
+ attr_accessible :to, :from, :subject, :body
3
+ end
@@ -0,0 +1,7 @@
1
+ class EmailLogger
2
+ def self.delivered_email(message)
3
+ EmailLog.create(:to => message.to.to_s, :from => message.from.to_s, :subject => message.subject, :body => message.body.to_s)
4
+ end
5
+ end
6
+
7
+ ActionMailer::Base.register_observer(EmailLogger)
@@ -0,0 +1,15 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'email-logger'
3
+ s.version = '0.1.1'
4
+ s.date = '2013-08-12'
5
+ s.summary = "Logs all emails sent from rails to the database."
6
+ s.description = "A simple email logger."
7
+ s.authors = ["Mohammad Forouzani"]
8
+ s.email = 'm@forouzani.com'
9
+ s.homepage = 'http://www.forouzani.com/email-logger'
10
+ s.license = 'MIT'
11
+ s.files = `git ls-files`.split("\n")
12
+ s.require_paths = ["lib"]
13
+
14
+ s.add_dependency "actionmailer", "~> 3.2.1"
15
+ end
@@ -0,0 +1,6 @@
1
+ require 'rails'
2
+
3
+ module EmailLogger
4
+ class Engine < ::Rails::Engine
5
+ end
6
+ end
@@ -0,0 +1,13 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/active_record'
3
+
4
+ class EmailLoggerGenerator < Rails::Generators::Base
5
+ include Rails::Generators::Migration
6
+ extend ActiveRecord::Generators::Migration
7
+
8
+ source_root File.expand_path('../templates', __FILE__)
9
+
10
+ def copy_files(*args)
11
+ migration_template 'create_email_logs.rb', 'db/migrate/create_email_logs.rb'
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ class CreateEmailLogs < ActiveRecord::Migration
2
+ def change
3
+ create_table :email_logs do |t|
4
+ t.string :to
5
+ t.string :from
6
+ t.string :subject
7
+ t.text :body
8
+ t.datetime :created_at
9
+ end
10
+
11
+ add_index :email_logs, :to
12
+ add_index :email_logs, :from
13
+ end
14
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: email-logger
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Mohammad Forouzani
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-08-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: actionmailer
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 3.2.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.1
27
+ description: A simple email logger.
28
+ email: m@forouzani.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - .document
34
+ - .gitignore
35
+ - Gemfile
36
+ - Gemfile.lock
37
+ - LICENSE.txt
38
+ - README.rdoc
39
+ - Rakefile
40
+ - VERSION
41
+ - app/models/email_log.rb
42
+ - config/initializers/email_logger.rb
43
+ - email-logger.gemspec
44
+ - lib/email-logger.rb
45
+ - lib/generators/email_logger_generator.rb
46
+ - lib/generators/templates/create_email_logs.rb
47
+ homepage: http://www.forouzani.com/email-logger
48
+ licenses:
49
+ - MIT
50
+ metadata: {}
51
+ post_install_message:
52
+ rdoc_options: []
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ requirements: []
66
+ rubyforge_project:
67
+ rubygems_version: 2.0.3
68
+ signing_key:
69
+ specification_version: 4
70
+ summary: Logs all emails sent from rails to the database.
71
+ test_files: []