reap 9.3.5 → 9.4.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 (105) hide show
  1. data/CHANGES +10 -0
  2. data/MANIFEST +37 -21
  3. data/NOTES +13 -11
  4. data/bin/reap-announce +40 -2
  5. data/bin/reap-check-load +20 -2
  6. data/bin/reap-check-syntax +20 -2
  7. data/bin/reap-clean +24 -2
  8. data/bin/reap-clobber +17 -2
  9. data/bin/reap-doc +12 -2
  10. data/bin/reap-doc-rdoc +17 -2
  11. data/bin/reap-doc-ri +16 -2
  12. data/bin/reap-doc-spec +18 -0
  13. data/bin/reap-init +9 -0
  14. data/bin/reap-inspect +20 -2
  15. data/bin/reap-install +13 -2
  16. data/bin/reap-install-gem +14 -2
  17. data/bin/reap-log +15 -2
  18. data/bin/reap-log-changes +15 -2
  19. data/bin/reap-log-notes +20 -2
  20. data/bin/reap-make +16 -2
  21. data/bin/reap-make-clean +10 -2
  22. data/bin/reap-make-distclean +18 -2
  23. data/bin/reap-make-extconf +14 -2
  24. data/bin/reap-make-static +14 -2
  25. data/bin/reap-package +25 -2
  26. data/bin/reap-package-gem +14 -2
  27. data/bin/reap-package-tgz +14 -2
  28. data/bin/reap-package-zip +14 -2
  29. data/bin/reap-prepare +21 -2
  30. data/bin/reap-publish +25 -2
  31. data/bin/reap-release +22 -2
  32. data/bin/reap-rollout +32 -2
  33. data/bin/reap-scaffold +16 -2
  34. data/bin/reap-scm-branch +13 -2
  35. data/bin/reap-scm-tag +13 -2
  36. data/bin/reap-spec +14 -2
  37. data/bin/reap-stats +21 -2
  38. data/bin/reap-test +14 -2
  39. data/bin/reap-test-cross +23 -2
  40. data/bin/reap-test-load +17 -2
  41. data/bin/reap-test-solo +19 -2
  42. data/bin/reap-uninstall +14 -2
  43. data/bin/reap-uninstall-gem +17 -2
  44. data/bin/reap-version +10 -2
  45. data/lib/reap/announcement.rb +136 -0
  46. data/lib/reap/application.rb +3 -1
  47. data/lib/reap/default.yaml +12 -12
  48. data/lib/reap/defaults.rb +49 -0
  49. data/lib/reap/emailer.rb +189 -0
  50. data/lib/reap/extensions.rb +1 -2
  51. data/lib/reap/hosts.rb +4 -0
  52. data/lib/reap/hosts/host.rb +69 -0
  53. data/lib/reap/hosts/mailinglist.rb +83 -0
  54. data/lib/reap/{systems → hosts}/rubyforge.rb +72 -60
  55. data/lib/reap/hosts/rubytalk.rb +39 -0
  56. data/lib/reap/iobject.rb +5 -3
  57. data/lib/reap/metadata.rb +31 -4
  58. data/lib/reap/project.rb +101 -41
  59. data/lib/reap/project/announce.rb +50 -180
  60. data/lib/reap/project/check.rb +1 -1
  61. data/lib/reap/project/gem.rb +32 -68
  62. data/lib/reap/project/log.rb +12 -7
  63. data/lib/reap/project/make.rb +0 -1
  64. data/lib/reap/project/package.rb +228 -75
  65. data/lib/reap/project/rdoc.rb +9 -8
  66. data/lib/reap/project/release.rb +52 -6
  67. data/lib/reap/project/scm.rb +40 -25
  68. data/lib/reap/project/spec.rb +3 -3
  69. data/lib/reap/project/test.rb +1 -2
  70. data/lib/reap/project/version.rb +18 -4
  71. data/lib/reap/runmodes.rb +24 -0
  72. data/lib/reap/settings.rb +3 -14
  73. data/lib/reap/systems.rb +4 -0
  74. data/lib/reap/systems/git.rb +0 -0
  75. data/lib/reap/systems/hg.rb +0 -0
  76. data/lib/reap/systems/{subversion.rb → svn.rb} +47 -16
  77. data/lib/reap/systems/system.rb +53 -0
  78. data/lib/reap/tool.rb +38 -0
  79. data/lib/reap/utilities.rb +43 -86
  80. data/log/{Changelog.txt → changelog.rdoc} +56 -0
  81. data/log/fixme.rdoc +25 -0
  82. data/log/todo.rdoc +85 -0
  83. data/meta/project.yaml +13 -2
  84. data/meta/version +1 -0
  85. data/setup.rb +74 -64
  86. data/task/allshare.rb +109 -0
  87. data/task/clean +13 -0
  88. data/task/compile +28 -0
  89. data/task/configure +372 -0
  90. data/task/install +1481 -0
  91. data/test/case/test_init.rb +32 -0
  92. data/test/case/test_scaffold.rb +32 -0
  93. data/test/data/scaffold/meta/project.yaml +28 -0
  94. data/test/lib/case_testable.rb +23 -0
  95. metadata +64 -31
  96. data/bin/reap-spec-doc +0 -8
  97. data/demo/README +0 -15
  98. data/demo/lib/foo/foo.rb +0 -7
  99. data/demo/meta/VERSION +0 -1
  100. data/demo/meta/project.yaml +0 -21
  101. data/lib/reap/project/rubyforge.rb +0 -71
  102. data/lib/reap/project/svn.rb +0 -76
  103. data/log/Fixme.txt +0 -22
  104. data/log/Todo.txt +0 -84
  105. data/meta/VERSION +0 -1
@@ -7,6 +7,7 @@ module Reap
7
7
 
8
8
  def document(options)
9
9
  rdoc(options)
10
+ ridoc(options)
10
11
  end
11
12
 
12
13
  # Generate rdocs.
@@ -43,13 +44,13 @@ module Reap
43
44
  cmdopts = {}
44
45
  #cmdopts['op'] = target_output
45
46
  cmdopts['main'] = target_main if target_main
46
- cmdopts['template'] = target['template']
47
+ cmdopts['template'] = target['template'] || ENV['RDOC_TEMPLATE'] || 'html'
47
48
  #cmdopts['merge'] = target['merge']
48
49
  cmdopts['inline-source'] = target['inline']
49
50
  cmdopts['exclude'] = list_option(target['exclude'])
50
51
 
51
52
  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.collect{ |g| Dir[g] }.flatten # Need this to remove unwanted toplevel files.
53
54
  files = files - ['Rakefile', 'Rakefile.rb'] # b/c rdoc's exlcude options doesn't work well.
54
55
  files = files - [manifest_file].compact
55
56
 
@@ -129,25 +130,25 @@ module Reap
129
130
 
130
131
  def ridoc(options=nil)
131
132
  options = configure_options(options, 'doc-ri', 'ri')
132
- options = DEFAULT['ri'].merge(options)
133
+ #options = DEFAULT['ri'].merge(options)
133
134
 
134
135
  cmdopts = {}
135
136
  cmdopts['op'] = options['output']
136
137
  cmdopts['exclude'] = options['exclude']
137
138
 
138
139
  output = options['output']
139
- files = options['include'] # || ['lib', '[A-Z]*']
140
+ files = options['include'] || metadata.loadpath #['lib', '[A-Z]*']
140
141
 
141
- input = files.collect do |i|
142
- dir?(i) ? File.join(i,'**','*') : i
143
- end
142
+ input = files #.collect do |i|
143
+ # dir?(i) ? File.join(i,'**','*') : i
144
+ #end
144
145
 
145
146
  if out_of_date?(output, *input) or force?
146
147
  rm_r(output) if exist?(output) and safe?(output) # remove old ridocs
147
148
 
148
149
  #input = input.collect{ |i| glob(i) }.flatten
149
150
  vector = [input, cmdopts]
150
- sh "rdoc --ri #{vector.to_console}"
151
+ sh "rdoc --ri -M -a #{vector.to_console}"
151
152
  else
152
153
  puts "RI Docs are current."
153
154
  end
@@ -1,4 +1,4 @@
1
- require 'reap/project/rubyforge'
1
+ require 'reap/hosts/rubyforge'
2
2
 
3
3
  module Reap
4
4
 
@@ -10,7 +10,53 @@ module Reap
10
10
 
11
11
  def release(options={})
12
12
  package(options)
13
- rubyforge_release(options)
13
+
14
+
15
+ release_options = configure_options(options, 'release')
16
+
17
+ store = 'pkg'
18
+ version = metadata.version
19
+
20
+ release_options['version'] = version
21
+ release_options['store'] = store
22
+
23
+ changelog = release_options['changelog'] #|| DEFAULT['release']['changelog'] || DEFAULT['rubyforge']['changelog']
24
+ notelog = release_options['notelog'] #|| DEFAULT['release']['notelog'] || DEFAULT['rubyforge']['notelog']
25
+
26
+ changelog = Dir.glob(changelog.to_s, File::FNM_CASEFOLD).first
27
+ notelog = Dir.glob(notelog.to_s, File::FNM_CASEFOLD).first
28
+
29
+ release_options['changelog'] = changelog if changelog && File.exist?(changelog)
30
+ release_options['notelog'] = notelog if notelog && File.exist?(notelog)
31
+
32
+ files = release_options['files'] || []
33
+
34
+ if files.empty?
35
+ files = Dir[File.join(store, '*')].select do |file|
36
+ /#{version}[.]/ =~ file
37
+ end
38
+ release_options['files'] = files
39
+ #files = Dir.glob(File.join(store,"#{name}-#{version}*"))
40
+ end
41
+
42
+
43
+ actions = []
44
+ select = options['hosts']
45
+
46
+ hosts(select).each do |host|
47
+ if host.respond_to?(:release)
48
+ # Not going to do dryrun in Rubyforge class b/c it still requires logging in.
49
+ if dryrun?
50
+ puts "release: #{} #{host.basename.downcase}"
51
+ else
52
+ if host.release_confirm?(release_options)
53
+ actions << lambda{ host.release(release_options) }
54
+ end
55
+ end
56
+ end
57
+ end
58
+
59
+ actions.each{ |a| a.call }
14
60
  end
15
61
 
16
62
  # A complete rollout. This will prepare (clean, stamp and package),
@@ -22,10 +68,10 @@ module Reap
22
68
  if force?
23
69
  doc, pub, ann, tag = true, true, true, true
24
70
  else
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
71
+ doc = ask("Generate doumentation?", "yN").downcase =~ /^(y|yes)$/i
72
+ pub = ask("Publish website? ", "yN") =~ /^(y|yes)$/i
73
+ tag = scm? ? (ask("Tag current version? ", "yN") =~ /^(y|yes)$/i) : false
74
+ ann = ask("Announce release? ", "yN") =~ /^(y|yes)$/i
29
75
  puts
30
76
  end
31
77
 
@@ -1,63 +1,78 @@
1
- require 'reap/project/svn'
1
+ require 'reap/systems'
2
2
 
3
3
  module Reap
4
4
 
5
5
  class Project
6
6
 
7
+ # Determine if project is under version control.
8
+ #
9
+ # TODO: scm? may need to be made more robsut.
10
+
11
+ def scm?
12
+ Systems::System.detect
13
+ end
14
+
7
15
  # Generate ChangeLog. This method routes to the
8
16
  # appropriate method for the project's source
9
17
  # control manager.
10
18
  #
19
+ # change File path to store rdoc formated changelog. Default is 'log/changelog.txt'.
20
+ # xmlchange File path to store XML formated changelog. Default is 'doc/log/changelog.xml'.
11
21
  #
22
+ # Set either to false to supress creation.
12
23
 
13
24
  def scm_log(options={})
14
- create_txtlog = (options['txtlog'] != false)
15
- create_xmllog = (options['xmllog'] != false)
25
+ #create_txtlog = (options['txtlog'] != false)
26
+ #create_xmllog = (options['xmllog'] != false)
16
27
 
17
28
  xmlout = options['xmloutput'] || 'site/log' # TODO: How to set site/?
18
29
 
19
- if create_txtlog
20
- txtlog = apply_naming_policy('changelog', 'txt')
30
+ #if create_txtlog
31
+ txtlog = apply_naming_policy('changelog', 'rdoc')
21
32
  txtlog = File.join('log', txtlog)
22
- end
33
+ #end
23
34
 
24
- if create_xmllog
35
+ #if create_xmllog
25
36
  xmllog = apply_naming_policy('changelog', 'xml')
26
37
  xmllog = File.join(xmlout, xmllog)
27
- end
38
+ #end
28
39
 
29
40
  #txtlog = File.join('lib', txtlog) unless txtlog.include?('/')
30
41
  #xmllog = File.join(xmldir, xmllog) unless xmllog.include?('/')
31
42
 
32
- if File.directory?('.svn')
33
- svn_log('txtlog' => txtlog, 'xmllog' => xmllog)
34
- else
35
- abort "Only Subversion is currently supported."
36
- end
43
+ txtlog ||= options['txtlog']
44
+ xmllog ||= options['xmllog']
45
+
46
+ scm.log(txtlog)
47
+ scm.log_xml(xmllog) if xmllog
37
48
  end
38
49
 
39
50
  # Tag current versoin of project. This method routes
40
51
  # to the appropriate method for the project's source
41
52
  # control manager.
53
+ #
54
+ # message Optional commit message. This is intended for commandline
55
+ # usage. (Use -m for shorthand).
56
+ #
57
+ # TODO: How should metadata.repository come into play here?
42
58
 
43
- def scm_tag(*args)
44
- if File.directory?('.svn')
45
- svn_tag(*args)
46
- else
47
- abort "Only Subversion is currently supported."
48
- end
59
+ def scm_tag(options=nil)
60
+ options = configure_options(options, 'scm-tag', 'scm')
61
+ scm.tag(options)
49
62
  end
50
63
 
51
64
  # Branch current version of project. This method routes
52
65
  # to the appropriate method for the project's source
53
66
  # control manager.
67
+ #
68
+ # message Optional commit message. This is intended
69
+ # for commandline usage. (Use -m for shorthand).
70
+ #
71
+ # TODO: How should metadata.repository come into play here?
54
72
 
55
- def scm_branch(*args)
56
- if File.directory?('.svn')
57
- svn_branch(*args)
58
- else
59
- abort "Only Subversion is currently supported."
60
- end
73
+ def scm_branch(options=nil)
74
+ options = configure_options(options, 'scm-branch', 'scm')
75
+ scm.branch(options)
61
76
  end
62
77
 
63
78
  end
@@ -43,9 +43,9 @@ module Reap
43
43
  specopt = options['specopt']
44
44
  live = options['live']
45
45
 
46
- specs = list_options(specs)
47
- loadpath = list_options(loadpath)
48
- requires = list_options(requires)
46
+ specs = list_option(specs)
47
+ loadpath = list_option(loadpath)
48
+ requires = list_option(requires)
49
49
 
50
50
  files = multiglob(*specs)
51
51
 
@@ -3,8 +3,7 @@
3
3
  # Test
4
4
  #
5
5
 
6
- require 'facets/hash/rekey'
7
- require 'facets/string/tabs'
6
+ require 'facets' #/hash/reke, string/tabs
8
7
  require 'facets/progressbar'
9
8
 
10
9
  module Reap
@@ -39,6 +39,7 @@ module Reap
39
39
  status = options['status']
40
40
 
41
41
  bumps = [ options['major'], options['minor'], options['tiny'], options['teeny'] ]
42
+
42
43
  bump = bumps.any?{|x|x}
43
44
 
44
45
  abort "Specify bumps or version, not both." if bump and version
@@ -49,11 +50,24 @@ module Reap
49
50
  status = status || metadata.status || '0.0.0'
50
51
 
51
52
  if bump
52
- points = []
53
- version.to_s.split(/[.]/).each_with_index do |x, i|
54
- points[i] = (bumps[i] ? x.to_i + 1 : x).to_s
53
+ points = version.to_s.split(/[.]/).collect do |x|
54
+ x.to_i
55
+ end
56
+
57
+ if options['major']
58
+ points[0] += 1
59
+ points[1..-1] = *([0] * points[1..-1].size)
60
+ elsif options['minor']
61
+ points[1] += 1
62
+ points[2..-1] = *([0] * points[2..-1].size)
63
+ elsif options['tiny']
64
+ points[2] += 1
65
+ points[3..-1] = *([0] * points[3..-1].size)
66
+ elsif options['teeny']
67
+ points[3] += 1
55
68
  end
56
- version = points.join('.').sub(/[.0]$/,'')
69
+
70
+ version = points.join('.') #.chomp('.0')
57
71
  else
58
72
  abort "Invalid version -- #{version}" unless String===version && /^[0-9]/ =~ version
59
73
  end
@@ -0,0 +1,24 @@
1
+ module Reap
2
+
3
+ class RunModes
4
+
5
+ attr_accessor :dryrun
6
+ attr_accessor :verbose
7
+ attr_accessor :trace
8
+ attr_accessor :force
9
+ attr_accessor :debug
10
+
11
+ def initialize(options, &block)
12
+ populate(options, &block)
13
+ end
14
+
15
+ def dryrun? ; @dryrun ; end
16
+ def verbose? ; @verbose ; end
17
+ def trace? ; @trace ; end
18
+ def force? ; @force ; end
19
+ def debug? ; @debug ; end
20
+
21
+ end
22
+
23
+ end
24
+
@@ -2,13 +2,12 @@ module Reap
2
2
 
3
3
  class Project
4
4
 
5
- # Configuration is an open hash.
5
+ # = Project Settings
6
6
  #
7
- # TODO: Settings needs improvement -- it's rather sloppy at this point.
7
+ # Configuration settings (from .reap file).
8
8
 
9
9
  class Settings < Hash
10
10
 
11
- DEFAULT_FILE = File.join(File.dirname(__FILE__), 'default.yaml')
12
11
  REAP_FILE = '{.reap,_reap,reapfile}{.yaml,.yml,}'
13
12
 
14
13
  def self.read(location, metadata)
@@ -23,23 +22,13 @@ module Reap
23
22
  else
24
23
  data = {}
25
24
  end
26
-
27
25
  new(data, metadata)
28
26
  end
29
27
 
30
-
31
- attr :metadata
32
-
33
- # FIXME: when using the settings, I think nil should be considered a none entry and
34
- # so false would be required to actually mean "off". This means assigning each key value par one a time?
35
-
36
28
  def initialize(data, metadata)
37
29
  super()
38
30
  @metadata = metadata
39
- defaults = File.read(DEFAULT_FILE)
40
- defaults = instance_eval("<<-XXXXXXXXXXXXX\n#{defaults}\nXXXXXXXXXXXXX")
41
- defaults = YAML::load(defaults)
42
- settings = defaults.dup
31
+ settings = {}
43
32
  data.each do |key, value|
44
33
  settings[key] ||= {}
45
34
  settings[key].update(value) if value
@@ -0,0 +1,4 @@
1
+ require 'reap/systems/svn'
2
+ require 'reap/systems/git'
3
+ require 'reap/systems/hg'
4
+
File without changes
File without changes
@@ -1,13 +1,34 @@
1
1
  require 'reap/utilities'
2
+ require 'reap/systems/system'
2
3
 
3
4
  module Reap
4
-
5
- class Subversion
6
- include Utilities
7
-
8
- # Project name (for repository).
9
-
10
- attr_accessor :project
5
+ module Systems
6
+
7
+ # = Subversion
8
+ #
9
+ # Source control system for Subversion. Provides:
10
+ #
11
+ # log
12
+ # log_xml
13
+ # tag
14
+ # branch
15
+ #
16
+ # Options are:
17
+ #
18
+ # repository Developers URL to repository. Defaults to Rubyforge address.
19
+ # username Username. Defaults to ENV['RUBYFORGE_USERNAME'].
20
+ # protocol The URL protocol to use. Defaults to "svn+ssh".
21
+ # prefix Prefix to use on tag folder. Default is no prefix.
22
+ # tagpath Directory to store tags. Defaults to tags/.
23
+ # branchpath Directory to store branches. Defaults to branches/.
24
+
25
+ class Svn < System
26
+
27
+ register('subversion')
28
+
29
+ # Project unixname (for repository).
30
+
31
+ attr_accessor :unixname
11
32
 
12
33
  # Current version of project.
13
34
 
@@ -42,22 +63,32 @@ module Reap
42
63
 
43
64
  attr_accessor :branchpath
44
65
 
45
- # Operate in dryrun mode.
46
-
47
- attr_accessor :dryrun
48
-
49
66
  # New Subversion object.
50
67
  #
51
68
  # TODO: Perhaps format prefix, like:
52
69
  # prefix = prefix + '_' if prefix && prefix !~ /[_-]$/
70
+ #
71
+ # TODO: tie in Metadata#scm, but probably via project/scm.rb.
72
+
73
+ def initialize(project, options={})
74
+ options = options.rekey
75
+
76
+ super(project, options)
77
+
78
+ #settings = (project.settings['svn'] || {}).rekey
79
+ #options = settings.update(options)
80
+
81
+ options[:repository] ||= project.metadata.repository
82
+ options[:unixname] ||= project.metadata.unixname
83
+
84
+ options[:version] = project.metadata.version
53
85
 
54
- def initialize(options={})
55
86
  options.each do |k,v|
56
87
  send("#{k}=", v) if respond_to?("#{k}=")
57
88
  end
58
89
 
59
90
  # defaults are for rubyforge
60
- @repository ||= "rubyforge.org/var/svn/#{project}"
91
+ @repository ||= "rubyforge.org/var/svn/#{unixname}"
61
92
  @username ||= ENV['RUBYFORGE_USERNAME']
62
93
  @protocol ||= "svn+ssh"
63
94
  @tagpath ||= "tags"
@@ -162,7 +193,7 @@ module Reap
162
193
  File.open(file, 'w'){|f| f << text }
163
194
  puts "Updated #{file}"
164
195
  else
165
- puts text
196
+ puts text
166
197
  end
167
198
  end
168
199
 
@@ -176,7 +207,7 @@ module Reap
176
207
 
177
208
  text = changelog_xml
178
209
  i = text.index("?>\n")
179
- text.insert(i+2, "\n" + %[<?xml-stylesheet href="#{xslfile}" type="text/xsl" ?>])
210
+ text.insert(i+2, "\n" + %[<?xml-stylesheet href="#{File.basename(xslfile)}" type="text/xsl" ?>])
180
211
 
181
212
  if dryrun?
182
213
  puts "svn log --xml > #{file}"
@@ -304,7 +335,7 @@ END
304
335
  end
305
336
 
306
337
  end
307
-
338
+ end
308
339
 
309
340
 
310
341
  =begin