ar_mailer_generator 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/Manifest.txt +9 -0
- data/README.txt +39 -0
- data/Rakefile +18 -0
- data/ar_mailer_generator.rb +28 -0
- data/init.rb +0 -0
- data/lib/ar_mailer_generator_version.rb +3 -0
- data/templates/migration.erb +15 -0
- data/templates/model.erb +2 -0
- metadata +74 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
ArMailerGenerator
|
2
|
+
by Geoffrey Grosenbach
|
3
|
+
boss@topfunky.com
|
4
|
+
http://topfunky.com
|
5
|
+
|
6
|
+
== DESCRIPTION:
|
7
|
+
|
8
|
+
Uses the Rails generator mechanism to make a migration and model file for using Eric Hodel's ar_mailer gem.
|
9
|
+
|
10
|
+
== INSTALL:
|
11
|
+
|
12
|
+
* sudo gem install ar_mailer_generator
|
13
|
+
* Run ./script/generate ar_mailer
|
14
|
+
* Follow rest of instructions on configuring ar_mailer
|
15
|
+
|
16
|
+
== LICENSE:
|
17
|
+
|
18
|
+
(The MIT License)
|
19
|
+
|
20
|
+
Copyright (c) 2007 Topfunky Corporation
|
21
|
+
|
22
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
23
|
+
a copy of this software and associated documentation files (the
|
24
|
+
'Software'), to deal in the Software without restriction, including
|
25
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
26
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
27
|
+
permit persons to whom the Software is furnished to do so, subject to
|
28
|
+
the following conditions:
|
29
|
+
|
30
|
+
The above copyright notice and this permission notice shall be
|
31
|
+
included in all copies or substantial portions of the Software.
|
32
|
+
|
33
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
34
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
35
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
36
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
37
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
38
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
39
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
require 'lib/ar_mailer_generator_version'
|
6
|
+
|
7
|
+
Hoe.new('ar_mailer_generator', ArMailerGeneratorVersion::VERSION) do |p|
|
8
|
+
p.rubyforge_name = 'ar_mailer_generator'
|
9
|
+
p.author = 'Geoffrey Grosenbach'
|
10
|
+
p.email = 'boss@topfunky.com'
|
11
|
+
p.summary = 'Generates files for using ar_mailer to send emails from Rails applications.'
|
12
|
+
p.description = p.paragraphs_of('README.txt', 1..1).join("\n\n")
|
13
|
+
p.url = "http://rubyforge.org/projects/seattlerb"
|
14
|
+
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
15
|
+
p.extra_deps = ['ar_mailer']
|
16
|
+
end
|
17
|
+
|
18
|
+
# vim: syntax=Ruby
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class ArMailerGenerator < Rails::Generator::Base
|
2
|
+
|
3
|
+
def manifest
|
4
|
+
record do |m|
|
5
|
+
class_name ||= 'email'
|
6
|
+
|
7
|
+
migration_class_name = "Add" + Inflector.classify(class_name)
|
8
|
+
migration_table_name = Inflector.tableize(class_name)
|
9
|
+
migration_file_name = Inflector.underscore(migration_class_name)
|
10
|
+
m.migration_template('migration.erb', 'db/migrate', {
|
11
|
+
:migration_file_name => migration_file_name,
|
12
|
+
:assigns => {
|
13
|
+
:migration_class_name => migration_class_name,
|
14
|
+
:table_name => migration_table_name
|
15
|
+
}
|
16
|
+
})
|
17
|
+
|
18
|
+
model_class_name = Inflector.classify(class_name)
|
19
|
+
model_file_name = Inflector.underscore(model_class_name)
|
20
|
+
m.template('model.erb', "app/models/#{model_file_name}.rb", {
|
21
|
+
:assigns => {
|
22
|
+
:class_name => model_class_name
|
23
|
+
}
|
24
|
+
})
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
data/init.rb
ADDED
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class <%= migration_class_name %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :<%= table_name %> do |t|
|
4
|
+
t.column :from, :string
|
5
|
+
t.column :to, :string
|
6
|
+
t.column :last_send_attempt, :integer, :default => 0
|
7
|
+
t.column :mail, :text
|
8
|
+
t.column :created_on, :datetime
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.down
|
13
|
+
drop_table :<%= table_name %>
|
14
|
+
end
|
15
|
+
end
|
data/templates/model.erb
ADDED
metadata
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.0
|
3
|
+
specification_version: 1
|
4
|
+
name: ar_mailer_generator
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 1.0.0
|
7
|
+
date: 2007-08-13 00:00:00 -07:00
|
8
|
+
summary: Generates files for using ar_mailer to send emails from Rails applications.
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: boss@topfunky.com
|
12
|
+
homepage: http://rubyforge.org/projects/seattlerb
|
13
|
+
rubyforge_project: ar_mailer_generator
|
14
|
+
description: "== DESCRIPTION: Uses the Rails generator mechanism to make a migration and model file for using Eric Hodel's ar_mailer gem."
|
15
|
+
autorequire:
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- Geoffrey Grosenbach
|
31
|
+
files:
|
32
|
+
- History.txt
|
33
|
+
- Manifest.txt
|
34
|
+
- README.txt
|
35
|
+
- Rakefile
|
36
|
+
- init.rb
|
37
|
+
- ar_mailer_generator.rb
|
38
|
+
- templates/migration.erb
|
39
|
+
- templates/model.erb
|
40
|
+
- lib/ar_mailer_generator_version.rb
|
41
|
+
test_files: []
|
42
|
+
|
43
|
+
rdoc_options:
|
44
|
+
- --main
|
45
|
+
- README.txt
|
46
|
+
extra_rdoc_files:
|
47
|
+
- History.txt
|
48
|
+
- Manifest.txt
|
49
|
+
- README.txt
|
50
|
+
executables: []
|
51
|
+
|
52
|
+
extensions: []
|
53
|
+
|
54
|
+
requirements: []
|
55
|
+
|
56
|
+
dependencies:
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: ar_mailer
|
59
|
+
version_requirement:
|
60
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">"
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 0.0.0
|
65
|
+
version:
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
name: hoe
|
68
|
+
version_requirement:
|
69
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: 1.2.2
|
74
|
+
version:
|