reap 4.3.4 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,12 +8,25 @@ require 'reap/task'
8
8
  #
9
9
 
10
10
  # = RDoc Task
11
+ #
12
+ # This task generates RDoc API documentation trom source
13
+ # comments.
14
+ #
15
+ # rdoc:
16
+ # dir Directory to store documentation [doc].
17
+ # main File to use as main page of RDocs.
18
+ # title Project title to use in RDocs.
19
+ # template Which RDoc template to use.
20
+ # include Files to include in RDocs.
21
+ # exclude Files to exclude from those.
22
+ # options Pass-thru extra options to RDoc command.
23
+ #
11
24
 
12
25
  class Reap::RDoc < Reap::Task
13
26
 
14
27
  MUST_EXCLUDE = [ 'InstalledFiles', 'CVS/**/*' ]
15
28
 
16
- task_desc "Generate RDocs."
29
+ task_desc "Generate RDoc API documentation."
17
30
 
18
31
  task_help %{
19
32
 
@@ -31,11 +44,12 @@ class Reap::RDoc < Reap::Task
31
44
 
32
45
  }
33
46
 
34
- task_attr :doc
47
+ alias_method :doc, :task
35
48
 
36
- # Setup documentation task.
49
+ def run
50
+
51
+ # setup
37
52
 
38
- def init
39
53
  doc.dir ||= 'doc'
40
54
  doc.main ||= 'README'
41
55
  doc.title ||= master.title
@@ -43,12 +57,12 @@ class Reap::RDoc < Reap::Task
43
57
  doc.include ||= [ 'A-Z*', 'lib/**/*', 'ext/**/*' ]
44
58
  doc.exclude ||= [ 'demo/**/*', 'example/**/*', 'sample/**/*' ]
45
59
  doc.options ||= ['--merge', '--all']
46
- end
47
60
 
48
- # Run the Ruby documentation task.
61
+ doc.include = [ doc.include ].flatten
62
+ doc.exclude = [ doc.exclude ].flatten
63
+ doc.options = [ doc.options ].flatten
49
64
 
50
- def run
51
- #must_exclude = [ 'InstalledFiles', 'CVS/**/*' ]
65
+ # document
52
66
 
53
67
  if !File.exists?(doc.main) or File.directory?(doc.main)
54
68
  warn "WARNING! Specified RDoc Main file #{doc.main} not found."
@@ -58,17 +72,15 @@ class Reap::RDoc < Reap::Task
58
72
  rdoc_dir = File.expand_path(doc.dir)
59
73
 
60
74
  if FileTest.directory?(doc.dir)
61
- print "Directory '#{doc.dir}' already exists. Clobber? [y/N] "
62
- until inp = $stdin.gets[0,1] ; sleep 1 ; end ; puts
63
- if (inp || 'y').downcase == 'y'
64
- puts "Removing old directory '#{rdoc_dir}'..."
65
- #FileUtils.mkdir_p(".trash") unless FileTest.directory?(".trash")
66
- #trashdir = ".trash/#{File.basename(doc.dir)}"
67
- #FileUtils.rm_r(trashdir) if FileTest.exists?(trashdir)
68
- #FileUtils.mv(doc.dir, trashdir)
75
+ q = "Directory '#{doc.dir}' already exists. Clobber?"
76
+ #until inp = $stdin.gets[0,1] ; sleep 1 ; end ; puts
77
+ inp = ask( q, 'yN' )
78
+ case inp.downcase
79
+ when 'y', 'yes', 'okay'
80
+ tell "Removing old directory '#{rdoc_dir}'..."
69
81
  FileUtils.rm_r(doc.dir) unless $PRETEND
70
82
  else
71
- puts "Reap rdoc task canceled."
83
+ tell "Reap rdoc task canceled."
72
84
  return nil
73
85
  end
74
86
  end
@@ -99,7 +111,7 @@ class Reap::RDoc < Reap::Task
99
111
  rdoc_opts = build.join(' ')
100
112
 
101
113
  # do it!
102
- puts "Reap is shelling work out to RDoc..."
114
+ tell "Reap is shelling work out to RDoc..."
103
115
  sh %{rdoc -o #{rdoc_dir} #{rdoc_opts} #{rdoc_files}}
104
116
  end
105
117
 
@@ -92,16 +92,11 @@ class Reap::Release < Reap::Task
92
92
 
93
93
  }
94
94
 
95
- task_attr :rel
95
+ alias_method :rel, :task
96
96
 
97
- #attr_accessor :project, :version
98
- #attr_accessor :host, :username, :password
99
- #attr_accessor :package, :packageid, :groupid, :private, :processor
100
- #attr_accessor :name, :changes, :notes, :changelog, :notelog
101
- #attr_accessor :cookiejar
97
+ def run
102
98
 
103
- def init
104
- #rel.version ||= master.date
99
+ # setup
105
100
 
106
101
  rel.host ||= 'rubyforge.org'
107
102
  rel.host.chomp!('/')
@@ -126,14 +121,12 @@ class Reap::Release < Reap::Task
126
121
 
127
122
  rel.cookie_jar ||= File::join(File::expand_path("~"), ".rubyforge.cookie_jar")
128
123
 
129
- # Do not inherit
124
+ # do not inherit these
125
+
130
126
  rel.dir = section.dir || master.project.dir
131
127
  rel.release = section.release || master.version || rel.date
132
- end
133
-
134
- # Run release task.
135
128
 
136
- def run
129
+ # verify
137
130
 
138
131
  abort "missing field -- package" unless rel.package
139
132
  #abort "missing field -- packageid" unless rel.packageid
@@ -147,6 +140,8 @@ class Reap::Release < Reap::Task
147
140
  # skip = true
148
141
  # end
149
142
 
143
+ # release
144
+
150
145
  puts "Reap is preparing release ..."
151
146
 
152
147
  rtypes = [ 'tgz', 'tbz', 'tar.gz', 'tar.bz2', 'deb', 'gem', 'ebuild' ]
@@ -185,12 +180,16 @@ class Reap::Release < Reap::Task
185
180
  end
186
181
 
187
182
  if release?
188
- puts "Release (#{rel.release}) already exists."
189
- puts "Use -f option to force re-release."
190
- exit 0 unless $FORCE
183
+ unless $FORCE
184
+ puts "Release (#{rel.release}) already exists."
185
+ puts "Use -f option to force re-release."
186
+ exit 0
187
+ end
191
188
  files.each do |f|
192
189
  remove_file( f ) if file?( f )
190
+ puts "Removed old file -- #{ f }"
193
191
  add_file( f )
192
+ puts "Added new file -- #{ f }"
194
193
  end
195
194
  else
196
195
  add_release( files.first )
@@ -6,6 +6,8 @@ require 'reap/task'
6
6
  require 'test/unit/ui/testrunnermediator'
7
7
  require 'facet/string/tabto'
8
8
 
9
+ require 'facet/progressbar'
10
+
9
11
  Test::Unit.run = true # don't run auto tests
10
12
 
11
13
  # _____ _ _____ _
@@ -49,13 +51,15 @@ class Reap::Test < Reap::Task
49
51
 
50
52
  }
51
53
 
52
- task_attr :tst
54
+ alias_method :tst, :task
55
+
56
+
57
+ # Run testing task.
53
58
 
54
- #attr_accessor :files, :requires, :live, :libs
59
+ def run
55
60
 
56
- # Setup testing task.
61
+ # setup
57
62
 
58
- def init
59
63
  tst.files ||= [ 'test/*/**/*.rb', 'test/**/tc*.rb', 'test/**/test*.rb', 'test/**/*test.rb' ]
60
64
  tst.requires ||= []
61
65
 
@@ -63,29 +67,32 @@ class Reap::Test < Reap::Task
63
67
  tst.libs ||= [] #['./lib']
64
68
 
65
69
  # interal use
70
+
66
71
  @results = TestResults.new
67
72
  @errors = []
68
73
  @failures = []
69
- end
70
-
71
- # Run testing task.
72
-
73
- def run
74
74
 
75
75
  # Get test files
76
+
76
77
  test_libs = tst.libs.join(':')
77
78
  test_files = FileList.new
78
79
  test_files.include(*tst.files)
80
+ test_files.uniq!
81
+
79
82
  if test_files.empty?
80
- puts "No test files found."
83
+ tell "No test files found."
81
84
  return
82
85
  end
83
- print "Reap is shelling out work to Ruby's Test Suite...\n"
86
+
87
+ #tell "Reap is shelling out work to Ruby's Test Suite..."
88
+
89
+ pbar = Console::ProgressBar.new( 'Testing', test_files.size )
84
90
 
85
91
  # Run tests
86
92
  # (why arn't these unique to begin with?)
87
- test_files.uniq.each do |test_file|
88
- $stdout << '.'; $stdout.flush
93
+ test_files.each do |test_file|
94
+ pbar.inc
95
+ #$stdout << '.'; $stdout.flush
89
96
 
90
97
  if ! File.file?( test_file )
91
98
  r = nil
@@ -100,7 +107,8 @@ class Reap::Test < Reap::Task
100
107
 
101
108
  #ruby %{-r"test/unit" "#{f}"}
102
109
  end
103
- puts "done."
110
+
111
+ pbar.finish
104
112
 
105
113
  # Don't know why empty arrays get in them yet, but...
106
114
  @failures.reject! { |e| e == [] }
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: reap
5
5
  version: !ruby/object:Gem::Version
6
- version: 4.3.4
7
- date: 2006-04-07 00:00:00 -04:00
6
+ version: 4.4.0
7
+ date: 2006-04-20 00:00:00 -04:00
8
8
  summary: Tools for Ruby project testing, management and assistance.
9
9
  require_paths:
10
10
  - lib
@@ -29,10 +29,12 @@ authors:
29
29
  - Thomas Sawyer
30
30
  files:
31
31
  - bin
32
+ - Rakefile
32
33
  - doc
33
34
  - data
34
35
  - lib
35
36
  - test
37
+ - MANIFEST
36
38
  - COPYING
37
39
  - ProjectInfo
38
40
  - setup.rb
@@ -44,6 +46,7 @@ files:
44
46
  - doc/ChangeLog
45
47
  - doc/note
46
48
  - doc/doap.xml
49
+ - doc/LATEST
47
50
  - doc/note/setup.rb
48
51
  - doc/note/license-each.rb
49
52
  - doc/note/sshpublisher.rb
@@ -66,10 +69,10 @@ files:
66
69
  - data/reap/setup.rb
67
70
  - data/reap/scaffold/subversion
68
71
  - data/reap/scaffold/standard
72
+ - data/reap/scaffold/subversion/branches
69
73
  - data/reap/scaffold/subversion/trunk
70
- - data/reap/scaffold/subversion/tag
71
- - data/reap/scaffold/subversion/branch
72
- - data/reap/scaffold/subversion/package
74
+ - data/reap/scaffold/subversion/tags
75
+ - data/reap/scaffold/subversion/packages
73
76
  - data/reap/scaffold/subversion/trunk/bin
74
77
  - data/reap/scaffold/subversion/trunk/doc
75
78
  - data/reap/scaffold/subversion/trunk/ext
@@ -81,6 +84,7 @@ files:
81
84
  - data/reap/scaffold/subversion/trunk/ProjectInfo
82
85
  - data/reap/scaffold/subversion/trunk/Rakefile
83
86
  - data/reap/scaffold/subversion/trunk/README
87
+ - data/reap/scaffold/subversion/trunk/setup.rb
84
88
  - data/reap/scaffold/subversion/trunk/TODO
85
89
  - data/reap/scaffold/subversion/trunk/doc/note
86
90
  - data/reap/scaffold/subversion/trunk/doc/api
@@ -95,6 +99,7 @@ files:
95
99
  - data/reap/scaffold/standard/doc
96
100
  - data/reap/scaffold/standard/bin
97
101
  - data/reap/scaffold/standard/ext
102
+ - data/reap/scaffold/standard/setup.rb
98
103
  - data/reap/scaffold/standard/test
99
104
  - data/reap/scaffold/standard/doc/note
100
105
  - data/reap/scaffold/standard/doc/api
@@ -105,15 +110,18 @@ files:
105
110
  - lib/reap/vendor
106
111
  - lib/reap/task.rb
107
112
  - lib/reap/reap.rb
113
+ - lib/reap/rake.rb
114
+ - lib/reap/rake
108
115
  - lib/reap/bin/reap.rb
109
116
  - lib/reap/bin/rubytest.rb
110
117
  - lib/reap/bin/rubylint.rb
111
118
  - lib/reap/task/rdoc.rb
112
119
  - lib/reap/task/release.rb
113
120
  - lib/reap/task/announce.rb
114
- - lib/reap/task/testext.rb
121
+ - lib/reap/task/manifest.rb
115
122
  - lib/reap/task/install.rb
116
123
  - lib/reap/task/test.rb
124
+ - lib/reap/task/extest.rb
117
125
  - lib/reap/task/noop.rb
118
126
  - lib/reap/task/fileperm.rb
119
127
  - lib/reap/task/package.rb
@@ -124,6 +132,18 @@ files:
124
132
  - lib/reap/vendor/http-access2.rb
125
133
  - lib/reap/vendor/http-access2/cookie.rb
126
134
  - lib/reap/vendor/http-access2/http.rb
135
+ - lib/reap/rake/info.rb
136
+ - lib/reap/rake/package.rb
137
+ - lib/reap/rake/announce.rb
138
+ - lib/reap/rake/release.rb
139
+ - lib/reap/rake/adapter.rb
140
+ - lib/reap/rake/extest.rb
141
+ - lib/reap/rake/test.rb
142
+ - lib/reap/rake/publish.rb
143
+ - lib/reap/rake/rdoc.rb
144
+ - lib/reap/rake/install.rb
145
+ - lib/reap/rake/doap.rb
146
+ - lib/reap/rake/manifest.rb
127
147
  - test/tc_reap.rb
128
148
  test_files: []
129
149