brief_mail 0.0.1 → 0.0.3
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/.gitignore +1 -0
- data/HISTORY.md +14 -0
- data/README.md +12 -2
- data/brief_mail.gemspec +1 -1
- data/lib/brief_mail/mailer.rb +3 -3
- data/lib/brief_mail/version.rb +1 -1
- data/test/brief_mail/mailer_test.rb +2 -2
- metadata +5 -4
data/.gitignore
CHANGED
data/HISTORY.md
ADDED
data/README.md
CHANGED
@@ -86,8 +86,18 @@ ActionMailer config options.
|
|
86
86
|
When using git, a `git_format` option can be used to control the output of the
|
87
87
|
logs:
|
88
88
|
|
89
|
-
|
90
|
-
|
89
|
+
# This is the default:
|
90
|
+
git_format: %(* %ad %s%+b)
|
91
|
+
|
92
|
+
A different/custom template can be used by specifying in the config:
|
93
|
+
|
94
|
+
template: 'app/views/some_template.txt' # trailing .erb is not needed.
|
95
|
+
|
96
|
+
Some variables with useful data and methods are available in the template,
|
97
|
+
please read the source for the API:
|
98
|
+
|
99
|
+
* `@config`: [`lib/brief_mail/config_adapters/abstract_adapter.rb`](https://github.com/sce/brief_mail/blob/master/lib/brief_mail/config_adapters/abstract_adapter.rb)
|
100
|
+
* `@scm`: [`lib/brief_mail/scm_adapters/abstract_adapter.rb`](https://github.com/sce/brief_mail/blob/master/lib/brief_mail/scm_adapters/abstract_adapter.rb)
|
91
101
|
|
92
102
|
### Source Control Management
|
93
103
|
|
data/brief_mail.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
20
|
gem.add_dependency "actionmailer", "~> 3.0"
|
21
|
-
gem.add_dependency "minitest", "~> 4.0"
|
22
21
|
|
22
|
+
gem.add_development_dependency "minitest", "~> 4.0"
|
23
23
|
gem.add_development_dependency "rake", "~> 0.9"
|
24
24
|
end
|
data/lib/brief_mail/mailer.rb
CHANGED
@@ -29,10 +29,10 @@ module BriefMail
|
|
29
29
|
recipients = @config.recipients or raise %(One or more recipients are required.)
|
30
30
|
subj = @config.subject || %([DEPLOY] %s deployed to %s) % [@config.application, @config.stage]
|
31
31
|
|
32
|
+
template = @config.from_user[:template] || "brief_mail/views/deploy_notification.txt"
|
33
|
+
|
32
34
|
mail( to: recipients, subject: subj ) do |format|
|
33
|
-
format.text
|
34
|
-
render "brief_mail/views/deploy_notification.txt"
|
35
|
-
end
|
35
|
+
format.text { render template }
|
36
36
|
end
|
37
37
|
|
38
38
|
puts %(Sent mail to %s.) % [recipients].join(", ")
|
data/lib/brief_mail/version.rb
CHANGED
@@ -29,7 +29,7 @@ class MailerTest < MiniTest::Unit::TestCase
|
|
29
29
|
2.times { config.expect :application, "Test Application" }
|
30
30
|
|
31
31
|
from_user = { mailer: { delivery_method: :test }, recipients: %w(test@example.com) }
|
32
|
-
|
32
|
+
5.times { config.expect(:fetch, from_user, [:brief_mail_config]) }
|
33
33
|
|
34
34
|
def Dir.chdir(*args)
|
35
35
|
yield if block_given?
|
@@ -40,7 +40,7 @@ class MailerTest < MiniTest::Unit::TestCase
|
|
40
40
|
config.verify
|
41
41
|
|
42
42
|
assert body = mail.body.to_s
|
43
|
-
assert_match /Test Application has been
|
43
|
+
assert_match /Test Application has been deployed to test/, body
|
44
44
|
assert_match /2012-09-29 Rakefile: Setup test environment with MiniTest/, body
|
45
45
|
assert_match /README\.md\s+\|\s+\d+ \++/, body
|
46
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brief_mail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '4.0'
|
38
|
-
type: :
|
38
|
+
type: :development
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
@@ -69,6 +69,7 @@ extra_rdoc_files: []
|
|
69
69
|
files:
|
70
70
|
- .gitignore
|
71
71
|
- Gemfile
|
72
|
+
- HISTORY.md
|
72
73
|
- LICENSE.txt
|
73
74
|
- README.md
|
74
75
|
- Rakefile
|
@@ -104,7 +105,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
105
|
version: '0'
|
105
106
|
segments:
|
106
107
|
- 0
|
107
|
-
hash:
|
108
|
+
hash: 2394314465726687424
|
108
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
110
|
none: false
|
110
111
|
requirements:
|
@@ -113,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
114
|
version: '0'
|
114
115
|
segments:
|
115
116
|
- 0
|
116
|
-
hash:
|
117
|
+
hash: 2394314465726687424
|
117
118
|
requirements: []
|
118
119
|
rubyforge_project:
|
119
120
|
rubygems_version: 1.8.24
|