reap 0.5.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ANN-0.6.1 +3 -0
- data/Rakefile +19 -0
- data/Reapfile +46 -33
- data/data/site_ruby/reap/template.yaml +94 -0
- data/lib/reap/announce-task.rb +159 -0
- data/lib/reap/chmod-task.rb +82 -0
- data/lib/reap/package-task.rb +165 -0
- data/lib/reap/publish-task.rb +53 -0
- data/lib/reap/rdoc-task.rb +70 -0
- data/lib/reap/reap-all.rb +15 -0
- data/lib/reap/task.rb +177 -118
- data/lib/reap/template-task.rb +40 -0
- data/lib/reap/test-task.rb +159 -0
- data/pub/www/Reapfile +99 -0
- data/pub/www/images/appleboy.jpg +0 -0
- data/pub/www/index.html +49 -5
- data/{doc/files/LICENSE.html → pub/www/rdoc/classes/Reap.html} +32 -33
- data/pub/www/rdoc/classes/Reap/AnnounceTask.html +154 -0
- data/pub/www/rdoc/classes/Reap/AnnounceTask.src/M000031.html +111 -0
- data/pub/www/rdoc/classes/Reap/AnnounceTask.src/M000032.html +46 -0
- data/pub/www/rdoc/classes/Reap/ChmodTask.html +220 -0
- data/pub/www/rdoc/classes/Reap/ChmodTask.src/M000015.html +21 -0
- data/pub/www/rdoc/classes/Reap/ChmodTask.src/M000016.html +21 -0
- data/pub/www/rdoc/classes/Reap/ChmodTask.src/M000017.html +42 -0
- data/pub/www/rdoc/classes/Reap/ChmodTask.src/M000018.html +26 -0
- data/pub/www/rdoc/classes/Reap/PackageTask.html +181 -0
- data/pub/www/rdoc/classes/Reap/PackageTask.src/M000001.html +49 -0
- data/pub/www/rdoc/classes/Reap/PackageTask.src/M000002.html +74 -0
- data/pub/www/rdoc/classes/Reap/PackageTask.src/M000003.html +51 -0
- data/pub/www/rdoc/classes/Reap/PublishTask.html +160 -0
- data/pub/www/rdoc/classes/Reap/PublishTask.src/M000019.html +24 -0
- data/pub/www/rdoc/classes/Reap/PublishTask.src/M000020.html +38 -0
- data/pub/www/rdoc/classes/Reap/RDocTask.html +220 -0
- data/pub/www/rdoc/classes/Reap/RDocTask.src/M000004.html +24 -0
- data/pub/www/rdoc/classes/Reap/RDocTask.src/M000005.html +21 -0
- data/pub/www/rdoc/classes/Reap/RDocTask.src/M000006.html +53 -0
- data/pub/www/rdoc/classes/Reap/Task.html +319 -0
- data/pub/www/rdoc/classes/Reap/Task.src/M000024.html +21 -0
- data/pub/www/rdoc/classes/Reap/Task.src/M000025.html +18 -0
- data/pub/www/rdoc/classes/Reap/Task.src/M000026.html +18 -0
- data/pub/www/rdoc/classes/Reap/Task.src/M000027.html +28 -0
- data/pub/www/rdoc/classes/Reap/Task.src/M000028.html +16 -0
- data/pub/www/rdoc/classes/Reap/Task.src/M000029.html +18 -0
- data/pub/www/rdoc/classes/Reap/Task.src/M000030.html +19 -0
- data/pub/www/rdoc/classes/Reap/TemplateTask.html +182 -0
- data/pub/www/rdoc/classes/Reap/TemplateTask.src/M000021.html +18 -0
- data/pub/www/rdoc/classes/Reap/TemplateTask.src/M000022.html +21 -0
- data/pub/www/rdoc/classes/Reap/TemplateTask.src/M000023.html +34 -0
- data/pub/www/rdoc/classes/Reap/TestTask.html +228 -0
- data/pub/www/rdoc/classes/Reap/TestTask.src/M000007.html +25 -0
- data/pub/www/rdoc/classes/Reap/TestTask.src/M000008.html +21 -0
- data/pub/www/rdoc/classes/Reap/TestTask.src/M000009.html +77 -0
- data/pub/www/rdoc/classes/Reap/TestTask.src/M000010.html +27 -0
- data/pub/www/rdoc/classes/Reap/TestTask.src/M000011.html +36 -0
- data/{doc → pub/www/rdoc}/classes/Reap/TestTask/TestResults.html +23 -55
- data/pub/www/rdoc/classes/Reap/TestTask/TestResults.src/M000012.html +21 -0
- data/pub/www/rdoc/classes/Reap/TestTask/TestResults.src/M000013.html +21 -0
- data/pub/www/rdoc/classes/Reap/TestTask/TestResults.src/M000014.html +23 -0
- data/pub/www/rdoc/created.rid +1 -0
- data/{doc/files/lib/reap/tasks → pub/www/rdoc/files/lib/reap2}/announce-task_rb.html +3 -3
- data/{doc/files/lib/reap/task_rb.html → pub/www/rdoc/files/lib/reap2/chmod-task_rb.html} +5 -5
- data/pub/www/{doc/files/lib/reap/tasks → rdoc/files/lib/reap2}/package-task_rb.html +3 -3
- data/pub/www/{doc/files/lib/reap/template_rb.html → rdoc/files/lib/reap2/publish-task_rb.html} +10 -4
- data/pub/www/{doc/files/lib/reap/task_rb.html → rdoc/files/lib/reap2/rdoc-task_rb.html} +5 -5
- data/pub/www/{doc/files/lib/reap/reap_rb.html → rdoc/files/lib/reap2/reap-all_rb.html} +7 -7
- data/{doc/files/lib/reap/runner_rb.html → pub/www/rdoc/files/lib/reap2/task_rb.html} +7 -8
- data/pub/www/{doc/files/lib/reap/tasks → rdoc/files/lib/reap2}/template-task_rb.html +4 -4
- data/{doc/files/lib/reap/tasks → pub/www/rdoc/files/lib/reap2}/test-task_rb.html +10 -4
- data/{doc → pub/www/rdoc}/fr_class_index.html +0 -1
- data/pub/www/rdoc/fr_file_index.html +35 -0
- data/pub/www/rdoc/fr_method_index.html +58 -0
- data/{doc → pub/www/rdoc}/index.html +1 -1
- data/{doc → pub/www/rdoc}/rdoc-style.css +0 -0
- data/test/tc_reap.rb +11 -0
- metadata +98 -112
- data/bin/reap +0 -103
- data/doc/classes/Reap.html +0 -184
- data/doc/classes/Reap/AnnounceTask.html +0 -339
- data/doc/classes/Reap/ChmodTask.html +0 -277
- data/doc/classes/Reap/PackageTask.html +0 -374
- data/doc/classes/Reap/PublishTask.html +0 -237
- data/doc/classes/Reap/RDocTask.html +0 -254
- data/doc/classes/Reap/Runner.html +0 -299
- data/doc/classes/Reap/Task.html +0 -438
- data/doc/classes/Reap/TemplateTask.html +0 -226
- data/doc/classes/Reap/TestTask.html +0 -354
- data/doc/created.rid +0 -1
- data/doc/files/README.html +0 -194
- data/doc/files/lib/reap/reap_rb.html +0 -111
- data/doc/files/lib/reap/tasks/chmod-task_rb.html +0 -101
- data/doc/files/lib/reap/tasks/package-task_rb.html +0 -108
- data/doc/files/lib/reap/tasks/publish-task_rb.html +0 -101
- data/doc/files/lib/reap/tasks/rdoc-task_rb.html +0 -101
- data/doc/files/lib/reap/tasks/template-task_rb.html +0 -109
- data/doc/fr_file_index.html +0 -38
- data/doc/fr_method_index.html +0 -73
- data/lib/reap/reap.rb +0 -13
- data/lib/reap/runner.rb +0 -90
- data/lib/reap/tasks/announce-task.rb +0 -149
- data/lib/reap/tasks/chmod-task.rb +0 -69
- data/lib/reap/tasks/package-task.rb +0 -157
- data/lib/reap/tasks/publish-task.rb +0 -39
- data/lib/reap/tasks/rdoc-task.rb +0 -55
- data/lib/reap/tasks/template-task.rb +0 -39
- data/lib/reap/tasks/test-task.rb +0 -140
- data/pub/www/doc/classes/Reap.html +0 -184
- data/pub/www/doc/classes/Reap/AnnounceTask.html +0 -331
- data/pub/www/doc/classes/Reap/ChmodTask.html +0 -278
- data/pub/www/doc/classes/Reap/PackageTask.html +0 -372
- data/pub/www/doc/classes/Reap/PublishTask.html +0 -231
- data/pub/www/doc/classes/Reap/RDocTask.html +0 -254
- data/pub/www/doc/classes/Reap/Runner.html +0 -307
- data/pub/www/doc/classes/Reap/Task.html +0 -390
- data/pub/www/doc/classes/Reap/TemplateTask.html +0 -233
- data/pub/www/doc/classes/Reap/TestTask.html +0 -242
- data/pub/www/doc/created.rid +0 -1
- data/pub/www/doc/files/LICENSE.html +0 -119
- data/pub/www/doc/files/README.html +0 -194
- data/pub/www/doc/files/lib/reap/runner_rb.html +0 -113
- data/pub/www/doc/files/lib/reap/tasks/announce-task_rb.html +0 -113
- data/pub/www/doc/files/lib/reap/tasks/chmod-task_rb.html +0 -101
- data/pub/www/doc/files/lib/reap/tasks/publish-task_rb.html +0 -101
- data/pub/www/doc/files/lib/reap/tasks/rdoc-task_rb.html +0 -101
- data/pub/www/doc/files/lib/reap/tasks/test-task_rb.html +0 -101
- data/pub/www/doc/fr_class_index.html +0 -36
- data/pub/www/doc/fr_file_index.html +0 -39
- data/pub/www/doc/fr_method_index.html +0 -69
- data/pub/www/doc/index.html +0 -24
- data/pub/www/doc/rdoc-style.css +0 -208
- data/test/tc_require.rb +0 -11
@@ -1,149 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'net/smtp'
|
3
|
-
|
4
|
-
require 'nano/string/margin'
|
5
|
-
require 'nano/string/tab'
|
6
|
-
require 'nano/string/align_center'
|
7
|
-
require 'nano/string/fold'
|
8
|
-
require 'nano/string/word_wrap'
|
9
|
-
|
10
|
-
module Reap
|
11
|
-
|
12
|
-
class AnnounceTask < Task
|
13
|
-
|
14
|
-
def self.task ; :announce ; end
|
15
|
-
|
16
|
-
def self.desc ; "Sends [ANN] email to ruby-talk or other list." ; end
|
17
|
-
|
18
|
-
|
19
|
-
def setup
|
20
|
-
@address = section['to']
|
21
|
-
@from = section['from'].to_s
|
22
|
-
@server = section['server'].to_s.strip
|
23
|
-
@port = section['port'] || 25
|
24
|
-
@domain = section['domain'].to_s.strip
|
25
|
-
@account = section['account'].to_s
|
26
|
-
@authtype = section['authtype'].to_sym
|
27
|
-
@tls = section['tls'] ? true : false
|
28
|
-
|
29
|
-
@title = master['title']
|
30
|
-
@version = master['version']
|
31
|
-
@summary = master['summary']
|
32
|
-
|
33
|
-
@subject = "[ANN] #{@title}, v#{@version}"
|
34
|
-
|
35
|
-
#raise "DOMAIN is a required field" if @domain.empty?
|
36
|
-
|
37
|
-
# header
|
38
|
-
announce = %Q{
|
39
|
-
|
|
40
|
-
|A N N O U N C I N G
|
41
|
-
|
|
42
|
-
|#{@title}, v#{@version}
|
43
|
-
|
|
44
|
-
|#{@summary}
|
45
|
-
|
|
46
|
-
}.margin.center_lines(66)
|
47
|
-
|
48
|
-
# abstract
|
49
|
-
abstract = ''
|
50
|
-
desc = description
|
51
|
-
if desc
|
52
|
-
abstract << "\n\n"
|
53
|
-
abstract << "ABSTRACT: #{desc}".word_wrap(72)
|
54
|
-
abstract << "\n"
|
55
|
-
end
|
56
|
-
|
57
|
-
# more info
|
58
|
-
info = ''
|
59
|
-
info_arr = section['info']
|
60
|
-
unless info_arr.empty?
|
61
|
-
info << "\n"
|
62
|
-
info << "For More Information".center(67)
|
63
|
-
info << "\n"
|
64
|
-
info_arr.each{ |mi| info << "#{mi}".center(67) }
|
65
|
-
info << "\n\n"
|
66
|
-
end
|
67
|
-
|
68
|
-
# slogan
|
69
|
-
slogan = ''
|
70
|
-
if section['slogan']
|
71
|
-
slogan << "\n\n"
|
72
|
-
slogan << section['slogan'].center(67)
|
73
|
-
slogan << "\n\n"
|
74
|
-
end
|
75
|
-
|
76
|
-
# memo
|
77
|
-
memo = ''
|
78
|
-
if section['memo']
|
79
|
-
memo = ''
|
80
|
-
memo << "\n" << ('-' * 72) << "\n"
|
81
|
-
memo << "(Memo)\n\n"
|
82
|
-
memo << section['memo'].fold.word_wrap(72)
|
83
|
-
#memo << "\n"
|
84
|
-
end
|
85
|
-
|
86
|
-
# msg file
|
87
|
-
msg = ''
|
88
|
-
msg_file = section['file']
|
89
|
-
if msg_file and File.file?( msg_file )
|
90
|
-
msg << "\n" << ("-" * 72) << "\n"
|
91
|
-
msg << "(from #{msg_file})\n\n"
|
92
|
-
mg = ''
|
93
|
-
File.open( msg_file ) { |f| mg << f.gets(nil) }
|
94
|
-
msg << mg.fold.word_wrap(72)
|
95
|
-
end
|
96
|
-
|
97
|
-
# stamp
|
98
|
-
stamp = ''
|
99
|
-
stamp << "\n" << ("-" * 72) << "\n"
|
100
|
-
stamp << %Q{
|
101
|
-
|Generated by Reap, a dedicated Ruby Packaging Assistant.
|
102
|
-
|Do you Ruby? (http://www.ruby-lang.org)
|
103
|
-
}.margin
|
104
|
-
stamp << "\n\n"
|
105
|
-
|
106
|
-
@message = ''
|
107
|
-
@message << announce
|
108
|
-
@message << abstract
|
109
|
-
@message << info
|
110
|
-
@message << slogan
|
111
|
-
@message << memo
|
112
|
-
@message << msg
|
113
|
-
@message << stamp
|
114
|
-
end
|
115
|
-
|
116
|
-
def run
|
117
|
-
puts "\n#{@message}\n\n"
|
118
|
-
print "Send? [Y/n] "
|
119
|
-
until inp = $stdin.gets[0,1] ; sleep 1 ; end
|
120
|
-
if (inp || 'y').downcase == 'y'
|
121
|
-
# ask for password
|
122
|
-
print "Password for #{@account}: "
|
123
|
-
until passwd = $stdin.gets.strip ; sleep 1 ; end
|
124
|
-
mail = %Q{
|
125
|
-
|From: #{@from}
|
126
|
-
|To: #{@address}
|
127
|
-
|Subject: #{@subject}
|
128
|
-
|
|
129
|
-
|#{@message}
|
130
|
-
}.margin
|
131
|
-
begin
|
132
|
-
# --- Send using SMTP object and an adaptor
|
133
|
-
Net::SMTP.enable_tls if Net::SMTP.respond_to?(:enable_tls) and @tls
|
134
|
-
Net::SMTP.start(@server, @port, @domain, @account, passwd, @authtype) do |s|
|
135
|
-
s.send_message mail, @from, @address
|
136
|
-
end
|
137
|
-
puts "Email sent successfully to #{@address}."
|
138
|
-
rescue => e
|
139
|
-
puts "Email delivery failed."
|
140
|
-
puts e
|
141
|
-
end
|
142
|
-
else
|
143
|
-
puts "Reap announce task canceled."
|
144
|
-
exit 0
|
145
|
-
end
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
end #module Reap
|
@@ -1,69 +0,0 @@
|
|
1
|
-
|
2
|
-
module Reap
|
3
|
-
|
4
|
-
class ChmodTask < Task
|
5
|
-
|
6
|
-
def self.task; :chmod ; end
|
7
|
-
def self.desc; "Change the permissions of package files." ; end
|
8
|
-
|
9
|
-
def setup
|
10
|
-
@user = section['user']
|
11
|
-
@group = section['group']
|
12
|
-
end
|
13
|
-
|
14
|
-
def run
|
15
|
-
puts "Reap is shelling out work to chmod..."
|
16
|
-
|
17
|
-
# misc
|
18
|
-
misc = FileList.new
|
19
|
-
misc.include('[A-Z]*')
|
20
|
-
misc.exclude('InstalledFiles')
|
21
|
-
chmod( misc ) unless misc.empty?
|
22
|
-
|
23
|
-
# lib
|
24
|
-
libs = FileList.new
|
25
|
-
libs.include('lib/**/*')
|
26
|
-
libs.exclude('lib/CVS/**/*')
|
27
|
-
libs.include('packages/*/lib/**/*')
|
28
|
-
libs.exclude('packages/*/lib/CVS/**/*')
|
29
|
-
libs.exclude('packages/CVS/**/*')
|
30
|
-
chmod( libs ) unless libs.empty?
|
31
|
-
|
32
|
-
# bin
|
33
|
-
bins = FileList.new
|
34
|
-
bins.include('bin/**/*')
|
35
|
-
bins.exclude('bin/CVS/**/*')
|
36
|
-
bins.include('packages/*/bin/**/*')
|
37
|
-
bins.exclude('packages/*/bin/CVS/**/*')
|
38
|
-
bins.exclude('packages/CVS/**/*')
|
39
|
-
chmod( bins, 755 ) unless bins.empty?
|
40
|
-
end
|
41
|
-
|
42
|
-
private
|
43
|
-
|
44
|
-
def chmod( file_list, file_mode=644, dir_mode=755 )
|
45
|
-
dirs, files = file_list.partition{ |l| File.directory?(l) }
|
46
|
-
unless files.empty?
|
47
|
-
fstr = '"' + files.join('" "') + '"'
|
48
|
-
sh %{chmod #{file_mode} #{fstr}}
|
49
|
-
end
|
50
|
-
unless dirs.empty?
|
51
|
-
fstr = '"' + dirs.join('" "') + '"'
|
52
|
-
sh %{chmod #{dir_mode} #{fstr}}
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
# def chown( file_list, user, group )
|
57
|
-
# fstr = '"' + file_list.join('" "') + '"'
|
58
|
-
# if user
|
59
|
-
# if group
|
60
|
-
# sh %{chown #{user}.#{group} #{fstr}}
|
61
|
-
# else
|
62
|
-
# sh %{chown #{user} #{fstr}}
|
63
|
-
# end
|
64
|
-
# end
|
65
|
-
# end
|
66
|
-
|
67
|
-
end #class ChmodTask
|
68
|
-
|
69
|
-
end #module Reap
|
@@ -1,157 +0,0 @@
|
|
1
|
-
|
2
|
-
begin
|
3
|
-
require 'rubygems'
|
4
|
-
rescue
|
5
|
-
# no rubygems
|
6
|
-
end
|
7
|
-
|
8
|
-
module Reap
|
9
|
-
|
10
|
-
#
|
11
|
-
# Package Task
|
12
|
-
#
|
13
|
-
# This task allows on to create standard .zip, .tgz, or .tbz
|
14
|
-
# packages, plus create gem distributions.
|
15
|
-
#
|
16
|
-
class PackageTask < Task
|
17
|
-
|
18
|
-
def self.task ; :package ; end
|
19
|
-
def self.desc ; "Build standard .tar.gz, .tar.bzip2 and .zip packages." ; end
|
20
|
-
|
21
|
-
def setup
|
22
|
-
@dir = section['dir'] || 'pkg'
|
23
|
-
|
24
|
-
@name = section['name'] || master['name']
|
25
|
-
@version = section['version'] || master['version'] || '0.0.1'
|
26
|
-
@package_name = @name + '-' + @version
|
27
|
-
|
28
|
-
@author = section['author'] || master['author']
|
29
|
-
@email = section['email'] || master['email']
|
30
|
-
@summary = section['summary'] || master['summary']
|
31
|
-
@project = section['project'] || master['rubyforge']['project']
|
32
|
-
@homepage = section['homepage'] || master['homepage'] || master['rubyforge']['homepage']
|
33
|
-
|
34
|
-
@include = section['include'] || DEFAULT_INCLUDE
|
35
|
-
@exclude = MUST_EXCLUDE + section['exclude']
|
36
|
-
|
37
|
-
@zip = section['zip'].nil? ? true : section['zip']
|
38
|
-
@gzip = section['gzip'].nil? ? true : section['zip']
|
39
|
-
@bzip2 = section['bzip2'].nil? ? true : section['zip']
|
40
|
-
@gem = section['gem'].nil? ? true : section['gem']
|
41
|
-
|
42
|
-
# gem specific
|
43
|
-
if defined?(Gem)
|
44
|
-
if self['platform']
|
45
|
-
@platform = ::Gem.const_get(section['platform'])
|
46
|
-
else
|
47
|
-
@platform = ::Gem::Platform::RUBY
|
48
|
-
end
|
49
|
-
@autorequire = section['autorequire']
|
50
|
-
@requirements = section['requirements'] || []
|
51
|
-
@dependencies = section['dependencies'] || []
|
52
|
-
@executables = section['executables'] || []
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def run
|
57
|
-
# create package image
|
58
|
-
if FileTest.directory?(@dir)
|
59
|
-
print "Directory '#{@dir}' already exists. Clobber? [y/N] "
|
60
|
-
until inp = $stdin.gets[0,1] ; sleep 1 ; end
|
61
|
-
if (inp || 'y').downcase == 'y'
|
62
|
-
puts "Removing old directory '#{File.expand_path(@dir)}'..."
|
63
|
-
trash_dir = ".trash/#{File.basename(@dir)}"
|
64
|
-
FileUtils.mkdir_p(".trash") unless FileTest.directory?(".trash")
|
65
|
-
FileUtils.rm_r(trash_dir) if FileTest.exists?(trash_dir)
|
66
|
-
FileUtils.mv(@dir, trash_dir)
|
67
|
-
else
|
68
|
-
puts "Reap package task canceled."
|
69
|
-
exit 0
|
70
|
-
end
|
71
|
-
end
|
72
|
-
package_dir_path = "#{@dir}/#{@package_name}"
|
73
|
-
package_files = FileList.new
|
74
|
-
package_files.include(*@include)
|
75
|
-
package_files.exclude(*@exclude) if @exclude and not @exclude.empty?
|
76
|
-
FileUtils.mkdir_p @dir #rescue nil
|
77
|
-
package_files.each do |fn|
|
78
|
-
f = File.join(package_dir_path, fn)
|
79
|
-
fdir = File.dirname(f)
|
80
|
-
FileUtils.mkdir_p(fdir) if not File.exist?(fdir)
|
81
|
-
if File.directory?(fn)
|
82
|
-
FileUtils.mkdir_p(f)
|
83
|
-
else
|
84
|
-
FileUtils.rm_f(f)
|
85
|
-
FileUtils.safe_ln(fn, f)
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
# create standard package files
|
90
|
-
FileUtils.chdir(@dir) do
|
91
|
-
# tar bzip2 for unix
|
92
|
-
if @bzip2
|
93
|
-
puts "\nReap is shelling out work to tar and bzip2..."
|
94
|
-
sh %{tar --bzip2 -cvf #{@package_name}.tbz #{@package_name}}
|
95
|
-
end
|
96
|
-
# tar gzip for unix
|
97
|
-
if @gzip
|
98
|
-
puts "\nReap is shelling out work to tar and gzip..."
|
99
|
-
sh %{tar --gzip -cvf #{@package_name}.tgz #{@package_name}}
|
100
|
-
end
|
101
|
-
# zip for windows
|
102
|
-
if @zip
|
103
|
-
puts "\nReap is shelling out work to zip..."
|
104
|
-
sh %{zip -r #{@package_name}.zip #{@package_name}}
|
105
|
-
end
|
106
|
-
puts
|
107
|
-
end
|
108
|
-
|
109
|
-
# create gem package
|
110
|
-
if defined?(Gem) and @gem
|
111
|
-
run_gem
|
112
|
-
end
|
113
|
-
return true
|
114
|
-
end
|
115
|
-
|
116
|
-
private
|
117
|
-
|
118
|
-
def run_gem
|
119
|
-
spec = Gem::Specification.new { |s|
|
120
|
-
s.name = @name
|
121
|
-
s.version = @version
|
122
|
-
@dependencies.each{ |d,v|
|
123
|
-
if v
|
124
|
-
s.add_dependency(d, v)
|
125
|
-
else
|
126
|
-
s.add_dependency(d)
|
127
|
-
end
|
128
|
-
}
|
129
|
-
s.platform = @platform
|
130
|
-
s.summary = @summary
|
131
|
-
s.requirements = @requirements
|
132
|
-
|
133
|
-
# s.files = Dir.glob("lib/**/*").delete_if {|item| item.include?("CVS")}
|
134
|
-
# s.files.concat Dir.glob("bin/**/*").delete_if {|item| item.include?("CVS")}
|
135
|
-
package_files = FileList.new
|
136
|
-
package_files.include(*@include)
|
137
|
-
package_files.exclude(*@exclude) if @exclude and not @exclude.empty?
|
138
|
-
s.files = package_files.to_a
|
139
|
-
|
140
|
-
s.require_path = 'lib'
|
141
|
-
s.autorequire = @autorequire if @autorequire
|
142
|
-
s.author = @author
|
143
|
-
s.email = @email
|
144
|
-
s.rubyforge_project = @project
|
145
|
-
s.homepage = @homepage
|
146
|
-
s.executables = @executables
|
147
|
-
s.bindir = "bin"
|
148
|
-
}
|
149
|
-
puts "Reap is shelling out work to the Gem Package Manager..."
|
150
|
-
Gem.manage_gems
|
151
|
-
Gem::Builder.new(spec).build
|
152
|
-
sh %{mv ./*.gem #{@dir}/}
|
153
|
-
end
|
154
|
-
|
155
|
-
end #class PackageTask
|
156
|
-
|
157
|
-
end #module Reap
|
@@ -1,39 +0,0 @@
|
|
1
|
-
|
2
|
-
module Reap
|
3
|
-
|
4
|
-
class PublishTask < Task
|
5
|
-
|
6
|
-
def self.task ; :publish ; end
|
7
|
-
def self.desc ; "Publish documents to the web." ; end
|
8
|
-
|
9
|
-
|
10
|
-
def setup
|
11
|
-
@host = section['host'].to_s.downcase || 'rubyforge'
|
12
|
-
@type = (section['type'] || 'www').to_s.downcase
|
13
|
-
@command = section['command']
|
14
|
-
@dir = section['dir']
|
15
|
-
#@exclude = section['exclude']
|
16
|
-
@project = section['project']
|
17
|
-
@username = section['username']
|
18
|
-
end
|
19
|
-
|
20
|
-
def run
|
21
|
-
case @host
|
22
|
-
when 'rubyforge'
|
23
|
-
case @type
|
24
|
-
when 'www', 'web'
|
25
|
-
cmd = %{scp -r #{@dir}/* #{@username}@rubyforge.org:/var/www/gforge-projects/#{@project}/}
|
26
|
-
else
|
27
|
-
puts %{Unrecognized publishing type '#{@type}' for host '#{@host}'.}
|
28
|
-
end
|
29
|
-
else
|
30
|
-
puts %{Unrecognized publishing host '#{@host}'.}
|
31
|
-
end
|
32
|
-
puts "Reap is shelling out publishing work..."
|
33
|
-
puts cmd
|
34
|
-
sh(cmd) unless $PRETEND
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
data/lib/reap/tasks/rdoc-task.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
|
2
|
-
module Reap
|
3
|
-
|
4
|
-
class RDocTask < Task
|
5
|
-
|
6
|
-
def self.task; :rdoc ; end
|
7
|
-
def self.desc ; "Generate RDocs." ; end
|
8
|
-
|
9
|
-
def setup
|
10
|
-
@dir = section["dir"] || 'doc'
|
11
|
-
@main = section["main"]
|
12
|
-
@title = section["title"] || master["title"]
|
13
|
-
@template = section["template"] || 'html'
|
14
|
-
@include = section["include"] || ['lib/**/*']
|
15
|
-
@exclude = section["exclude"]
|
16
|
-
@options = section["options"] || []
|
17
|
-
end
|
18
|
-
|
19
|
-
def run
|
20
|
-
rdoc_dir = File.expand_path(@dir)
|
21
|
-
if FileTest.directory?(@dir)
|
22
|
-
print "Directory '#{@dir}' already exists. Clobber? [y/N] "
|
23
|
-
until inp = $stdin.gets[0,1] ; sleep 1 ; end ; puts
|
24
|
-
if (inp || 'y').downcase == 'y'
|
25
|
-
puts "Removing old directory '#{rdoc_dir}'..."
|
26
|
-
trash_dir = ".trash/#{File.basename(@dir)}"
|
27
|
-
FileUtils.mkdir_p(".trash") unless FileTest.directory?(".trash")
|
28
|
-
FileUtils.rm_r(trash_dir) if FileTest.exists?(trash_dir)
|
29
|
-
FileUtils.mv(@dir, trash_dir)
|
30
|
-
else
|
31
|
-
puts "Reap rdoc task canceled."
|
32
|
-
return nil
|
33
|
-
end
|
34
|
-
end
|
35
|
-
rdoc_target = "#{rdoc_dir}/index.html"
|
36
|
-
# rdoc files
|
37
|
-
rdoc_files = FileList.new
|
38
|
-
rdoc_files.include(*@include)
|
39
|
-
rdoc_files.exclude(*@exclude)
|
40
|
-
rdoc_files = '"' << rdoc_files.join('" "') << '"'
|
41
|
-
# build options string
|
42
|
-
build = @options.dup
|
43
|
-
build << "--main '#{@main}'" if @main
|
44
|
-
build << "--title '#{@title}'" if @title
|
45
|
-
build << "-T '#{@template}'" if @template
|
46
|
-
rdoc_opts = build.join(' ')
|
47
|
-
# do it!
|
48
|
-
puts "Reap is shelling work out to RDoc..."
|
49
|
-
puts %{rdoc -o #{@dir} #{rdoc_opts}}
|
50
|
-
sh %{rdoc -o #{rdoc_dir} #{rdoc_opts} #{rdoc_files}}
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
end #module Reap
|