ratch 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/LICENSE.txt +344 -0
  2. data/README.txt +10 -0
  3. data/bin/lt +4 -0
  4. data/bin/ludo +4 -0
  5. data/bin/ratch +8 -0
  6. data/data/mint/ratch/announce +224 -0
  7. data/data/mint/ratch/install +49 -0
  8. data/data/mint/ratch/notes +183 -0
  9. data/data/mint/ratch/publish +44 -0
  10. data/data/mint/ratch/rdoc +40 -0
  11. data/data/mint/ratch/setup +1616 -0
  12. data/data/mint/ratch/stats +138 -0
  13. data/demo/README +8 -0
  14. data/demo/doc/rdoc/created.rid +1 -0
  15. data/demo/doc/rdoc/files/README.html +112 -0
  16. data/demo/doc/rdoc/files/lib/foo/foo_rb.html +145 -0
  17. data/demo/doc/rdoc/fr_class_index.html +26 -0
  18. data/demo/doc/rdoc/fr_file_index.html +28 -0
  19. data/demo/doc/rdoc/fr_method_index.html +27 -0
  20. data/demo/doc/rdoc/index.html +24 -0
  21. data/demo/doc/rdoc/rdoc-style.css +208 -0
  22. data/demo/lib/foo/foo.rb +7 -0
  23. data/demo/util/conf/rdoc +4 -0
  24. data/demo/util/one +6 -0
  25. data/demo/util/rdoc +39 -0
  26. data/demo/util/tryme +10 -0
  27. data/dev/taskable-simple.rb +42 -0
  28. data/dev/taskable.rb +573 -0
  29. data/lib/ratch/batch.rb +43 -0
  30. data/lib/ratch/cli/lt.rb +56 -0
  31. data/lib/ratch/cli/ludo.rb +14 -0
  32. data/lib/ratch/cli/ratch.rb +47 -0
  33. data/lib/ratch/configutils.rb +100 -0
  34. data/lib/ratch/consoleutils.rb +88 -0
  35. data/lib/ratch/emailutils.rb +88 -0
  36. data/lib/ratch/fileutils.rb +173 -0
  37. data/lib/ratch/options.rb +57 -0
  38. data/lib/ratch/runnable.rb +117 -0
  39. data/lib/ratch/taskable.rb +105 -0
  40. data/lib/ratch/taskutils.rb +44 -0
  41. data/lib/ratch/uploadutils.rb +413 -0
  42. data/meta/manifest.txt +70 -0
  43. data/meta/project.yaml +24 -0
  44. data/misc/original.rb +308 -0
  45. data/task/setup +1616 -0
  46. data/task/stats +138 -0
  47. metadata +114 -0
data/LICENSE.txt ADDED
@@ -0,0 +1,344 @@
1
+
2
+ THE RUBY LICENSE
3
+ (http://www.ruby-lang.org/en/LICENSE.txt)
4
+
5
+ You may redistribute this software and/or modify it under either the terms of
6
+ the GPL (see below), or the conditions below:
7
+
8
+ 1. You may make and give away verbatim copies of the source form of the
9
+ software without restriction, provided that you duplicate all of the
10
+ original copyright notices and associated disclaimers.
11
+
12
+ 2. You may modify your copy of the software in any way, provided that
13
+ you do at least ONE of the following:
14
+
15
+ a) place your modifications in the Public Domain or otherwise
16
+ make them Freely Available, such as by posting said
17
+ modifications to Usenet or an equivalent medium, or by allowing
18
+ the author to include your modifications in the software.
19
+
20
+ b) use the modified software only within your corporation or
21
+ organization.
22
+
23
+ c) rename any non-standard executables so the names do not conflict
24
+ with standard executables, which must also be provided.
25
+
26
+ d) make other distribution arrangements with the author.
27
+
28
+ 3. You may distribute the software in object code or executable
29
+ form, provided that you do at least ONE of the following:
30
+
31
+ a) distribute the executables and library files of the software,
32
+ together with instructions (in the manual page or equivalent)
33
+ on where to get the original distribution.
34
+
35
+ b) accompany the distribution with the machine-readable source of
36
+ the software.
37
+
38
+ c) give non-standard executables non-standard names, with
39
+ instructions on where to get the original software distribution.
40
+
41
+ d) make other distribution arrangements with the author.
42
+
43
+ 4. You may modify and include the part of the software into any other
44
+ software (possibly commercial). But some files in the distribution
45
+ are not written by the author, so that they are not under these terms.
46
+
47
+ For the list of those files and their copying conditions, see the
48
+ file LEGAL.
49
+
50
+ 5. The scripts and library files supplied as input to or produced as
51
+ output from the software do not automatically fall under the
52
+ copyright of the software, but belong to whomever generated them,
53
+ and may be sold commercially, and may be aggregated with this
54
+ software.
55
+
56
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
57
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
58
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
59
+ PURPOSE.
60
+
61
+ ----------------------------------------------------------------------------
62
+
63
+
64
+ GNU GENERAL PUBLIC LICENSE
65
+ Version 2, June 1991
66
+
67
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
68
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
69
+ Everyone is permitted to copy and distribute verbatim copies
70
+ of this license document, but changing it is not allowed.
71
+
72
+ Preamble
73
+
74
+ The licenses for most software are designed to take away your
75
+ freedom to share and change it. By contrast, the GNU General Public
76
+ License is intended to guarantee your freedom to share and change free
77
+ software--to make sure the software is free for all its users. This
78
+ General Public License applies to most of the Free Software
79
+ Foundation's software and to any other program whose authors commit to
80
+ using it. (Some other Free Software Foundation software is covered by
81
+ the GNU Library General Public License instead.) You can apply it to
82
+ your programs, too.
83
+
84
+ When we speak of free software, we are referring to freedom, not
85
+ price. Our General Public Licenses are designed to make sure that you
86
+ have the freedom to distribute copies of free software (and charge for
87
+ this service if you wish), that you receive source code or can get it
88
+ if you want it, that you can change the software or use pieces of it
89
+ in new free programs; and that you know you can do these things.
90
+
91
+ To protect your rights, we need to make restrictions that forbid
92
+ anyone to deny you these rights or to ask you to surrender the rights.
93
+ These restrictions translate to certain responsibilities for you if you
94
+ distribute copies of the software, or if you modify it.
95
+
96
+ For example, if you distribute copies of such a program, whether
97
+ gratis or for a fee, you must give the recipients all the rights that
98
+ you have. You must make sure that they, too, receive or can get the
99
+ source code. And you must show them these terms so they know their
100
+ rights.
101
+
102
+ We protect your rights with two steps: (1) copyright the software, and
103
+ (2) offer you this license which gives you legal permission to copy,
104
+ distribute and/or modify the software.
105
+
106
+ Also, for each author's protection and ours, we want to make certain
107
+ that everyone understands that there is no warranty for this free
108
+ software. If the software is modified by someone else and passed on, we
109
+ want its recipients to know that what they have is not the original, so
110
+ that any problems introduced by others will not reflect on the original
111
+ authors' reputations.
112
+
113
+ Finally, any free program is threatened constantly by software
114
+ patents. We wish to avoid the danger that redistributors of a free
115
+ program will individually obtain patent licenses, in effect making the
116
+ program proprietary. To prevent this, we have made it clear that any
117
+ patent must be licensed for everyone's free use or not licensed at all.
118
+
119
+ The precise terms and conditions for copying, distribution and
120
+ modification follow.
121
+
122
+ GNU GENERAL PUBLIC LICENSE
123
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
124
+
125
+ 0. This License applies to any program or other work which contains
126
+ a notice placed by the copyright holder saying it may be distributed
127
+ under the terms of this General Public License. The "Program", below,
128
+ refers to any such program or work, and a "work based on the Program"
129
+ means either the Program or any derivative work under copyright law:
130
+ that is to say, a work containing the Program or a portion of it,
131
+ either verbatim or with modifications and/or translated into another
132
+ language. (Hereinafter, translation is included without limitation in
133
+ the term "modification".) Each licensee is addressed as "you".
134
+
135
+ Activities other than copying, distribution and modification are not
136
+ covered by this License; they are outside its scope. The act of
137
+ running the Program is not restricted, and the output from the Program
138
+ is covered only if its contents constitute a work based on the
139
+ Program (independent of having been made by running the Program).
140
+ Whether that is true depends on what the Program does.
141
+
142
+ 1. You may copy and distribute verbatim copies of the Program's
143
+ source code as you receive it, in any medium, provided that you
144
+ conspicuously and appropriately publish on each copy an appropriate
145
+ copyright notice and disclaimer of warranty; keep intact all the
146
+ notices that refer to this License and to the absence of any warranty;
147
+ and give any other recipients of the Program a copy of this License
148
+ along with the Program.
149
+
150
+ You may charge a fee for the physical act of transferring a copy, and
151
+ you may at your option offer warranty protection in exchange for a fee.
152
+
153
+ 2. You may modify your copy or copies of the Program or any portion
154
+ of it, thus forming a work based on the Program, and copy and
155
+ distribute such modifications or work under the terms of Section 1
156
+ above, provided that you also meet all of these conditions:
157
+
158
+ a) You must cause the modified files to carry prominent notices
159
+ stating that you changed the files and the date of any change.
160
+
161
+ b) You must cause any work that you distribute or publish, that in
162
+ whole or in part contains or is derived from the Program or any
163
+ part thereof, to be licensed as a whole at no charge to all third
164
+ parties under the terms of this License.
165
+
166
+ c) If the modified program normally reads commands interactively
167
+ when run, you must cause it, when started running for such
168
+ interactive use in the most ordinary way, to print or display an
169
+ announcement including an appropriate copyright notice and a
170
+ notice that there is no warranty (or else, saying that you provide
171
+ a warranty) and that users may redistribute the program under
172
+ these conditions, and telling the user how to view a copy of this
173
+ License. (Exception: if the Program itself is interactive but
174
+ does not normally print such an announcement, your work based on
175
+ the Program is not required to print an announcement.)
176
+
177
+ These requirements apply to the modified work as a whole. If
178
+ identifiable sections of that work are not derived from the Program,
179
+ and can be reasonably considered independent and separate works in
180
+ themselves, then this License, and its terms, do not apply to those
181
+ sections when you distribute them as separate works. But when you
182
+ distribute the same sections as part of a whole which is a work based
183
+ on the Program, the distribution of the whole must be on the terms of
184
+ this License, whose permissions for other licensees extend to the
185
+ entire whole, and thus to each and every part regardless of who wrote it.
186
+
187
+ Thus, it is not the intent of this section to claim rights or contest
188
+ your rights to work written entirely by you; rather, the intent is to
189
+ exercise the right to control the distribution of derivative or
190
+ collective works based on the Program.
191
+
192
+ In addition, mere aggregation of another work not based on the Program
193
+ with the Program (or with a work based on the Program) on a volume of
194
+ a storage or distribution medium does not bring the other work under
195
+ the scope of this License.
196
+
197
+ 3. You may copy and distribute the Program (or a work based on it,
198
+ under Section 2) in object code or executable form under the terms of
199
+ Sections 1 and 2 above provided that you also do one of the following:
200
+
201
+ a) Accompany it with the complete corresponding machine-readable
202
+ source code, which must be distributed under the terms of Sections
203
+ 1 and 2 above on a medium customarily used for software interchange; or,
204
+
205
+ b) Accompany it with a written offer, valid for at least three
206
+ years, to give any third party, for a charge no more than your
207
+ cost of physically performing source distribution, a complete
208
+ machine-readable copy of the corresponding source code, to be
209
+ distributed under the terms of Sections 1 and 2 above on a medium
210
+ customarily used for software interchange; or,
211
+
212
+ c) Accompany it with the information you received as to the offer
213
+ to distribute corresponding source code. (This alternative is
214
+ allowed only for noncommercial distribution and only if you
215
+ received the program in object code or executable form with such
216
+ an offer, in accord with Subsection b above.)
217
+
218
+ The source code for a work means the preferred form of the work for
219
+ making modifications to it. For an executable work, complete source
220
+ code means all the source code for all modules it contains, plus any
221
+ associated interface definition files, plus the scripts used to
222
+ control compilation and installation of the executable. However, as a
223
+ special exception, the source code distributed need not include
224
+ anything that is normally distributed (in either source or binary
225
+ form) with the major components (compiler, kernel, and so on) of the
226
+ operating system on which the executable runs, unless that component
227
+ itself accompanies the executable.
228
+
229
+ If distribution of executable or object code is made by offering
230
+ access to copy from a designated place, then offering equivalent
231
+ access to copy the source code from the same place counts as
232
+ distribution of the source code, even though third parties are not
233
+ compelled to copy the source along with the object code.
234
+
235
+ 4. You may not copy, modify, sublicense, or distribute the Program
236
+ except as expressly provided under this License. Any attempt
237
+ otherwise to copy, modify, sublicense or distribute the Program is
238
+ void, and will automatically terminate your rights under this License.
239
+ However, parties who have received copies, or rights, from you under
240
+ this License will not have their licenses terminated so long as such
241
+ parties remain in full compliance.
242
+
243
+ 5. You are not required to accept this License, since you have not
244
+ signed it. However, nothing else grants you permission to modify or
245
+ distribute the Program or its derivative works. These actions are
246
+ prohibited by law if you do not accept this License. Therefore, by
247
+ modifying or distributing the Program (or any work based on the
248
+ Program), you indicate your acceptance of this License to do so, and
249
+ all its terms and conditions for copying, distributing or modifying
250
+ the Program or works based on it.
251
+
252
+ 6. Each time you redistribute the Program (or any work based on the
253
+ Program), the recipient automatically receives a license from the
254
+ original licensor to copy, distribute or modify the Program subject to
255
+ these terms and conditions. You may not impose any further
256
+ restrictions on the recipients' exercise of the rights granted herein.
257
+ You are not responsible for enforcing compliance by third parties to
258
+ this License.
259
+
260
+ 7. If, as a consequence of a court judgment or allegation of patent
261
+ infringement or for any other reason (not limited to patent issues),
262
+ conditions are imposed on you (whether by court order, agreement or
263
+ otherwise) that contradict the conditions of this License, they do not
264
+ excuse you from the conditions of this License. If you cannot
265
+ distribute so as to satisfy simultaneously your obligations under this
266
+ License and any other pertinent obligations, then as a consequence you
267
+ may not distribute the Program at all. For example, if a patent
268
+ license would not permit royalty-free redistribution of the Program by
269
+ all those who receive copies directly or indirectly through you, then
270
+ the only way you could satisfy both it and this License would be to
271
+ refrain entirely from distribution of the Program.
272
+
273
+ If any portion of this section is held invalid or unenforceable under
274
+ any particular circumstance, the balance of the section is intended to
275
+ apply and the section as a whole is intended to apply in other
276
+ circumstances.
277
+
278
+ It is not the purpose of this section to induce you to infringe any
279
+ patents or other property right claims or to contest validity of any
280
+ such claims; this section has the sole purpose of protecting the
281
+ integrity of the free software distribution system, which is
282
+ implemented by public license practices. Many people have made
283
+ generous contributions to the wide range of software distributed
284
+ through that system in reliance on consistent application of that
285
+ system; it is up to the author/donor to decide if he or she is willing
286
+ to distribute software through any other system and a licensee cannot
287
+ impose that choice.
288
+
289
+ This section is intended to make thoroughly clear what is believed to
290
+ be a consequence of the rest of this License.
291
+
292
+ 8. If the distribution and/or use of the Program is restricted in
293
+ certain countries either by patents or by copyrighted interfaces, the
294
+ original copyright holder who places the Program under this License
295
+ may add an explicit geographical distribution limitation excluding
296
+ those countries, so that distribution is permitted only in or among
297
+ countries not thus excluded. In such case, this License incorporates
298
+ the limitation as if written in the body of this License.
299
+
300
+ 9. The Free Software Foundation may publish revised and/or new versions
301
+ of the General Public License from time to time. Such new versions will
302
+ be similar in spirit to the present version, but may differ in detail to
303
+ address new problems or concerns.
304
+
305
+ Each version is given a distinguishing version number. If the Program
306
+ specifies a version number of this License which applies to it and "any
307
+ later version", you have the option of following the terms and conditions
308
+ either of that version or of any later version published by the Free
309
+ Software Foundation. If the Program does not specify a version number of
310
+ this License, you may choose any version ever published by the Free Software
311
+ Foundation.
312
+
313
+ 10. If you wish to incorporate parts of the Program into other free
314
+ programs whose distribution conditions are different, write to the author
315
+ to ask for permission. For software which is copyrighted by the Free
316
+ Software Foundation, write to the Free Software Foundation; we sometimes
317
+ make exceptions for this. Our decision will be guided by the two goals
318
+ of preserving the free status of all derivatives of our free software and
319
+ of promoting the sharing and reuse of software generally.
320
+
321
+ NO WARRANTY
322
+
323
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
324
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
325
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
326
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
327
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
328
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
329
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
330
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
331
+ REPAIR OR CORRECTION.
332
+
333
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
334
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
335
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
336
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
337
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
338
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
339
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
340
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
341
+ POSSIBILITY OF SUCH DAMAGES.
342
+
343
+ END OF TERMS AND CONDITIONS
344
+
data/README.txt ADDED
@@ -0,0 +1,10 @@
1
+ == Ruby Ratchets
2
+
3
+ Ratchets is a build tool, like make, ant, maven, rake, rant, et al.
4
+
5
+ Ratchets is designed in such a way as to provided core functionality is a set
6
+ of reusable build libraries. So indifferent to it's build system functionaility,
7
+ one can completely set that aside and just use it as a resource of one's own
8
+ applications. For instance, if you prefere rake as a build tool, you can still
9
+ take advantage of Ratchets' library in your rake tasks.
10
+
data/bin/lt ADDED
@@ -0,0 +1,4 @@
1
+ #! /usr/bin/ruby
2
+
3
+ load 'ratch/cli/lt.rb'
4
+
data/bin/ludo ADDED
@@ -0,0 +1,4 @@
1
+ #! /usr/bin/ruby
2
+
3
+ load 'ratch/cli/ludo.rb'
4
+
data/bin/ratch ADDED
@@ -0,0 +1,8 @@
1
+ #! /usr/bin/ruby
2
+
3
+ require 'ratch/cli/ratch'
4
+
5
+ #load($0 = ARGV.shift)
6
+
7
+ Ratch::RatchCommand.start(ARGV.shift)
8
+
@@ -0,0 +1,224 @@
1
+ #!/usr/bin/env ratch
2
+
3
+ # make a release annoucement
4
+
5
+ # The announce task generates release announcement and
6
+ # optionally emails it via your email provider. (Note
7
+ # that TLS is not yet supported as of Ruby 1.8.4.)
8
+ # Announcements can also have layouts defined by simple
9
+ # templates.
10
+ #
11
+ # Make a release announcement. Generates and can email a release
12
+ # announcements. These are nicely formated message and can
13
+ # email the message to the specified address(es).
14
+ #
15
+ # The following settings apply:
16
+ #
17
+ # title Project title.
18
+ # subtitle Brief one-line description.
19
+ # version Project version.
20
+ # description Long description of project.
21
+ # homepage Project homepage web address.
22
+ # slogan Motto for you project.
23
+ # memo File that contains announcement message.
24
+ # template Custom announcement template file.
25
+ # mail_to Email address(es) to send announcemnt.
26
+ #
27
+ # If <em>mail_to</em> is set then these also apply:
28
+ #
29
+ # from Message FROM address [email].
30
+ # subject Subject of email message ([ANN] title verison).
31
+ # server Email server to route message.
32
+ # port Email server's port.
33
+ # domain Email server's domain name.
34
+ # account Email account name [email].
35
+ # login Login type: plain, cram_md5 or login.
36
+ # secure Uses TLS security, true or false?
37
+ #
38
+ # A template file can be specified that uses "$setting" as
39
+ # substitutes for poject information.
40
+
41
+
42
+ # Default layout of release announcement.
43
+
44
+ DEFAULT_ANNOUNCE_TEMPLATE = <<-END
45
+ $title $version
46
+ $subtitle
47
+ $homepage
48
+
49
+ $summary $description
50
+
51
+ $memo
52
+
53
+ $slogan
54
+ END
55
+
56
+
57
+ config = config_load('announce', 'mail')
58
+
59
+ if projectinfo
60
+ config['from'] ||= projectinfo.email
61
+ config['name'] ||= projectinfo.name
62
+ config['version'] ||= projectinfo.version
63
+ config['title'] ||= projectinfo.title
64
+ config['subtitle'] ||= projectinfo.subtitle
65
+ config['description'] ||= projectinfo.description
66
+ config['homepage'] ||= projectinfo.homepage
67
+ config['download'] ||= projectinfo.download
68
+ config['slogan'] ||= projectinfo.slogan
69
+ end
70
+
71
+ config['subject'] ||= "ANN: #{config['title']}, v#{config['version']}"
72
+ config['account'] ||= config['mail_from']
73
+ #config['mail_to'] = nil if keys['mail_to'].empty?
74
+
75
+ # Generate announcement message.
76
+ title = config['title']
77
+ version = config['version']
78
+ template = config['template']
79
+ memo = config['memo']
80
+
81
+ # Announce template
82
+ unless template
83
+ files = Dir.glob("{ANN,doc/[aA]nn,doc/ANN}{,.txt}")
84
+ template = files.first
85
+ end
86
+ template = File.read(template) if template
87
+ template = template || DEFAULT_ANNOUNCE_TEMPLATE
88
+
89
+ # Announce Memo
90
+ unless memo
91
+ files = Dir.glob("{MEMO,doc/[mM]emo,doc/MEMO}{,.txt}")
92
+ memo = files.first
93
+ end
94
+ memo = File.read(memo).fold(true) if memo
95
+
96
+ # Validate
97
+ raise ArgumentError, "missing title" unless title
98
+ raise ArgumentError, "missing version" unless version
99
+
100
+ # Strip tiny version zero.
101
+ #if keys['version'] =~ /[.].*?[.]/
102
+ # keys['version'] = keys['version'].chomp('.0')
103
+ #end
104
+
105
+ # Make announcement message
106
+ message = template.dup
107
+
108
+ message.gsub!('$memo',memo) if memo # insert memo
109
+ #message.gsub!('$stamp',stamp.to_s) # insert stamp
110
+
111
+ template.scan(/[$].*?\s/m) do |key|
112
+ key = key.strip
113
+ name = key[1..-1]
114
+ value = info.send(name)
115
+ message.gsub!(key, value.to_s.strip)
116
+ end
117
+
118
+ message.gsub!(/(^|[ ])[$].*?(?=[ ]|$)/,'') # remove unused vars
119
+ message.gsub!("\n\n\n","\n") # remove any triple blank lines
120
+ message.rstrip!
121
+
122
+ message = release_announcement(config)
123
+
124
+ puts "\n#{message}\n\n"
125
+
126
+ return unless keys['to']
127
+
128
+ ans = ask("Would you like to email this announcement?", "yN")
129
+ case ans.downcase
130
+ when 'y', 'yes'
131
+ email(message, config)
132
+ end
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+ # keys = {}
145
+ # keys['from'] = info.email
146
+ # keys.update info.gather('mail')
147
+ # keys.update info.gather('announce')
148
+ # keys.update info.select(
149
+ # :project, :version, :title, :subtitle, :description,
150
+ # :homepage, :download, :slogan
151
+ # )
152
+ # keys.update override if override
153
+
154
+
155
+ # # Get password.
156
+ #
157
+ # def password( account )
158
+ # @password || ENV['PASSWORD'] || ask("Password for #{account}: ")
159
+ # end
160
+
161
+
162
+ =begin
163
+ # Name of project (ie. unix name).
164
+ attr_accessor :project
165
+
166
+ # Title of project.
167
+ attr_accessor :title
168
+
169
+ # Subtitle of project.
170
+ attr_accessor :subtitle
171
+
172
+ # Version number of project release.
173
+ attr_accessor :version
174
+
175
+ # Description of project.
176
+ attr_accessor :description
177
+
178
+ # Project's homepage.
179
+ attr_accessor :homepage
180
+
181
+ # URL to download.
182
+ attr_accessor :download
183
+
184
+ # Project slogan.
185
+ attr_accessor :slogan
186
+
187
+ # To email address(es). If this is not set then
188
+ # the announcement is not emailed and instead
189
+ # is only sent to stdout.
190
+ attr_accessor :mail_to
191
+
192
+ # From email address.
193
+ attr_accessor :mail_from
194
+
195
+ # Memo (personalized message for this release)
196
+ attr_accessor :memo
197
+
198
+ # User defined announcement template.
199
+ attr_accessor :template
200
+
201
+ # Subject line (default is "ANN: project version").
202
+ attr_accessor :subject
203
+
204
+ # Email server
205
+ attr_accessor :server
206
+
207
+ # Emails server port (default is usually correct).
208
+ attr_accessor :port
209
+
210
+ # Email account name (defaults to mail_from).
211
+ attr_accessor :account
212
+
213
+ # User domain (not sure why SMTP requires this?)
214
+ attr_accessor :domain
215
+
216
+ # Login type (plain, login)
217
+ attr_accessor :login_type
218
+
219
+ # Use TLS/SSL true or false?
220
+ attr_accessor :secure
221
+
222
+ # Password (deafults to ENV['PASSWORD']
223
+ attr_accessor :password
224
+ =end