reap 6.0.2 → 9.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. data/CHANGES +6 -0
  2. data/COPYING +666 -395
  3. data/MANIFEST +139 -0
  4. data/NOTES +12 -0
  5. data/README +19 -163
  6. data/bin/reap-announce +7 -0
  7. data/bin/reap-check-load +8 -0
  8. data/bin/reap-check-syntax +7 -0
  9. data/bin/reap-clean +7 -0
  10. data/bin/reap-clobber +7 -0
  11. data/bin/reap-doc +7 -0
  12. data/bin/reap-doc-rdoc +7 -0
  13. data/bin/reap-doc-ri +7 -0
  14. data/bin/reap-init +69 -0
  15. data/bin/reap-inspect +7 -0
  16. data/bin/reap-install +8 -0
  17. data/bin/reap-install-gem +8 -0
  18. data/bin/reap-log +7 -0
  19. data/bin/reap-log-changes +8 -0
  20. data/bin/reap-log-notes +8 -0
  21. data/bin/reap-make +7 -0
  22. data/bin/reap-make-clean +7 -0
  23. data/bin/reap-make-distclean +7 -0
  24. data/bin/reap-make-extconf +7 -0
  25. data/bin/reap-make-static +8 -0
  26. data/bin/reap-package +8 -0
  27. data/bin/reap-package-gem +7 -0
  28. data/bin/reap-package-tgz +7 -0
  29. data/bin/reap-package-zip +7 -0
  30. data/bin/reap-prepare +7 -0
  31. data/bin/reap-publish +7 -0
  32. data/bin/reap-release +7 -0
  33. data/bin/reap-scaffold +8 -0
  34. data/bin/reap-scm-branch +7 -0
  35. data/bin/reap-scm-tag +7 -0
  36. data/bin/reap-spec +7 -0
  37. data/bin/reap-spec-doc +8 -0
  38. data/bin/reap-stamp +7 -0
  39. data/bin/reap-stats +7 -0
  40. data/bin/reap-test +7 -0
  41. data/bin/reap-test-cross +7 -0
  42. data/bin/reap-test-load +9 -0
  43. data/bin/reap-test-solo +7 -0
  44. data/bin/reap-uninstall +7 -0
  45. data/bin/reap-uninstall-gem +7 -0
  46. data/data/reap/base/CHANGES +19 -0
  47. data/data/reap/base/COPYING +674 -0
  48. data/data/reap/base/NOTES +12 -0
  49. data/data/reap/base/README +8 -0
  50. data/data/reap/build/rake/Rakefile +130 -0
  51. data/{forge/reference/installers → data/reap/build/rake}/setup.rb +155 -97
  52. data/data/reap/build/rake-lite/install.rb +79 -0
  53. data/data/reap/build/tasks/task/rdoc +211 -0
  54. data/data/reap/{setup.rb → build/tasks/task/setup} +248 -200
  55. data/data/reap/build/tasks/task/test +38 -0
  56. data/data/reap/init/meta/project.yaml +21 -0
  57. data/demo/README +15 -0
  58. data/demo/lib/foo/foo.rb +7 -0
  59. data/demo/meta/VERSION +1 -0
  60. data/demo/meta/project.yaml +21 -0
  61. data/lib/reap/application.rb +80 -0
  62. data/lib/reap/default.yaml +77 -0
  63. data/lib/reap/extensions/array.rb +50 -0
  64. data/lib/reap/extensions/hash.rb +63 -0
  65. data/lib/reap/extensions/string.rb +31 -0
  66. data/lib/reap/extensions.rb +6 -0
  67. data/lib/reap/iobject.rb +264 -0
  68. data/lib/reap/manager/announce.rb +193 -0
  69. data/lib/reap/manager/check.rb +109 -0
  70. data/lib/reap/manager/clean.rb +58 -0
  71. data/lib/reap/manager/gem.rb +200 -0
  72. data/lib/reap/manager/html.rb +69 -0
  73. data/lib/reap/manager/log.rb +214 -0
  74. data/lib/reap/manager/make.rb +109 -0
  75. data/lib/reap/manager/pack.rb +232 -0
  76. data/lib/reap/manager/publish.rb +72 -0
  77. data/lib/reap/manager/rdoc.rb +194 -0
  78. data/lib/reap/manager/release.rb +78 -0
  79. data/lib/reap/manager/rubyforge.rb +44 -0
  80. data/lib/reap/manager/scaffold.rb +138 -0
  81. data/lib/reap/manager/scm.rb +66 -0
  82. data/lib/reap/manager/site.rb +27 -0
  83. data/lib/reap/manager/spec.rb +94 -0
  84. data/lib/reap/manager/stats.rb +145 -0
  85. data/lib/reap/manager/svn.rb +76 -0
  86. data/lib/reap/manager/test.rb +389 -0
  87. data/lib/reap/manager.rb +74 -0
  88. data/lib/reap/metadata.rb +603 -0
  89. data/lib/reap/project.rb +165 -0
  90. data/lib/reap/settings.rb +67 -0
  91. data/lib/reap/systems/rubyforge.rb +737 -0
  92. data/lib/reap/systems/subversion.rb +333 -0
  93. data/lib/reap/utilities/fileutils.rb +304 -0
  94. data/lib/reap/utilities/netutils.rb +221 -0
  95. data/lib/reap/utilities/setuputils.rb +124 -0
  96. data/lib/reap/utilities/shellutils.rb +175 -0
  97. data/log/Changelog.txt +107 -0
  98. data/log/FIXME.txt +25 -0
  99. data/log/TODO.txt +72 -0
  100. data/meta/VERSION +1 -0
  101. data/meta/description +4 -0
  102. data/meta/project.yaml +20 -0
  103. data/task/man +14 -0
  104. data/task/rdoc +20 -0
  105. data/{data/reap/scaffold/standard/setup.rb → task/setup} +248 -200
  106. metadata +225 -153
  107. data/ProjectInfo +0 -105
  108. data/bin/reap +0 -5
  109. data/bin/rubytest +0 -5
  110. data/data/reap/install.rb +0 -62
  111. data/data/reap/scaffold/standard/COPYING +0 -403
  112. data/data/reap/scaffold/standard/ChangeLog +0 -0
  113. data/data/reap/scaffold/standard/INSTALL +0 -14
  114. data/data/reap/scaffold/standard/ProjectInfo +0 -77
  115. data/data/reap/scaffold/standard/README +0 -3
  116. data/data/reap/scaffold/standard/Rakefile +0 -10
  117. data/data/reap/scaffold/standard/TODO +0 -0
  118. data/data/reap/scaffold/subversion/trunk/COPYING +0 -403
  119. data/data/reap/scaffold/subversion/trunk/ChangeLog +0 -0
  120. data/data/reap/scaffold/subversion/trunk/INSTALL +0 -14
  121. data/data/reap/scaffold/subversion/trunk/ProjectInfo +0 -76
  122. data/data/reap/scaffold/subversion/trunk/README +0 -3
  123. data/data/reap/scaffold/subversion/trunk/Rakefile +0 -10
  124. data/data/reap/scaffold/subversion/trunk/TODO +0 -0
  125. data/data/reap/scaffold/subversion/trunk/setup.rb +0 -1568
  126. data/forge/ProjectInfo +0 -38
  127. data/forge/ProjectInfo.rb +0 -76
  128. data/forge/TODO +0 -10
  129. data/forge/installer.rb +0 -250
  130. data/forge/reference/Rakefile +0 -124
  131. data/forge/reference/Rakefile.htm +0 -69
  132. data/forge/reference/aRakefile +0 -60
  133. data/forge/reference/compositepublisher.rb +0 -24
  134. data/forge/reference/ftptools.rb +0 -139
  135. data/forge/reference/installers/package.rb +0 -629
  136. data/forge/reference/license-each.rb +0 -85
  137. data/forge/reference/publisher.rb +0 -75
  138. data/forge/reference/rubyforge.rb +0 -247
  139. data/forge/reference/rubyforgepublisher.rb +0 -18
  140. data/forge/reference/sshpublisher.rb +0 -47
  141. data/forge/reference/suby-cvs.rb +0 -46
  142. data/forge/scaffold.rb +0 -126
  143. data/forge/unit_runner/README +0 -6
  144. data/forge/unit_runner/commentrunner.rb +0 -62
  145. data/forge/unit_runner/cunit.rb +0 -17
  146. data/forge/unit_runner/forkedrunner.rb +0 -91
  147. data/forge/unit_runner/sample.rb +0 -16
  148. data/lib/reap/bin/reap.rb +0 -230
  149. data/lib/reap/bin/rubytest.rb +0 -53
  150. data/lib/reap/class/announce.rb +0 -220
  151. data/lib/reap/class/doap.rb +0 -80
  152. data/lib/reap/class/extest.rb +0 -146
  153. data/lib/reap/class/filer.rb +0 -62
  154. data/lib/reap/class/manifest.rb +0 -68
  155. data/lib/reap/class/package.rb +0 -576
  156. data/lib/reap/class/publish.rb +0 -152
  157. data/lib/reap/class/rdoc.rb +0 -123
  158. data/lib/reap/class/test.rb +0 -264
  159. data/lib/reap/projectinfo.rb +0 -208
  160. data/lib/reap/rake.rb +0 -42
  161. data/lib/reap/reap.rb +0 -89
  162. data/lib/reap/tasks.rb +0 -756
  163. data/lib/reap/taskutils.rb +0 -122
  164. data/note/LATEST +0 -44
  165. data/note/doap.xml +0 -28
  166. data/note/history/Rakefile-0.1 +0 -308
  167. data/sample/ProjectInfo +0 -96
  168. data/sample/Rakefile +0 -9
  169. data/sample/Reapfile +0 -11
  170. data/sample/task/demo.rb +0 -15
  171. data/setup.rb +0 -1568
  172. data/web/ProjectInfo.html +0 -75
  173. data/web/images/grape.jpg +0 -0
  174. data/web/index.html +0 -312
@@ -0,0 +1,165 @@
1
+ module Reap
2
+ require 'reap/manager'
3
+
4
+ # = Project
5
+ #
6
+ # The Project class is the main class of Reap. It provides the tools for
7
+ # working with a project. The CLI Application class delegates to this class,
8
+ # for instance.
9
+
10
+ class Project < Manager
11
+ require 'reap/metadata'
12
+ require 'reap/settings'
13
+
14
+ # New Project.
15
+
16
+ def initialize(options=nil)
17
+ @options = options || {}
18
+ begin
19
+ @location = locate
20
+ raise LoadError, "no .reap configuration file" unless @location
21
+
22
+ @metadata = Metadata.read(location)
23
+ @settings = Settings.read(location, @metadata)
24
+ rescue LoadError => e
25
+ abort e.message.capitalize + '.'
26
+ end
27
+ end
28
+
29
+ # Location of project.
30
+
31
+ def location ; @location ; end
32
+
33
+ # Project metadata.
34
+
35
+ def metadata ; @metadata ; end
36
+
37
+ # Configuration data.
38
+
39
+ def settings ; @settings ; end
40
+
41
+ alias_method :configuration, :settings
42
+
43
+ #alias_method :config, :configuration
44
+
45
+ # Common options.
46
+
47
+ def options ; @options ; end
48
+
49
+ def dryrun? ; options['dryrun'] ; end
50
+ def trace? ; options['trace'] ; end
51
+ def force? ; options['force'] ; end
52
+ def verbose? ; options['verbose'] ; end
53
+ def debug? ; options['debug'] ; end
54
+
55
+ def dryrun=(x) ; options['dryrun'] = x ; end
56
+ def trace=(x) ; options['trace'] = x ; end
57
+ def force=(x) ; options['force'] = x ; end
58
+ def verbose=(x) ; options['verbose'] = x ; end
59
+ def debug=(x) ; options['debug'] = x ; end
60
+
61
+ alias_method :noharm?, :dryrun?
62
+ alias_method :noharm=, :dryrun=
63
+
64
+ # Invoke a tool.
65
+
66
+ def invoke(command, *args)
67
+ #display_location
68
+ meth = method(command)
69
+ chdir_to_project do
70
+ case meth.arity
71
+ when 0
72
+ meth.call
73
+ else
74
+ meth.call(*args)
75
+ end
76
+ end
77
+ end
78
+
79
+ # Display the project's root location.
80
+
81
+ def display_location
82
+ puts "[#{location}]"
83
+ end
84
+
85
+ # Change directory to project's root location,
86
+ # and execute block if given. If a block is
87
+ # provided, the current directory will revert
88
+ # back to what it was prior to this call, otherwise
89
+ # it will remain changed.
90
+
91
+ def chdir_to_project(&block)
92
+ if block
93
+ Dir.chdir(location, &block)
94
+ else
95
+ Dir.chdir(location)
96
+ end
97
+ end
98
+
99
+ # Return a list of all ruby script in the project loadpaths.
100
+ #def scripts
101
+ # @scripts ||= multiglob(*metadata.libpath.collect{ |l| File.join(l, '**', '*.rb') })
102
+ #end
103
+
104
+ # Query infromation about reap settings and/or the current
105
+ # project.
106
+ #
107
+ # NOTE: This would dhave been naed #inspect but for the
108
+ # built-in method.
109
+
110
+ def introspect(options)
111
+ args = options['arguments']
112
+ if args
113
+ args.each do |field|
114
+ puts metadata.send(field)
115
+ end
116
+ else
117
+ y self
118
+ end
119
+ end
120
+
121
+ private
122
+
123
+ # Locate the project root directory. This is determined
124
+ # by ascending up the directory tree from the current position
125
+ # until a .reap file is found. Returns +nil+ if not found.
126
+
127
+ def locate
128
+ loc = nil
129
+ dir = Dir.pwd
130
+ while dir != '/'
131
+ glob = File.join(dir, Settings::REAP_FILE) #Project::PROJECT_FILE)
132
+ file = Dir.glob(glob, File::FNM_CASEFOLD).first
133
+ if file
134
+ loc = File.dirname(file)
135
+ break
136
+ else
137
+ dir = File.dirname(dir)
138
+ end
139
+ end
140
+ return loc
141
+ end
142
+
143
+ #
144
+
145
+ def configure_options(options, *entries)
146
+ options = (options || {}).rekey(&:to_s)
147
+ entries.inject(options) do |memo, entry|
148
+ (settings[entry] || {}).merge(memo)
149
+ end
150
+ end
151
+
152
+ # Helper method for cleaning list options.
153
+ # This will split the option on ':' or ';'
154
+ # if it is a string, rather than an array.
155
+ # And it will make sure there are no nil elements.
156
+
157
+ def list_option(option)
158
+ option = option.to_s.split(/[:;,]/) unless Array===option
159
+ [option].compact.flatten
160
+ end
161
+
162
+ end
163
+
164
+ end
165
+
@@ -0,0 +1,67 @@
1
+ module Reap
2
+
3
+ class Project
4
+
5
+ # Configuration is an open hash.
6
+ #
7
+ # TODO: Settings needs improvement -- it's rather sloppy at this point.
8
+
9
+ class Settings < Hash
10
+
11
+ DEFAULT_FILE = File.join(File.dirname(__FILE__), 'default.yaml')
12
+ REAP_FILE = '{.reap,_reap,reapfile}{.yaml,.yml,}'
13
+
14
+ def self.read(location, metadata)
15
+ if File.file?(location)
16
+ file = location
17
+ else
18
+ file = Dir.glob(File.join(location, REAP_FILE), File::FNM_CASEFOLD).first
19
+ end
20
+
21
+ if file
22
+ data = YAML::load(File.open(file)) || {}
23
+ else
24
+ data = {}
25
+ end
26
+
27
+ new(data, metadata)
28
+ end
29
+
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
+ def initialize(data, metadata)
37
+ super()
38
+ @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
43
+ data.each do |key, value|
44
+ settings[key] ||= {}
45
+ settings[key].update(value) if value
46
+ end
47
+ update(settings)
48
+ end
49
+
50
+ # open hash
51
+
52
+ def method_missing(s, *a)
53
+ if s =~ /=$/
54
+ self[s] = a[0]
55
+ elsif a.empty?
56
+ self[s]
57
+ else
58
+ super
59
+ end
60
+ end
61
+
62
+ end
63
+
64
+ end
65
+
66
+ end
67
+