brief_mail 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -6,3 +6,4 @@ Gemfile.lock
6
6
 
7
7
  tmp
8
8
  doc/
9
+ pkg/
@@ -0,0 +1,14 @@
1
+ ## master
2
+
3
+ ## v0.0.3 @ 2012-09-29
4
+
5
+ * Fix/update tests.
6
+
7
+ ## v0.0.2 @ 2012-09-29
8
+
9
+ * Moved minitest from dependency to development dependency.
10
+ * Added :template option.
11
+
12
+ ## v0.0.1 @ 2012-09-29
13
+
14
+ * Initial public release.
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
- # This is the default:
90
- git_format: %(* %ad %s%+b)
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
 
@@ -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
@@ -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 do
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(", ")
@@ -1,3 +1,3 @@
1
1
  module BriefMail
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -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
- 4.times { config.expect(:fetch, from_user, [:brief_mail_config]) }
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 deploy to test/, body
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.1
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: :runtime
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: 1350458245436211571
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: 1350458245436211571
117
+ hash: 2394314465726687424
117
118
  requirements: []
118
119
  rubyforge_project:
119
120
  rubygems_version: 1.8.24