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
@@ -2,7 +2,21 @@
2
2
 
3
3
  require 'reap/application'
4
4
 
5
- app = Reap::Application.new
5
+ HELP = <<-END
6
+ Usage: #{File.basename($0)} [options]
6
7
 
7
- app.scaffold
8
+ Reap scaffold will generate a conventional Ruby project
9
+ layout of directories and files. It uses information from
10
+ project metadata to improve upon the scaffolding if it
11
+ is available (see reap-init). reap-scaffold will not
12
+ overwite pre-existing files of the same name unless the
13
+ --force option is supplied.
14
+ END
15
+
16
+ if ARGV.include?('--help')
17
+ puts HELP
18
+ else
19
+ app = Reap::Application.new
20
+ app.scaffold
21
+ end
8
22
 
@@ -2,6 +2,17 @@
2
2
 
3
3
  require 'reap/application'
4
4
 
5
- app = Reap::Application.new
5
+ HELP = <<-END
6
+ Usage: #{File.basename($0)} [options]
7
+
8
+ Branch the project via a supported source control manager
9
+ (currently only SVN is supported).
10
+ END
11
+
12
+ if ARGV.include?('--help')
13
+ puts HELP
14
+ else
15
+ app = Reap::Application.new
16
+ app.scm_branch
17
+ end
6
18
 
7
- app.scm_branch
@@ -2,6 +2,17 @@
2
2
 
3
3
  require 'reap/application'
4
4
 
5
- app = Reap::Application.new
5
+ HELP = <<-END
6
+ Usage: #{File.basename($0)} [options]
7
+
8
+ Tag the project via a supported source control manager
9
+ (currently only SVN is supported).
10
+ END
11
+
12
+ if ARGV.include?('--help')
13
+ puts HELP
14
+ else
15
+ app = Reap::Application.new
16
+ app.scm_tag
17
+ end
6
18
 
7
- app.scm_tag
@@ -2,6 +2,18 @@
2
2
 
3
3
  require 'reap/application'
4
4
 
5
- app = Reap::Application.new
5
+ HELP = <<-END
6
+ Usage: #{File.basename($0)} [options]
7
+
8
+ Run specifications. This is a general specifications runner, which
9
+ loads all specs into a single process and and then runs them
10
+ consecutively. This shells out to the 'spec' command per RSpec.
11
+ END
12
+
13
+ if ARGV.include?('--help')
14
+ puts HELP
15
+ else
16
+ app = Reap::Application.new
17
+ app.spec
18
+ end
6
19
 
7
- app.spec
@@ -2,6 +2,25 @@
2
2
 
3
3
  require 'reap/application'
4
4
 
5
- app = Reap::Application.new
5
+ HELP = <<-END
6
+ Usage: #{File.basename($0)} [options]
7
+
8
+ Scan source code counting files, lines of code and comments
9
+ and presents a report of it's findings.
10
+
11
+ loadpath Path to include in analysis. The default
12
+ is the project's loadpath.
13
+
14
+ exclude File globs to exclude from analysis. Default is
15
+ 'ext' b/c this does not yet support C analysis.
16
+
17
+ This command does not currently support C coded extensions.
18
+ END
19
+
20
+ if ARGV.include?('--help')
21
+ puts HELP
22
+ else
23
+ app = Reap::Application.new
24
+ app.stats
25
+ end
6
26
 
7
- app.stats
@@ -2,6 +2,18 @@
2
2
 
3
3
  require 'reap/application'
4
4
 
5
- app = Reap::Application.new
5
+ HELP = <<-END
6
+ Usage: #{File.basename($0)} [options]
7
+
8
+ Run unit tests. This is a general unit test runner, which
9
+ loads all tests into a single process and and then runs
10
+ them consecutively.
11
+ END
12
+
13
+ if ARGV.include?('--help')
14
+ puts HELP
15
+ else
16
+ app = Reap::Application.new
17
+ app.test_unit
18
+ end
6
19
 
7
- app.test_unit
@@ -2,6 +2,27 @@
2
2
 
3
3
  require 'reap/application'
4
4
 
5
- app = Reap::Application.new
5
+ HELP = <<-END
6
+ Usage: #{File.basename($0)} [options]
7
+
8
+ This command runs unit tests in pairs to make sure there is cross
9
+ library compatibility. Each pair is run in a separate interpretor
10
+ to prevent script clash. This makes for a more robust test
11
+ facility and prevents potential conflicts between scripts.
12
+
13
+ tests Test files (eg. test/tc_**/*.rb) [test/**/*]
14
+ loadpath Directories to include in load path.
15
+ require List of files to require prior to running tests.
16
+ live Deactive use of local libs and test against install.
17
+
18
+ This command is especially useful to large library collection type
19
+ projects.
20
+ END
21
+
22
+ if ARGV.include?('--help')
23
+ puts HELP
24
+ else
25
+ app = Reap::Application.new
26
+ app.test_cross
27
+ end
6
28
 
7
- app.test_cross
@@ -4,6 +4,21 @@
4
4
 
5
5
  require 'reap/application'
6
6
 
7
- app = Reap::Application.new
7
+ HELP = <<-END
8
+ Usage: #{File.basename($0)} [options]
9
+
10
+ Simple load testing. Each test is loaded to ensure their
11
+ are no require issues in the tests themselves. This is
12
+ largey redudant since any other test command will report
13
+ these errors as well. The advantage here howver, is that
14
+ this command isolates test load issues from actual test
15
+ failures.
16
+ END
17
+
18
+ if ARGV.include?('--help')
19
+ puts HELP
20
+ else
21
+ app = Reap::Application.new
22
+ app.test_load
23
+ end
8
24
 
9
- app.test_load
@@ -2,6 +2,23 @@
2
2
 
3
3
  require 'reap/application'
4
4
 
5
- app = Reap::Application.new
5
+ HELP = <<-END
6
+ Usage: #{File.basename($0)} [options]
7
+
8
+ Run unit-tests independently. Each test is run in a separate
9
+ interpretor to prevent script clash. This adds to a more robust
10
+ test facility, and prevents potential conflicts between test scripts.
11
+
12
+ tests Test files (eg. test/tc_**/*.rb) [test/**/*]
13
+ loadpath Directories to include in load path [lib].
14
+ require List of files to require prior to running tests.
15
+ live Deactive use of local libs and test against install.
16
+ END
17
+
18
+ if ARGV.include?('--help')
19
+ puts HELP
20
+ else
21
+ app = Reap::Application.new
22
+ app.test_solo
23
+ end
6
24
 
7
- app.test_solo
@@ -2,6 +2,18 @@
2
2
 
3
3
  require 'reap/application'
4
4
 
5
- app = Reap::Application.new
5
+ HELP = <<-END
6
+ Usage: #{File.basename($0)} [options]
7
+
8
+ Uninstall previous installation to site_ruby via reap-install.
9
+ This only works if the underlying install script (e.g. setup.rb)
10
+ supports an uninstall subcommand.
11
+ END
12
+
13
+ if ARGV.include?('--help')
14
+ puts HELP
15
+ else
16
+ app = Reap::Application.new
17
+ app.site_uninstall
18
+ end
6
19
 
7
- app.site_uninstall
@@ -2,6 +2,21 @@
2
2
 
3
3
  require 'reap/application'
4
4
 
5
- app = Reap::Application.new
5
+ HELP = <<-END
6
+ Usage: #{File.basename($0)} [options]
7
+
8
+ Remove previsously installed gem. This is equivalent to
9
+
10
+ $ gem uninstall {project name}
11
+
12
+ The reap command is provided as a convenience when testing
13
+ gem installation using reap-install-gem.
14
+ END
15
+
16
+ if ARGV.include?('--help')
17
+ puts HELP
18
+ else
19
+ app = Reap::Application.new
20
+ app.gem_uninstall
21
+ end
6
22
 
7
- app.gem_uninstall
@@ -2,6 +2,14 @@
2
2
 
3
3
  require 'reap/application'
4
4
 
5
- app = Reap::Application.new
5
+ HELP = <<-END
6
+ Usage: #{File.basename($0)} [options]
7
+ END
8
+
9
+ if ARGV.include?('--help')
10
+ puts HELP
11
+ else
12
+ app = Reap::Application.new
13
+ app.stamp
14
+ end
6
15
 
7
- app.stamp
@@ -0,0 +1,136 @@
1
+ #require 'erb'
2
+
3
+ module Reap
4
+
5
+ # = Announcement
6
+ #
7
+ # Announcment class is used to generate an announcement message.
8
+ # By default this is a Release Announcment.
9
+
10
+ class Announcement
11
+
12
+ # Project metadata
13
+
14
+ attr_accessor :metadata
15
+
16
+ attr_accessor :cutoff
17
+
18
+ attr_accessor :template
19
+
20
+ #
21
+
22
+ def initialize(options={}, &block)
23
+ populate(options, &block)
24
+
25
+ @cutoff ||= 30
26
+ @template ||= "{ANNOUNCE}{,.txt}"
27
+ end
28
+
29
+ # Make a release announcement. Generates and can email a release
30
+ # announcements. These are nicely formated message and can
31
+ # email the message to the specified address(es).
32
+ #
33
+ # The following settings apply:
34
+ #
35
+ # template Announcement file/template.
36
+ # cutoff Max number of lines of changelog to show.
37
+ #
38
+ # A template file can be specified that uses "$setting" as
39
+ # substitutes for poject information.
40
+
41
+ def message
42
+ template = Dir.glob(template(), File::FNM_CASEFOLD).first
43
+
44
+ if template
45
+ readme = File.read(template)
46
+ readme = unfold_paragraphs(readme)
47
+ else
48
+ readme = ''
49
+ #readme << "= #{metadata.title} v#{metadata.version}\n\n"
50
+ readme << "#{metadata.description}\n\n"
51
+ readme << "#{metadata.homepage}\n\n"
52
+ readme << "Please see the NOTES file.\n\n"
53
+ readme << "Please see the CHANGES file.\n"
54
+ end
55
+
56
+ # changelog
57
+ file = Dir.glob('change{s,log}{,.txt}', File::FNM_CASEFOLD)[0]
58
+ changelog = file ? File.read(file).strip : ''
59
+ #changelog = unfold_paragraphs(changelog)
60
+ changelog = changelog.split("\n")[0..cutoff].join("\n")
61
+ unless changelog =~ /^=/
62
+ changelog = "\n== Changes\n\n" + changelog
63
+ end
64
+
65
+ # noteslog
66
+ file = Dir.glob('note{s,log}{,.txt}', File::FNM_CASEFOLD)[0]
67
+ notelog = file ? File.read(file).strip : ''
68
+ notelog = unfold_paragraphs(notelog)
69
+ unless notelog =~ /^=/
70
+ notelog = "\n== Release Notes\n\n" + notelog
71
+ end
72
+
73
+ # Strip tiny version zero.
74
+ #if keys['version'] =~ /[.].*?[.]/
75
+ # keys['version'] = keys['version'].chomp('.0')
76
+ #end
77
+
78
+ # Make announcement message
79
+ message = readme.dup
80
+
81
+ #message.gsub!('$readme$', readme || '')
82
+ message.sub!(/^\s*please\ see(\ the)?\ notes(.*?)$/i, "\n" + notelog) if notelog
83
+ message.sub!(/^\s*please\ see(\ the)?\ change(.*?)$/i, "\n" + changelog) if changelog
84
+
85
+ template = message.dup
86
+
87
+ template.scan(/\$(\w+?)\$/m) do |key|
88
+ #key = key.strip
89
+ name = $1.strip #key[1..-1]
90
+ if metadata.respond_to?(name.downcase)
91
+ value = metadata.send(name.downcase)
92
+ message.gsub!("$#{name}$", value.to_s.strip)
93
+ else
94
+ puts "Warning: Unknown project metadata field -- #{name}."
95
+ end
96
+ end
97
+
98
+ message.gsub!(/(^|[ ])[$].*?(?=[ ]|$)/,'') # remove unused vars
99
+ message.gsub!(/\n\s*\n\s*\n/m,"\n\n") # remove any triple blank lines
100
+ message.rstrip!
101
+
102
+ message = "\n" + message
103
+
104
+ return message
105
+ end
106
+
107
+ #
108
+
109
+ def unfold_paragraphs(string)
110
+ blank = false
111
+ text = ''
112
+ string.split(/\n/).each do |line|
113
+ if /\S/ !~ line
114
+ text << "\n\n"
115
+ blank = true
116
+ else
117
+ if /^(\s+|[*])/ =~ line
118
+ text << (line.rstrip + "\n")
119
+ else
120
+ text << (line.rstrip + " ")
121
+ end
122
+ blank = false
123
+ end
124
+ end
125
+ return text
126
+ end
127
+
128
+
129
+ def to_s
130
+ message
131
+ end
132
+
133
+ end
134
+
135
+ end
136
+
@@ -3,7 +3,9 @@
3
3
  module Reap
4
4
  require 'reap/project'
5
5
 
6
- # Application is the commandline interface.
6
+ # = Application
7
+ #
8
+ # Application is the commandline interface to Project.
7
9
 
8
10
  class Application
9
11
 
@@ -1,16 +1,16 @@
1
-
2
- announce:
3
- template: '{ANNOUNCE}{,.txt}' # Announcement template file glob.
4
- mail_to: rubytalk@ruby-lange.org # Email address(es) to send announcemnt.
5
- mail_from: #{metadata.email} # Message FROM address.
6
- subject: "%s v%s released" # Subject of email message. Sprintf'd against name and version.
1
+ email:
2
+ server: nil # Email server to route message.
7
3
  account: #{metadata.email} # Email account name [email].
8
- domain: rubyforge.org # Your domain. (Not sure why one needs this for an email.)
9
- server: smtp.goolge.com # Email server to route message.
10
4
  port: 25 # Email server's port, if not secure.
11
- port_secure: 465 # Email server's port, if secure.
12
5
  secure: false # Uses TLS security, true or false?
13
6
  login: plain # Login type: plain, cram_md5 or login.
7
+ domain: rubyforge.org # Your domain. (Not sure why one needs this for an email.)
8
+ from: #{metadata.email} # Message FROM address.
9
+ to: #{metadata.email} # Email address(es) to send announcemnt.
10
+
11
+ announce:
12
+ subject: "%s v%s released" # Subject of email message. Sprintf'd against name and version.
13
+ template: '{ANNOUNCE}{,.txt}' # Announcement template file glob.
14
14
  cutoff: 30 # How many lines of changelog to provide.
15
15
 
16
16
  check:
@@ -47,8 +47,8 @@
47
47
  exclude: [.svn, scrap] # Used as defaults for creating .rsync-filter (after that edit .rsync-filter)
48
48
 
49
49
  rdoc:
50
- template: html # Template to use.
51
- output: doc/#{metadata.project}/rdoc # Where to save rdoc files.
50
+ template: ~ # Template to use (defaults to ENV['RDOC_TEMPLATE'] or 'html'
51
+ output: doc/rdoc # Where to save rdoc files.
52
52
  main: 'README{,.txt}' # Main file (pattern).
53
53
  inline: true # Inline source?
54
54
  merge: true # Merge code?
@@ -58,7 +58,7 @@
58
58
  targets: ~ # If you need more then one rdoc set, use targets.
59
59
 
60
60
  ri:
61
- output: ri # Where to save ri files.
61
+ output: doc/ri # Where to save ri files.
62
62
  include: ~ # Defaults to metadata.loadpath.
63
63
  exclude: [] # Paths to specifically exclude.
64
64