reap 9.2.1 → 9.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. data/CHANGES +4 -0
  2. data/COPYING +675 -674
  3. data/MANIFEST +37 -44
  4. data/NOTES +4 -4
  5. data/Rakefile +1486 -0
  6. data/data/reap/base/COPYING +674 -674
  7. data/data/reap/base/README +23 -2
  8. data/data/reap/base/Rakefile +1486 -0
  9. data/data/reap/base/test/template.rb +16 -0
  10. data/data/reap/init/meta/project.yaml +19 -14
  11. data/lib/reap/default.yaml +57 -45
  12. data/lib/reap/extensions/file.rb +8 -0
  13. data/lib/reap/extensions/net/smtp_tls.rb +108 -0
  14. data/lib/reap/extensions.rb +2 -0
  15. data/lib/reap/metadata.rb +3 -2
  16. data/lib/reap/{manager → project}/announce.rb +3 -3
  17. data/lib/reap/{manager → project}/check.rb +1 -1
  18. data/lib/reap/{manager → project}/clean.rb +1 -1
  19. data/lib/reap/{manager → project}/gem.rb +5 -5
  20. data/lib/reap/{manager → project}/html.rb +25 -24
  21. data/lib/reap/{manager → project}/log.rb +19 -9
  22. data/lib/reap/{manager → project}/make.rb +29 -36
  23. data/lib/reap/{manager → project}/package.rb +4 -8
  24. data/lib/reap/{manager → project}/publish.rb +3 -3
  25. data/lib/reap/{manager → project}/rdoc.rb +13 -30
  26. data/lib/reap/{manager → project}/release.rb +5 -5
  27. data/lib/reap/{manager → project}/rubyforge.rb +7 -6
  28. data/lib/reap/{manager → project}/scaffold.rb +7 -2
  29. data/lib/reap/{manager → project}/scm.rb +3 -3
  30. data/lib/reap/{manager → project}/site.rb +1 -1
  31. data/lib/reap/{manager → project}/spec.rb +1 -1
  32. data/lib/reap/{manager → project}/stamp.rb +14 -11
  33. data/lib/reap/{manager → project}/stats.rb +1 -1
  34. data/lib/reap/{manager → project}/svn.rb +1 -1
  35. data/lib/reap/{manager → project}/test.rb +2 -20
  36. data/lib/reap/project.rb +34 -2
  37. data/lib/reap/systems/rubyforge.rb +5 -12
  38. data/lib/reap/systems/subversion.rb +4 -6
  39. data/lib/reap/{utilities/fileutils.rb → utilities.rb} +148 -60
  40. data/log/Changelog.txt +118 -0
  41. data/log/Fixme.txt +26 -0
  42. data/log/Todo.txt +94 -0
  43. data/meta/VERSION +1 -1
  44. data/meta/project.yaml +1 -1
  45. data/meta/unixname +1 -0
  46. data/test/unit/lib/reap/extensions/test_array.rb +12 -0
  47. metadata +44 -46
  48. data/data/reap/build/rake/Rakefile +0 -130
  49. data/data/reap/build/rake/setup.rb +0 -1616
  50. data/data/reap/build/rake-lite/install.rb +0 -79
  51. data/data/reap/build/tasks/task/rdoc +0 -211
  52. data/data/reap/build/tasks/task/setup +0 -1616
  53. data/data/reap/build/tasks/task/test +0 -38
  54. data/lib/reap/manager.rb +0 -75
  55. data/lib/reap/utilities/netutils.rb +0 -221
  56. data/lib/reap/utilities/setuputils.rb +0 -124
  57. data/lib/reap/utilities/shellutils.rb +0 -175
  58. data/log/FIXME.txt +0 -25
  59. data/log/TODO.txt +0 -72
  60. data/task/man +0 -14
  61. data/task/rdoc +0 -20
  62. data/task/setup +0 -1616
@@ -1,8 +1,8 @@
1
- require 'reap/manager/gem'
1
+ require 'reap/project/gem'
2
2
 
3
3
  module Reap
4
4
 
5
- class Manager
5
+ class Project
6
6
 
7
7
  # Remove packages.
8
8
 
@@ -38,10 +38,10 @@ module Reap
38
38
  formats = packopts['formats'] || ['zip']
39
39
  formats = [formats].flatten
40
40
 
41
- puts
41
+ puts unless dryrun?
42
42
  formats.each do |format|
43
43
  send("package_#{format}", options)
44
- puts
44
+ puts unless dryrun?
45
45
  end
46
46
  end
47
47
 
@@ -54,8 +54,6 @@ module Reap
54
54
  # Create a Tar'd Gzip package.
55
55
 
56
56
  def package_tgz(options=nil)
57
- status "Creating .tgz package"
58
-
59
57
  options = configure_options(options, 'package-tgz', 'package')
60
58
 
61
59
  prepare(options)
@@ -97,8 +95,6 @@ module Reap
97
95
  # Create Zip package.
98
96
 
99
97
  def package_zip(options=nil)
100
- status "Creating .zip package"
101
-
102
98
  options = configure_options(options, 'package-zip', 'package')
103
99
 
104
100
  prepare(options)
@@ -1,6 +1,6 @@
1
1
  module Reap
2
2
 
3
- class Manager
3
+ class Project
4
4
 
5
5
  # Publish website to rubyforge.
6
6
  #
@@ -14,10 +14,10 @@ module Reap
14
14
  def publish(options=nil)
15
15
  options = configure_options(options, 'publish', 'rubyforge')
16
16
 
17
- project = options['project'] || metadata.project
17
+ project = options['project'] || metadata.project
18
18
  webdir = options['webdir']
19
19
  source = options['source']
20
- username = options['username']
20
+ username = options['username'] || ENV['RUBYFORGE_USERNAME']
21
21
  clear = options['clear']
22
22
  protect = options['protect']
23
23
  exclude = options['exclude']
@@ -1,6 +1,6 @@
1
1
  module Reap
2
2
 
3
- class Manager
3
+ class Project
4
4
 
5
5
  # Generate documentation. At this time it simply
6
6
  # means generating rdocs.
@@ -46,19 +46,23 @@ module Reap
46
46
  cmdopts['template'] = target['template']
47
47
  cmdopts['merge'] = target['merge']
48
48
  cmdopts['inline-source'] = target['inline']
49
- cmdopts['exclude'] = target['exclude']
49
+ cmdopts['exclude'] = list_option(target['exclude'])
50
50
 
51
- files = target['include']
52
- folder = target['chdir'] || '.'
51
+ files = list_option(target['include'])
52
+ files = files.collect{ |g| Dir[g] }.flatten # Need this little rig to remove unwanted toplevel files.
53
+ files = files - ['Rakefile', 'Rakefile.rb'] # b/c rdoc's exlcude options doesn't work well.
54
+ files = files - [manifest_file].compact
55
+
56
+ #folder = target['chdir'] || '.'
53
57
 
54
58
  #puts "cd #{folder}" if dryrun? # TODO: Shouldn't chdir do this automatically?
55
59
  #chdir(folder) do
56
60
  if target_solo
57
- input_files = files.collect{ |i| multiglob_r(i) }.flatten.reject{ |f| dir?(f) }
61
+ input_files = files.collect{ |i| multiglob_r(i) }.flatten.reject{ |f| File.directory?(f) }
58
62
  input_files.each do |input_file|
59
63
  out = File.join(target_output, File.basename(input_file).chomp(File.extname(input_file)))
60
64
  rdoc_target(out, input_file, cmdopts)
61
- rdoc_insert_ads(target_output, adfile)
65
+ rdoc_insert_ads(out, adfile)
62
66
  end
63
67
  else
64
68
  input_files = files.collect{ |i| dir?(i) ? File.join(i,'**','*') : i }
@@ -107,24 +111,17 @@ module Reap
107
111
  dirs.each do |dir|
108
112
  files = Dir.glob(File.join(dir, '**/*.html'))
109
113
  files.each do |file|
110
- html = file_read(file)
114
+ html = File.read(file)
111
115
  bodi = html.index('<body>')
116
+ next unless bodi
112
117
  html[bodi + 7] = "\n" + adtext
113
- #print "Augmenting #{file}..."
114
- file_write(file, html) unless dryrun?
115
- #puts "[done]"
118
+ File.write(file, html) unless dryrun?
116
119
  end
117
120
  end
118
121
  end
119
122
 
120
123
  public
121
124
 
122
- DEFAULT['ri'] = {
123
- 'output' => 'ri',
124
- 'exclude' => [],
125
- 'include' => ['lib']
126
- }
127
-
128
125
  # generate local ri docs
129
126
  #
130
127
  # Generate RI documentation. This utilizes
@@ -169,20 +166,6 @@ module Reap
169
166
  end
170
167
  end
171
168
 
172
- private
173
-
174
- # # Shell out to rdoc to create ri docs.
175
- #
176
- # def ridoc_shell(files, config)
177
- # output = config['op']
178
- # input = config.delete('include')
179
- #
180
- # # Check for 'doc' directory.
181
- # # (Helps to ensure we're in the right place.)
182
- # #dir!(File.dirname(site))
183
- #
184
- # end
185
-
186
169
  end
187
170
 
188
171
  end
@@ -1,8 +1,8 @@
1
- require 'reap/manager/rubyforge'
1
+ require 'reap/project/rubyforge'
2
2
 
3
3
  module Reap
4
4
 
5
- class Manager
5
+ class Project
6
6
 
7
7
  # Release packages (to rubyforge). This generates
8
8
  # the packages, and then distributes them to the
@@ -23,9 +23,9 @@ module Reap
23
23
  doc, pub, ann, tag = true, true, true, true
24
24
  else
25
25
  doc = ask("Generate doumentation?", "Yn").downcase =~ /^(|y|yes)$/i
26
- pub = ask("Publish website?", "Yn") =~ /^(|y|yes)$/i
27
- tag = ask("Tag current version?", "Yn") =~ /^(|y|yes)$/i
28
- ann = ask("Announce release?", "Yn") =~ /^(|y|yes)$/i
26
+ pub = ask("Publish website? ", "Yn") =~ /^(|y|yes)$/i
27
+ tag = ask("Tag current version? ", "Yn") =~ /^(|y|yes)$/i
28
+ ann = ask("Announce release? ", "Yn") =~ /^(|y|yes)$/i
29
29
  puts
30
30
  end
31
31
 
@@ -2,7 +2,7 @@ require 'reap/systems/rubyforge'
2
2
 
3
3
  module Reap
4
4
 
5
- class Manager
5
+ class Project
6
6
 
7
7
  # Returns Rubyforge system object.
8
8
 
@@ -12,9 +12,9 @@ module Reap
12
12
  rubyforge_options = {}
13
13
  rubyforge_options[:dryrun] = dryrun?
14
14
  rubyforge_options[:trace] = trace?
15
- rubyforge_options[:project] = options.delete('project') || metadata.project
16
- rubyforge_options[:username] = options.delete('username') || ENV['RUBYFORGE_USERNAME']
17
- rubyforge_options[:group_id] = options.delete('group')
15
+ rubyforge_options[:project] = options['project'] || metadata.project
16
+ rubyforge_options[:username] = options['username'] || ENV['RUBYFORGE_USERNAME']
17
+ rubyforge_options[:group_id] = options['group']
18
18
 
19
19
  Rubyforge.new(rubyforge_options)
20
20
  end
@@ -49,9 +49,10 @@ module Reap
49
49
  #files = Dir.glob(File.join(store,"#{name}-#{version}*"))
50
50
  end
51
51
 
52
- if dryrun? # Not going to do dryrun in Rubyforge class b/c it still requires logging in.
52
+ # Not going to do dryrun in Rubyforge class b/c it still requires logging in.
53
+ if dryrun?
53
54
  files.each do |file|
54
- puts "[DRYRUN] Release #{file}"
55
+ puts "release #{file}"
55
56
  end
56
57
  else
57
58
  host = rubyforge(options)
@@ -1,6 +1,6 @@
1
1
  module Reap
2
2
 
3
- class Manager
3
+ class Project
4
4
 
5
5
  def scaffold(options)
6
6
  requests = options['arguments']
@@ -72,7 +72,7 @@ module Reap
72
72
  def scaffold_skeleton(options=nil)
73
73
  options = (options || {}).rekey(:to_s)
74
74
 
75
- files = glob('**/*') - glob('meta/**/*') - ['.reap']
75
+ files = glob('**/*') - glob('meta/**/*') - ['.reap', 'meta']
76
76
 
77
77
  unless files.empty?
78
78
  ans = ask("Directory isn't empty. Are you sure you want to add scaffolding?", 'yN')
@@ -115,6 +115,11 @@ module Reap
115
115
  file = File.join(dir, fname)
116
116
  cp(file, fname) unless File.exist?(fname)
117
117
  end
118
+
119
+ # A little extra love.
120
+
121
+ dir = File.join('lib',metadata.name)
122
+ mkdir_p(dir) unless File.exist?(dir)
118
123
  end
119
124
 
120
125
  private
@@ -1,8 +1,8 @@
1
- require 'reap/manager/svn'
1
+ require 'reap/project/svn'
2
2
 
3
3
  module Reap
4
4
 
5
- class Manager
5
+ class Project
6
6
 
7
7
  # Generate ChangeLog. This method routes to the
8
8
  # appropriate method for the project's source
@@ -14,7 +14,7 @@ module Reap
14
14
  create_txtlog = (options['txtlog'] != false)
15
15
  create_xmllog = (options['xmllog'] != false)
16
16
 
17
- xmlout = options['xmloutput'] || 'doc/log' # TODO: How to set doc/?
17
+ xmlout = options['xmloutput'] || 'site/log' # TODO: How to set site/?
18
18
 
19
19
  if create_txtlog
20
20
  txtlog = apply_naming_policy('changelog', 'txt')
@@ -1,6 +1,6 @@
1
1
  module Reap
2
2
 
3
- class Manager
3
+ class Project
4
4
 
5
5
  # Install via project's install/setup script.
6
6
  #
@@ -1,6 +1,6 @@
1
1
  module Reap
2
2
 
3
- class Manager
3
+ class Project
4
4
 
5
5
  # DEFAULT['spec'] = {
6
6
  # 'specs' => ['spec/**/*_spec.rb', 'spec/**/spec_*.rb'],
@@ -1,8 +1,6 @@
1
- require 'reap/manager/rubyforge'
2
-
3
1
  module Reap
4
2
 
5
- class Manager
3
+ class Project
6
4
 
7
5
  # Update VERSION stamp file.
8
6
  #
@@ -11,14 +9,15 @@ module Reap
11
9
  # Will have to use VersionNumnber class for this.
12
10
 
13
11
  def stamp(options={})
14
- options ||= {}
12
+ version = options['version']
13
+ status = options['status']
15
14
 
16
- default = configuration['stamp']
15
+ options = configure_options(options, 'stamp')
17
16
 
18
- version = options['version'] || metadata.version || default['version'] || '0.0.0'
19
- status = options['status'] || metadata.status || default['status'] || 'alpha'
17
+ version = version || metadata.version || '0.0.0'
18
+ status = status || metadata.status || '0.0.0'
20
19
 
21
- abort "Invalid version -- #{version}" unless /^[0-9]/ =~ version
20
+ abort "Invalid version -- #{version}" unless String===version && /^[0-9]/ =~ version
22
21
 
23
22
  meta = File.directory?('meta')
24
23
 
@@ -29,13 +28,17 @@ module Reap
29
28
 
30
29
  if File.exist?(file)
31
30
  old_text = File.read(file).strip
32
- return if text == old_text
31
+ old_version, old_status, old_date = *old_text.split(/\s/)
32
+ if old_version == "#{version}" && old_status == status
33
+ puts old_text
34
+ return
35
+ end
33
36
  end
34
37
 
35
38
  if dryrun?
36
- puts "[DRYRUN] echo #{text} > #{file}"
39
+ puts "echo '#{text}' > #{file}"
37
40
  else
38
- File.open(file, 'w'){|f| f << text}
41
+ write(file, text)
39
42
  puts text
40
43
  puts "#{file} updated."
41
44
 
@@ -1,6 +1,6 @@
1
1
  module Reap
2
2
 
3
- class Manager
3
+ class Project
4
4
 
5
5
  # DEFAULT['stats'] = {
6
6
  # 'exclude' => ['ext']
@@ -2,7 +2,7 @@ require 'reap/systems/subversion'
2
2
 
3
3
  module Reap
4
4
 
5
- class Manager
5
+ class Project
6
6
 
7
7
  # Branch current version.
8
8
  #
@@ -2,10 +2,6 @@
2
2
  #
3
3
  # Test
4
4
  #
5
- # TODO:
6
- # - Needs to be made DRY.
7
- # - Perhaps simplifiy this, making it more like the load test.
8
- # And simply collect that parse the output of each test.
9
5
 
10
6
  require 'facets/hash/rekey'
11
7
  require 'facets/string/tabs'
@@ -13,15 +9,7 @@ require 'facets/progressbar'
13
9
 
14
10
  module Reap
15
11
 
16
- class Manager
17
-
18
- # DEFAULT['test'] = {
19
- # 'tests' => 'test/**/{test,tc}_*.rb',
20
- # 'loadpath' => ['lib'],
21
- # 'require' => [],
22
- # 'exclude' => ['ext'],
23
- # 'live' => false
24
- # }
12
+ class Project
25
13
 
26
14
  private
27
15
 
@@ -32,13 +20,7 @@ module Reap
32
20
 
33
21
  options['loadpath'] ||= metadata.loadpath
34
22
 
35
- #options['tests'] ||= DEFAULT['test']['tests']
36
- #options['loadpath'] ||= DEFAULT['test']['loadpath']
37
- #options['exclude'] ||= DEFAULT['test']['exclude']
38
- #options['require'] ||= DEFAULT['test']['require']
39
- #options['live'] ||= DEFAULT['test']['live']
40
-
41
- options['tests'] = list_option(options['tests'])
23
+ #options['tests'] = list_option(options['tests'])
42
24
  options['loadpath'] = list_option(options['loadpath'])
43
25
  options['exclude'] = list_option(options['exclude'])
44
26
  options['require'] = list_option(options['require'])
data/lib/reap/project.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  module Reap
2
- require 'reap/manager'
2
+ require 'yaml'
3
+ require 'rbconfig'
4
+ require 'reap/utilities'
3
5
 
4
6
  # = Project
5
7
  #
@@ -7,10 +9,33 @@ module Reap
7
9
  # working with a project. The CLI Application class delegates to this class,
8
10
  # for instance.
9
11
 
10
- class Project < Manager
12
+ class Project
11
13
  require 'reap/metadata'
12
14
  require 'reap/settings'
13
15
 
16
+ # Load up the tools
17
+ require "reap/project/announce.rb"
18
+ require "reap/project/check.rb"
19
+ require "reap/project/clean.rb"
20
+ require "reap/project/gem.rb"
21
+ require "reap/project/html.rb"
22
+ require "reap/project/log.rb"
23
+ require "reap/project/make.rb"
24
+ require "reap/project/package.rb"
25
+ require "reap/project/publish.rb"
26
+ require "reap/project/rdoc.rb"
27
+ require "reap/project/release.rb"
28
+ require "reap/project/scaffold.rb"
29
+ require "reap/project/site.rb"
30
+ require "reap/project/spec.rb"
31
+ require "reap/project/stats.rb"
32
+ require "reap/project/stamp.rb"
33
+ require "reap/project/scm.rb"
34
+ require "reap/project/svn.rb"
35
+ require "reap/project/test.rb"
36
+
37
+ include Utilities
38
+
14
39
  # New Project.
15
40
 
16
41
  def initialize(options=nil)
@@ -45,6 +70,7 @@ module Reap
45
70
  # Common options.
46
71
 
47
72
  def options ; @options ; end
73
+ #alias_method :init_options, :options # TODO: Improve me! (see stamp.rb)
48
74
 
49
75
  def dryrun? ; options['dryrun'] ; end
50
76
  def trace? ; options['trace'] ; end
@@ -118,6 +144,12 @@ module Reap
118
144
  end
119
145
  end
120
146
 
147
+ # Project manifest file.
148
+
149
+ def manifest_file
150
+ Dir.glob('Manifest{,.txt}', File::FNM_CASEFOLD).first
151
+ end
152
+
121
153
  private
122
154
 
123
155
  # Locate the project root directory. This is determined
@@ -9,13 +9,6 @@ require 'tmpdir'
9
9
  require 'facets/hash/rekey'
10
10
  require 'facets/kernel/ask'
11
11
 
12
- #require 'reap/utilities/uploadutils'
13
-
14
- # def self.factory(name)
15
- # ["proutils/icli/#{name.downcase}.rb"].each{ |x| require x } # only did it this way to shut rdoc up!
16
- # ICli::const_get(name.capitalize)
17
- # end
18
-
19
12
  module Reap
20
13
 
21
14
  # Interface with the RubyForge hosting service.
@@ -241,8 +234,8 @@ module Reap
241
234
 
242
235
  unless package_id = package?(package)
243
236
  if dryrun?
244
- puts "[DRYRUN] Package '#{package}' does not exist."
245
- puts "[DRYRUN] Create package #{package}."
237
+ puts "Package '#{package}' does not exist."
238
+ puts "Create package #{package}."
246
239
  abort "Cannot continue in dryrun mode."
247
240
  else
248
241
  #unless options['force']
@@ -272,14 +265,14 @@ module Reap
272
265
  fname = File.basename(file)
273
266
  if file_id = file?(fname, package)
274
267
  if dryrun?
275
- puts "[DRYRUN] Remove file #{fname}."
268
+ puts "Remove file #{fname}."
276
269
  else
277
270
  puts "Removing file #{fname}..."
278
271
  remove_file(file_id, release_id, package_id)
279
272
  end
280
273
  end
281
274
  if dryrun?
282
- puts "[DRYRUN] Add file #{fname}."
275
+ puts "Add file #{fname}."
283
276
  else
284
277
  puts "Adding file #{fname}..."
285
278
  add_file(file, release_id, package_id, processor)
@@ -287,7 +280,7 @@ module Reap
287
280
  end
288
281
  else
289
282
  if dryrun?
290
- puts "[DRYRUN] Adding release #{release}..."
283
+ puts "Add release #{release}."
291
284
  else
292
285
  puts "Adding release #{release}..."
293
286
  add_release(release, package_id, files,
@@ -1,11 +1,9 @@
1
- require 'reap/utilities/shellutils'
2
- require 'reap/utilities/fileutils'
1
+ require 'reap/utilities'
3
2
 
4
3
  module Reap
5
4
 
6
5
  class Subversion
7
- include Utilities::ShellUtils
8
- include Utilities::FileUtils
6
+ include Utilities
9
7
 
10
8
  # Project name (for repository).
11
9
 
@@ -93,7 +91,7 @@ module Reap
93
91
  end
94
92
 
95
93
  if dryrun?
96
- puts "[DRYRUN] svn copy . #{url}"
94
+ puts "svn copy . #{url}"
97
95
  else
98
96
  case ask("Branch: #{url} ? [yN]").strip.downcase
99
97
  when 'y', 'yes'
@@ -120,7 +118,7 @@ module Reap
120
118
  end
121
119
 
122
120
  if dryrun?
123
- puts "[DRYRUN] svn copy . #{url}"
121
+ puts "svn copy . #{url}"
124
122
  else
125
123
  case ask("Tag: #{url} ? [yN]").strip.downcase
126
124
  when 'y', 'yes'