detroit-email 0.2.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2f404c9d5cf5dd50a6e295c89006206c62952f25
4
+ data.tar.gz: 35feafb655d78f595bcb60a9b0fc5e4f4e5e0543
5
+ SHA512:
6
+ metadata.gz: c1683f3ccd6dc92ecf44594f5709e582728b0123dc54d7da7d6f0707b75fe8fcf63ad14600f86409c75e999544c78c79c111f58076eaea66450a68e272c40c5f
7
+ data.tar.gz: f503c4ec5648a21fc5e5e84329382eceb7e5041f90d2619ee840a277b6b7f1c48f3fe0c464eb9900dc1480e7136e71bb4df1e1f3c5e4ff04d7391ec34621596e
@@ -1,16 +1,20 @@
1
- = Detroit Email Tool
1
+ # Detroit Email Tool
2
2
 
3
- {Website}[http://rubyworks.github.com/detroit-email] /
4
- {Report Issue}[http://github.com/rubyworks/detroit-email/issues] /
5
- {Repository}[http://github.com/rubyworks/deroit-email]
3
+ [Website](http://rubyworks.github.com/detroit-email) /
4
+ [Report Issue](http://github.com/rubyworks/detroit-email/issues) /
5
+ [Development](http://github.com/rubyworks/deroit-email)
6
6
 
7
+ [![Build Status](https://secure.travis-ci.org/rubyworks/detroit-email.png)](http://travis-ci.org/rubyworks/detroit-email)
8
+ [![Gem Version](https://badge.fury.io/rb/detroit-email.png)](http://badge.fury.io/rb/detroit-email)    
9
+ [![Flattr Me](http://api.flattr.com/button/flattr-badge-large.png)](http://flattr.com/thing/324911/Rubyworks-Ruby-Development-Fund)
7
10
 
8
- == Description
11
+
12
+ ## About
9
13
 
10
14
  The Email tool is used to send out project announcements to a set of
11
15
  email addresses.
12
16
 
13
- By default it generates a <i>release announcement</i> based on a projects
17
+ By default it generates a *release announcement* based on a projects
14
18
  metadata. Release announcements can be customized via _parts_, including
15
19
  a project's README file.
16
20
 
@@ -30,15 +34,21 @@ not be set independently for every project.
30
34
  @secure ENV['EMAIL_SECURE']
31
35
 
32
36
 
33
- == Installation
37
+ ## Installation
38
+
39
+ ### Using RubyGems
34
40
 
35
41
  $ gem install detroit-email
36
42
 
37
43
 
38
- == Copyrights
44
+ ## Legal
45
+
46
+ Detroit Email
39
47
 
40
48
  Copyright (c) 2011 Rubyworks
41
49
 
50
+ (GPL-3.0 License)
51
+
42
52
  This program is free software: you can redistribute it and/or modify
43
53
  it under the terms of the GNU General Public License as published by
44
54
  the Free Software Foundation, either version 3 of the License, or
@@ -49,6 +59,4 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
49
59
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50
60
  GNU General Public License for more details.
51
61
 
52
- You should have received a copy of the GNU General Public License
53
- along with this program. If not, see <http://www.gnu.org/licenses/>.
54
-
62
+ See COPYING.md file for full details.
@@ -1,17 +1,13 @@
1
- module Detroit
2
-
3
- require 'detroit/tool'
1
+ require 'detroit-standard'
4
2
 
5
- # New Email instance.
6
- def Email(options={})
7
- Email.new(options)
8
- end
3
+ module Detroit
9
4
 
5
+ ##
10
6
  # The Email tool is used to send out project announcements to a set of
11
7
  # email addresses.
12
8
  #
13
- # By default it generates a <i>release announcement</i> based on a projects
14
- # metadata. Release announcements can be customized via _parts_, including
9
+ # By default it generates a *release announcement* based on a projects
10
+ # metadata. Release announcements can be customized via *parts*, including
15
11
  # a project's README file.
16
12
  #
17
13
  # Fully custom messages can also be sent by setting the message field,
@@ -29,8 +25,47 @@ module Detroit
29
25
  # @login ENV['EMAIL_LOGIN']
30
26
  # @secure ENV['EMAIL_SECURE']
31
27
  #
28
+ # This tool ties into the `prepare` and `promote` stations of the
29
+ # standard toolchain.
30
+ #
32
31
  class Email < Tool
33
32
 
33
+ # Designed to interface with Statndard assembly. Attaches `#approve`
34
+ # method to `prepare` and `#announce` method to `promote` assembly
35
+ # stations.
36
+ #
37
+ # @!parse
38
+ # include Standard
39
+ #
40
+ assembly Standard
41
+
42
+ # Needs email utility provided by detroit.
43
+ include EmailUtils
44
+
45
+ # Location of manpage for this tool.
46
+ MANPAGE = File.dirname(__FILE__) + '/../man/detroit-email.5'
47
+
48
+ # Load any special requirements and set attribute defaults.
49
+ #
50
+ # @return [void]
51
+ def prerequisite
52
+ require 'facets/boolean' # TODO: should this universal?
53
+
54
+ @mailto = ['rubytalk@ruby-lang.org']
55
+ @subject = "[ANN] %s v%s released" % [metadata.title, metadata.version]
56
+ @file = nil #'doc/ANN{,OUNCE}{,.txt,.rdoc}' TODO: default announcment file?
57
+ @parts = [:message, :description, :resources, :notes, :changes]
58
+
59
+ #mailopts = Ratch::Emailer.environment_options.rekey(&:to_s) # FIXME
60
+ #@port = mailopts['port']
61
+ #@server = mailopts['server']
62
+ #@account = mailopts['account'] #|| metadata.email
63
+ #@domain = mailopts['domain'] #|| metadata.domain
64
+ #@login = mailopts['login']
65
+ #@secure = mailopts['secure']
66
+ #@from = mailopts['from'] #|| metadata.email
67
+ end
68
+
34
69
  # Message file to send.
35
70
  attr_accessor :file
36
71
 
@@ -75,42 +110,21 @@ module Detroit
75
110
  @secure = s.to_b
76
111
  end
77
112
 
78
-
79
- # A S S E M B L Y
80
-
81
- #
82
- def assemble?(station, options={})
83
- destination = options[:destination]
84
- case station
85
- when :prepare then (destination == :promote)
86
- when :promote then true
87
- else false
88
- end
89
- end
90
-
91
- # Attach #approve to prepare and #announce to promote assembly stations.
92
- def assemble(station, options={})
93
- destination = options[:destination]
94
- case station
95
- when :prepare
96
- approve if destination == :promote
97
- when :promote
98
- announce
99
- end
100
- end
101
-
102
-
103
- # S E R V I C E M E T H O D S
104
-
105
- #
113
+ # Ask developer if the mail should be sent.
106
114
  def approve
107
115
  apply_environment
108
116
  @approved = mail_confirm?
117
+ # TODO: better way to terminate?
109
118
  exit -1 unless @approved
110
119
  end
111
120
 
121
+ # Alias for #approve.
122
+ def prepare; approve; end
123
+
112
124
  # Send announcement message.
113
125
  def announce
126
+ apply_environment unless @approved
127
+
114
128
  mailopts = self.mailopts
115
129
 
116
130
  if mailto.empty?
@@ -132,8 +146,10 @@ module Detroit
132
146
  end
133
147
  end
134
148
 
135
- #
136
- alias_method :promote, :announce
149
+ # Alias for #announce.
150
+ def promote
151
+ announce
152
+ end
137
153
 
138
154
  # Message to send. Defaults to a generated release announcement.
139
155
  def message
@@ -201,29 +217,6 @@ module Detroit
201
217
  @secure ||= ENV['EMAIL_SECURE']
202
218
  end
203
219
 
204
- private
205
-
206
- def initialize_defaults
207
- @mailto = ['rubytalk@ruby-lang.org']
208
- @subject = "[ANN] %s v%s released" % [metadata.title, metadata.version]
209
- @file = nil #'doc/ANN{,OUNCE}{,.txt,.rdoc}' TODO: default announcment file?
210
- @parts = [:message, :description, :resources, :notes, :changes]
211
-
212
- #mailopts = Ratch::Emailer.environment_options.rekey(&:to_s) # FIXME
213
- #@port = mailopts['port']
214
- #@server = mailopts['server']
215
- #@account = mailopts['account'] #|| metadata.email
216
- #@domain = mailopts['domain'] #|| metadata.domain
217
- #@login = mailopts['login']
218
- #@secure = mailopts['secure']
219
- #@from = mailopts['from'] #|| metadata.email
220
- end
221
-
222
- #
223
- def initialize_requires
224
- require 'facets/boolean' # TODO: should this universal?
225
- end
226
-
227
220
  #
228
221
  #def announce_options(options)
229
222
  # options = options.rekey
@@ -240,10 +233,18 @@ module Detroit
240
233
  # result
241
234
  #end
242
235
 
243
- public
236
+ #
237
+ def assemble?(station, options={})
238
+ return true if station == :prepare && approve?(options)
239
+ return true if station == :promote
240
+ return false
241
+ end
242
+
243
+ private
244
244
 
245
- def self.man_page
246
- File.dirname(__FILE__)+'/../man/detroit-email.5'
245
+ #
246
+ def approve?(state)
247
+ state[:destination] == :promote
247
248
  end
248
249
 
249
250
  end
@@ -264,4 +265,3 @@ end
264
265
  #
265
266
  # You should have received a copy of the GNU General Public License
266
267
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
267
-
@@ -1,15 +1,16 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "DETROIT\-EMAIL" "5" "October 2011" "" ""
4
+ .TH "DETROIT\-EMAIL" "5" "January 2014" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBdetroit\-email\fR \- send out customizable email announcement
8
8
  .
9
9
  .SH "DESCRIPTION"
10
- The Email plug\-in for Detroit can send out release announcements, or other messages during the standard \fBpromote\fR stop\.
10
+ The Email plug\-in for Detroit can send out release announcements, or other messages during the standard \fBpromote\fR stage\.
11
11
  .
12
12
  .SH "OPTIONS"
13
+ The following options can be used in the Detroit toolchain file for defining an Email tool instance\.
13
14
  .
14
15
  .IP "\(bu" 4
15
16
  \fBfile\fR \- If the body of the message is in a file use this option to set the path to that file relative to the project\'s root directory\.
@@ -82,14 +83,14 @@ Most of the options default to environment variables (unless \fBnoenv\fR is used
82
83
  Note that if EMAIL_PASSWORD is not set in the environment, then the user will be prompted for it on the command line when it is required\.
83
84
  .
84
85
  .SH "EXAMPLES"
85
- Usually the use case is send out a release announcement, and in that case the default configuration suffices\. So, the typical example is as simple as:
86
+ Usually the usecase is for sending out a release announcement, and in that case the default configuration suffices\. So, the typical example is simply:
86
87
  .
87
88
  .IP "" 4
88
89
  .
89
90
  .nf
90
91
 
91
92
  announce:
92
- service: email
93
+ tool: email
93
94
  mailto:
94
95
  \- ruby\-talk@ruby\-lang\.org
95
96
  .
@@ -109,10 +110,10 @@ Development Site \fIhttp://github\.com/detroit/detroit\-email\fR
109
110
  .IP "" 0
110
111
  .
111
112
  .SH "COPYRIGHT"
112
- Copyright (c) 2010 Thomas Sawyer, Rubyworks
113
+ Copyright (c) 2010 Rubyworks
113
114
  .
114
115
  .P
115
116
  Detroit EMail is distributable in accordance with the GPLv3 license\.
116
117
  .
117
118
  .SH "SEE ALSO"
118
- dnote(1)
119
+ detroit(1)
@@ -61,7 +61,7 @@
61
61
  <a href="#RESOURCES">RESOURCES</a>
62
62
  <a href="#COPYRIGHT">COPYRIGHT</a>
63
63
  <a href="#SEE-ALSO">SEE ALSO</a>
64
- </div>
64
+ </div>
65
65
 
66
66
  <ol class='man-decor man-head man head'>
67
67
  <li class='tl'>detroit-email(5)</li>
@@ -76,11 +76,14 @@
76
76
 
77
77
  <h2 id="DESCRIPTION">DESCRIPTION</h2>
78
78
 
79
- <p>The Email plug-in for Detroit can send out release announcements, or other
80
- messages during the standard <code>promote</code> stop.</p>
79
+ <p>The Email plug-in for Detroit can send out release announcements,
80
+ or other messages during the standard <code>promote</code> stage.</p>
81
81
 
82
82
  <h2 id="OPTIONS">OPTIONS</h2>
83
83
 
84
+ <p>The following options can be used in the Detroit toolchain file
85
+ for defining an Email tool instance.</p>
86
+
84
87
  <ul>
85
88
  <li><p><code>file</code> - If the body of the message is in a file use this option
86
89
  to set the path to that file relative to the project's root
@@ -124,11 +127,11 @@ will be prompted for it on the command line when it is required.</p>
124
127
 
125
128
  <h2 id="EXAMPLES">EXAMPLES</h2>
126
129
 
127
- <p>Usually the use case is send out a release announcement, and in that case the
128
- default configuration suffices. So, the typical example is as simple as:</p>
130
+ <p>Usually the usecase is for sending out a release announcement, and in that
131
+ case the default configuration suffices. So, the typical example is simply:</p>
129
132
 
130
133
  <pre><code>announce:
131
- service: email
134
+ tool: email
132
135
  mailto:
133
136
  - ruby-talk@ruby-lang.org
134
137
  </code></pre>
@@ -145,18 +148,18 @@ default configuration suffices. So, the typical example is as simple as:</p>
145
148
 
146
149
  <h2 id="COPYRIGHT">COPYRIGHT</h2>
147
150
 
148
- <p>Copyright (c) 2010 Thomas Sawyer, Rubyworks</p>
151
+ <p>Copyright (c) 2010 Rubyworks</p>
149
152
 
150
153
  <p>Detroit EMail is distributable in accordance with the GPLv3 license.</p>
151
154
 
152
155
  <h2 id="SEE-ALSO">SEE ALSO</h2>
153
156
 
154
- <p><span class="man-ref">dnote<span class="s">(1)</span></span></p>
157
+ <p><span class="man-ref">detroit<span class="s">(1)</span></span></p>
155
158
 
156
159
 
157
160
  <ol class='man-decor man-foot man foot'>
158
161
  <li class='tl'></li>
159
- <li class='tc'>October 2011</li>
162
+ <li class='tc'>January 2014</li>
160
163
  <li class='tr'>detroit-email(5)</li>
161
164
  </ol>
162
165
 
@@ -3,12 +3,15 @@ detroit-email(5) - send out customizable email announcement
3
3
 
4
4
  ## DESCRIPTION
5
5
 
6
- The Email plug-in for Detroit can send out release announcements, or other
7
- messages during the standard `promote` stop.
6
+ The Email plug-in for Detroit can send out release announcements,
7
+ or other messages during the standard `promote` stage.
8
8
 
9
9
 
10
10
  ## OPTIONS
11
11
 
12
+ The following options can be used in the Detroit toolchain file
13
+ for defining an Email tool instance.
14
+
12
15
  * `file` - If the body of the message is in a file use this option
13
16
  to set the path to that file relative to the project's root
14
17
  directory.
@@ -59,11 +62,11 @@ will be prompted for it on the command line when it is required.
59
62
 
60
63
  ## EXAMPLES
61
64
 
62
- Usually the use case is send out a release announcement, and in that case the
63
- default configuration suffices. So, the typical example is as simple as:
65
+ Usually the usecase is for sending out a release announcement, and in that
66
+ case the default configuration suffices. So, the typical example is simply:
64
67
 
65
68
  announce:
66
- service: email
69
+ tool: email
67
70
  mailto:
68
71
  - ruby-talk@ruby-lang.org
69
72
 
@@ -79,7 +82,7 @@ For more information:
79
82
 
80
83
  ## COPYRIGHT
81
84
 
82
- Copyright (c) 2010 Thomas Sawyer, Rubyworks
85
+ Copyright (c) 2010 Rubyworks
83
86
 
84
87
  Detroit EMail is distributable in accordance with the GPLv3 license.
85
88
 
metadata CHANGED
@@ -1,27 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: detroit-email
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease:
4
+ version: 0.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - T.Sawyer
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-04-02 00:00:00.000000000 Z
11
+ date: 2014-01-14 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: detroit
16
- requirement: &8890620 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
- version: 0.3.0
19
+ version: '0.4'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *8890620
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0.4'
25
27
  description: Email plugin for Detroit build system. This plugin is designed to send
26
28
  out a well formated release announcement during the promote phase. Though, it can
27
29
  be configured to send out any message desired.
@@ -31,40 +33,37 @@ executables: []
31
33
  extensions: []
32
34
  extra_rdoc_files:
33
35
  - LICENSE.txt
34
- - README.rdoc
35
- - COPYING.rdoc
36
+ - README.md
36
37
  files:
37
- - .ruby
38
38
  - lib/detroit-email.rb
39
39
  - man/detroit-email.5
40
40
  - man/detroit-email.5.html
41
41
  - man/detroit-email.5.ronn
42
+ - README.md
42
43
  - LICENSE.txt
43
- - README.rdoc
44
- - COPYING.rdoc
45
44
  homepage: http://detroit.github.com/
46
45
  licenses:
47
- - GPL3
46
+ - GPL-3.0
47
+ metadata: {}
48
48
  post_install_message:
49
49
  rdoc_options: []
50
50
  require_paths:
51
51
  - lib
52
52
  required_ruby_version: !ruby/object:Gem::Requirement
53
- none: false
54
53
  requirements:
55
- - - ! '>='
54
+ - - '>='
56
55
  - !ruby/object:Gem::Version
57
56
  version: '0'
58
57
  required_rubygems_version: !ruby/object:Gem::Requirement
59
- none: false
60
58
  requirements:
61
- - - ! '>='
59
+ - - '>='
62
60
  - !ruby/object:Gem::Version
63
61
  version: '0'
64
62
  requirements: []
65
63
  rubyforge_project:
66
- rubygems_version: 1.8.11
64
+ rubygems_version: 2.0.3
67
65
  signing_key:
68
- specification_version: 3
66
+ specification_version: 4
69
67
  summary: Email plugin for Detroit
70
68
  test_files: []
69
+ has_rdoc:
data/.ruby DELETED
@@ -1,36 +0,0 @@
1
- ---
2
- source:
3
- - meta
4
- authors:
5
- - name: T.Sawyer
6
- email: transfire@gmail.com
7
- copyrights:
8
- - holder: Thomas Sawyer
9
- year: '2011'
10
- license: GPL3
11
- requirements:
12
- - name: detroit
13
- version: 0.3.0+
14
- dependencies: []
15
- alternatives: []
16
- conflicts: []
17
- repositories: []
18
- resources:
19
- home: http://detroit.github.com/
20
- code: http://github.com/detroit/detroit-email
21
- mail: http://groups.google.com/group/rubyworks-mailinglist
22
- extra: {}
23
- load_path:
24
- - lib
25
- revision: 0
26
- created: '2011-10-16'
27
- summary: Email plugin for Detroit
28
- title: Detroit Email
29
- version: 0.2.0
30
- name: detroit-email
31
- suite: detroit
32
- description: Email plugin for Detroit build system. This plugin is designed to send
33
- out a well formated release announcement during the promote phase. Though, it can
34
- be configured to send out any message desired.
35
- organization: rubyworks
36
- date: '2012-04-01'
@@ -1,21 +0,0 @@
1
- = COPYRIGHT NOTICES
2
-
3
- == Detroit Email
4
-
5
- Copyright (c) 2011 Rubyworks
6
-
7
- This program is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- This program is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with this program. If not, see <http://www.gnu.org/licenses/>.
19
-
20
- (http://detroit.github.com)
21
-