bpm 0.1.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 (261) hide show
  1. data/.gitignore +4 -0
  2. data/.gitmodules +0 -0
  3. data/Gemfile +16 -0
  4. data/README.md +55 -0
  5. data/TODO.md +3 -0
  6. data/bin/bpm +8 -0
  7. data/bpm.gemspec +41 -0
  8. data/lib/bpm.rb +18 -0
  9. data/lib/bpm/cli.rb +6 -0
  10. data/lib/bpm/cli/base.rb +358 -0
  11. data/lib/bpm/cli/owner.rb +46 -0
  12. data/lib/bpm/credentials.rb +36 -0
  13. data/lib/bpm/default.json +9 -0
  14. data/lib/bpm/generator.rb +69 -0
  15. data/lib/bpm/init_generator.rb +43 -0
  16. data/lib/bpm/libgems_ext.rb +11 -0
  17. data/lib/bpm/libgems_ext/config_file.rb +33 -0
  18. data/lib/bpm/libgems_ext/dependency_installer.rb +150 -0
  19. data/lib/bpm/libgems_ext/installer.rb +39 -0
  20. data/lib/bpm/libgems_ext/libgems.rb +39 -0
  21. data/lib/bpm/libgems_ext/spec_fetcher.rb +11 -0
  22. data/lib/bpm/local.rb +76 -0
  23. data/lib/bpm/package.rb +277 -0
  24. data/lib/bpm/pipeline.rb +100 -0
  25. data/lib/bpm/pipeline/directive_processor.rb +47 -0
  26. data/lib/bpm/pipeline/generated_asset.rb +68 -0
  27. data/lib/bpm/pipeline/transport_processor.rb +32 -0
  28. data/lib/bpm/project.rb +427 -0
  29. data/lib/bpm/project_generator.rb +34 -0
  30. data/lib/bpm/remote.rb +104 -0
  31. data/lib/bpm/repository.rb +18 -0
  32. data/lib/bpm/server.rb +44 -0
  33. data/lib/bpm/version.rb +3 -0
  34. data/spec/cli/add_spec.rb +159 -0
  35. data/spec/cli/build_spec.rb +87 -0
  36. data/spec/cli/fetch_spec.rb +135 -0
  37. data/spec/cli/fetched_spec.rb +52 -0
  38. data/spec/cli/init_spec.rb +50 -0
  39. data/spec/cli/list_spec.rb +74 -0
  40. data/spec/cli/login_spec.rb +110 -0
  41. data/spec/cli/new_spec.rb +92 -0
  42. data/spec/cli/owner_spec.rb +114 -0
  43. data/spec/cli/push_spec.rb +73 -0
  44. data/spec/cli/remove_spec.rb +84 -0
  45. data/spec/cli/unpack_spec.rb +72 -0
  46. data/spec/cli/unyank_spec.rb +73 -0
  47. data/spec/cli/yank_spec.rb +73 -0
  48. data/spec/credentials_spec.rb +23 -0
  49. data/spec/fixtures/badrake-0.8.7.spd +0 -0
  50. data/spec/fixtures/builder-3.0.0.spd +0 -0
  51. data/spec/fixtures/bundler-1.1.pre.spd +0 -0
  52. data/spec/fixtures/coffee-1.0.1.pre.spd +0 -0
  53. data/spec/fixtures/core-test-0.4.9.spd +0 -0
  54. data/spec/fixtures/core-test/bin/cot +3 -0
  55. data/spec/fixtures/core-test/lib/main.js +1 -0
  56. data/spec/fixtures/core-test/package.json +46 -0
  57. data/spec/fixtures/core-test/resources/runner.css +1 -0
  58. data/spec/fixtures/core-test/tests/test.js +1 -0
  59. data/spec/fixtures/custom_generator-1.0.spd +0 -0
  60. data/spec/fixtures/custom_generator/lib/main.js +1 -0
  61. data/spec/fixtures/custom_generator/package.json +12 -0
  62. data/spec/fixtures/custom_generator/templates/init/project.json +19 -0
  63. data/spec/fixtures/custom_generator/templates/project/app.js +1 -0
  64. data/spec/fixtures/custom_generator/templates/project/lib/main.js +0 -0
  65. data/spec/fixtures/custom_generator/templates/project_generator.rb +20 -0
  66. data/spec/fixtures/hello_world/LICENSE +19 -0
  67. data/spec/fixtures/hello_world/README.md +21 -0
  68. data/spec/fixtures/hello_world/assets/bpm_packages.js +13 -0
  69. data/spec/fixtures/hello_world/assets/bpm_styles.css +14 -0
  70. data/spec/fixtures/hello_world/assets/papa-smurf.jpg +0 -0
  71. data/spec/fixtures/hello_world/hello_world.json +20 -0
  72. data/spec/fixtures/hello_world/lib/main.js +9 -0
  73. data/spec/fixtures/hello_world/packages/custom_package/assets/dummy.txt +1 -0
  74. data/spec/fixtures/hello_world/packages/custom_package/css/sample_styles.css +3 -0
  75. data/spec/fixtures/hello_world/packages/custom_package/custom_dir/basic-module.js +1 -0
  76. data/spec/fixtures/hello_world/packages/custom_package/lib/main.js +1 -0
  77. data/spec/fixtures/hello_world/packages/custom_package/package.json +22 -0
  78. data/spec/fixtures/hello_world/tests/main-test.js +8 -0
  79. data/spec/fixtures/highline-1.6.1.spd +0 -0
  80. data/spec/fixtures/ivory-0.0.1.spd +0 -0
  81. data/spec/fixtures/jquery-1.4.3.spd +0 -0
  82. data/spec/fixtures/optparse-1.0.1.spd +0 -0
  83. data/spec/fixtures/rake-0.8.6.spd +0 -0
  84. data/spec/fixtures/rake-0.8.7.spd +0 -0
  85. data/spec/fixtures/simple_hello/assets/bpm_packages.js +1 -0
  86. data/spec/fixtures/simple_hello/lib/main.js +1 -0
  87. data/spec/fixtures/spade-0.5.0.spd +0 -0
  88. data/spec/fixtures/src/README.txt +1 -0
  89. data/spec/fixtures/src/bundler-1.1.pre/.gitignore +22 -0
  90. data/spec/fixtures/src/bundler-1.1.pre/CHANGELOG.md +646 -0
  91. data/spec/fixtures/src/bundler-1.1.pre/ISSUES.md +47 -0
  92. data/spec/fixtures/src/bundler-1.1.pre/LICENSE +21 -0
  93. data/spec/fixtures/src/bundler-1.1.pre/README.md +29 -0
  94. data/spec/fixtures/src/bundler-1.1.pre/UPGRADING.md +103 -0
  95. data/spec/fixtures/src/bundler-1.1.pre/bin/bundle +20 -0
  96. data/spec/fixtures/src/bundler-1.1.pre/lib/bundler.js +23 -0
  97. data/spec/fixtures/src/bundler-1.1.pre/lib/bundler/definition.js +14 -0
  98. data/spec/fixtures/src/bundler-1.1.pre/lib/bundler/dependency.js +15 -0
  99. data/spec/fixtures/src/bundler-1.1.pre/lib/bundler/dsl.js +9 -0
  100. data/spec/fixtures/src/bundler-1.1.pre/lib/bundler/ui.js +6 -0
  101. data/spec/fixtures/src/bundler-1.1.pre/man/bundle-config.ronn +90 -0
  102. data/spec/fixtures/src/bundler-1.1.pre/man/bundle-exec.ronn +111 -0
  103. data/spec/fixtures/src/bundler-1.1.pre/man/bundle-install.ronn +314 -0
  104. data/spec/fixtures/src/bundler-1.1.pre/man/bundle-package.ronn +59 -0
  105. data/spec/fixtures/src/bundler-1.1.pre/man/bundle-update.ronn +176 -0
  106. data/spec/fixtures/src/bundler-1.1.pre/man/bundle.ronn +80 -0
  107. data/spec/fixtures/src/bundler-1.1.pre/man/gemfile.5.ronn +279 -0
  108. data/spec/fixtures/src/bundler-1.1.pre/man/index.txt +6 -0
  109. data/spec/fixtures/src/bundler-1.1.pre/package.json +19 -0
  110. data/spec/fixtures/src/coffee-1.0.1.pre/bin/cake +0 -0
  111. data/spec/fixtures/src/coffee-1.0.1.pre/bin/coffee +0 -0
  112. data/spec/fixtures/src/coffee-1.0.1.pre/lib/coffee.js +0 -0
  113. data/spec/fixtures/src/coffee-1.0.1.pre/lib/coffee/base.js +0 -0
  114. data/spec/fixtures/src/coffee-1.0.1.pre/lib/coffee/mocha/chai.js +0 -0
  115. data/spec/fixtures/src/coffee-1.0.1.pre/package.json +19 -0
  116. data/spec/fixtures/src/coffee-1.0.1.pre/qunit/coffee/test.js +0 -0
  117. data/spec/fixtures/src/coffee-1.0.1.pre/qunit/test.js +0 -0
  118. data/spec/fixtures/src/jquery/lib/main.js +7179 -0
  119. data/spec/fixtures/src/jquery/package.json +15 -0
  120. data/spec/fixtures/src/rake-0.8.6/CHANGES +436 -0
  121. data/spec/fixtures/src/rake-0.8.6/MIT-LICENSE +21 -0
  122. data/spec/fixtures/src/rake-0.8.6/README +196 -0
  123. data/spec/fixtures/src/rake-0.8.6/Rakefile +430 -0
  124. data/spec/fixtures/src/rake-0.8.6/TODO +20 -0
  125. data/spec/fixtures/src/rake-0.8.6/bin/rake +31 -0
  126. data/spec/fixtures/src/rake-0.8.6/doc/command_line_usage.rdoc +102 -0
  127. data/spec/fixtures/src/rake-0.8.6/doc/example/Rakefile1 +38 -0
  128. data/spec/fixtures/src/rake-0.8.6/doc/example/Rakefile2 +35 -0
  129. data/spec/fixtures/src/rake-0.8.6/doc/example/a.c +6 -0
  130. data/spec/fixtures/src/rake-0.8.6/doc/example/b.c +6 -0
  131. data/spec/fixtures/src/rake-0.8.6/doc/example/main.c +11 -0
  132. data/spec/fixtures/src/rake-0.8.6/doc/glossary.rdoc +51 -0
  133. data/spec/fixtures/src/rake-0.8.6/doc/jamis.rb +591 -0
  134. data/spec/fixtures/src/rake-0.8.6/doc/proto_rake.rdoc +127 -0
  135. data/spec/fixtures/src/rake-0.8.6/doc/rake.1.gz +0 -0
  136. data/spec/fixtures/src/rake-0.8.6/doc/rakefile.rdoc +534 -0
  137. data/spec/fixtures/src/rake-0.8.6/doc/rational.rdoc +151 -0
  138. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.4.14.rdoc +23 -0
  139. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.4.15.rdoc +35 -0
  140. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.5.0.rdoc +53 -0
  141. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.5.3.rdoc +78 -0
  142. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.5.4.rdoc +46 -0
  143. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.6.0.rdoc +141 -0
  144. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.7.0.rdoc +119 -0
  145. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.7.1.rdoc +59 -0
  146. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.7.2.rdoc +121 -0
  147. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.7.3.rdoc +47 -0
  148. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.8.0.rdoc +114 -0
  149. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.8.2.rdoc +165 -0
  150. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.8.3.rdoc +112 -0
  151. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.8.4.rdoc +147 -0
  152. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.8.5.rdoc +53 -0
  153. data/spec/fixtures/src/rake-0.8.6/doc/release_notes/rake-0.8.6.rdoc +55 -0
  154. data/spec/fixtures/src/rake-0.8.6/install.rb +88 -0
  155. data/spec/fixtures/src/rake-0.8.6/lib/rake.rb +2502 -0
  156. data/spec/fixtures/src/rake-0.8.6/lib/rake/alt_system.rb +108 -0
  157. data/spec/fixtures/src/rake-0.8.6/lib/rake/classic_namespace.rb +8 -0
  158. data/spec/fixtures/src/rake-0.8.6/lib/rake/clean.rb +33 -0
  159. data/spec/fixtures/src/rake-0.8.6/lib/rake/contrib/compositepublisher.rb +24 -0
  160. data/spec/fixtures/src/rake-0.8.6/lib/rake/contrib/ftptools.rb +153 -0
  161. data/spec/fixtures/src/rake-0.8.6/lib/rake/contrib/publisher.rb +75 -0
  162. data/spec/fixtures/src/rake-0.8.6/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  163. data/spec/fixtures/src/rake-0.8.6/lib/rake/contrib/sshpublisher.rb +47 -0
  164. data/spec/fixtures/src/rake-0.8.6/lib/rake/contrib/sys.rb +209 -0
  165. data/spec/fixtures/src/rake-0.8.6/lib/rake/gempackagetask.rb +97 -0
  166. data/spec/fixtures/src/rake-0.8.6/lib/rake/loaders/makefile.rb +42 -0
  167. data/spec/fixtures/src/rake-0.8.6/lib/rake/packagetask.rb +184 -0
  168. data/spec/fixtures/src/rake-0.8.6/lib/rake/rake_test_loader.rb +5 -0
  169. data/spec/fixtures/src/rake-0.8.6/lib/rake/rdoctask.rb +209 -0
  170. data/spec/fixtures/src/rake-0.8.6/lib/rake/ruby182_test_unit_fix.rb +23 -0
  171. data/spec/fixtures/src/rake-0.8.6/lib/rake/runtest.rb +23 -0
  172. data/spec/fixtures/src/rake-0.8.6/lib/rake/tasklib.rb +23 -0
  173. data/spec/fixtures/src/rake-0.8.6/lib/rake/testtask.rb +161 -0
  174. data/spec/fixtures/src/rake-0.8.6/lib/rake/win32.rb +55 -0
  175. data/spec/fixtures/src/rake-0.8.6/package.json +18 -0
  176. data/spec/fixtures/src/rake-0.8.6/test/capture_stdout.rb +26 -0
  177. data/spec/fixtures/src/rake-0.8.7/CHANGES +440 -0
  178. data/spec/fixtures/src/rake-0.8.7/MIT-LICENSE +21 -0
  179. data/spec/fixtures/src/rake-0.8.7/README +196 -0
  180. data/spec/fixtures/src/rake-0.8.7/Rakefile +430 -0
  181. data/spec/fixtures/src/rake-0.8.7/TODO +20 -0
  182. data/spec/fixtures/src/rake-0.8.7/bin/rake +31 -0
  183. data/spec/fixtures/src/rake-0.8.7/doc/command_line_usage.rdoc +102 -0
  184. data/spec/fixtures/src/rake-0.8.7/doc/example/Rakefile1 +38 -0
  185. data/spec/fixtures/src/rake-0.8.7/doc/example/Rakefile2 +35 -0
  186. data/spec/fixtures/src/rake-0.8.7/doc/example/a.c +6 -0
  187. data/spec/fixtures/src/rake-0.8.7/doc/example/b.c +6 -0
  188. data/spec/fixtures/src/rake-0.8.7/doc/example/main.c +11 -0
  189. data/spec/fixtures/src/rake-0.8.7/doc/glossary.rdoc +51 -0
  190. data/spec/fixtures/src/rake-0.8.7/doc/jamis.rb +591 -0
  191. data/spec/fixtures/src/rake-0.8.7/doc/proto_rake.rdoc +127 -0
  192. data/spec/fixtures/src/rake-0.8.7/doc/rake.1.gz +0 -0
  193. data/spec/fixtures/src/rake-0.8.7/doc/rakefile.rdoc +534 -0
  194. data/spec/fixtures/src/rake-0.8.7/doc/rational.rdoc +151 -0
  195. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.4.14.rdoc +23 -0
  196. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.4.15.rdoc +35 -0
  197. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.5.0.rdoc +53 -0
  198. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.5.3.rdoc +78 -0
  199. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.5.4.rdoc +46 -0
  200. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.6.0.rdoc +141 -0
  201. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.7.0.rdoc +119 -0
  202. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.7.1.rdoc +59 -0
  203. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.7.2.rdoc +121 -0
  204. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.7.3.rdoc +47 -0
  205. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.8.0.rdoc +114 -0
  206. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.8.2.rdoc +165 -0
  207. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.8.3.rdoc +112 -0
  208. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.8.4.rdoc +147 -0
  209. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.8.5.rdoc +53 -0
  210. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.8.6.rdoc +55 -0
  211. data/spec/fixtures/src/rake-0.8.7/doc/release_notes/rake-0.8.7.rdoc +55 -0
  212. data/spec/fixtures/src/rake-0.8.7/install.rb +88 -0
  213. data/spec/fixtures/src/rake-0.8.7/lib/rake.rb +2506 -0
  214. data/spec/fixtures/src/rake-0.8.7/lib/rake/alt_system.rb +108 -0
  215. data/spec/fixtures/src/rake-0.8.7/lib/rake/classic_namespace.rb +8 -0
  216. data/spec/fixtures/src/rake-0.8.7/lib/rake/clean.rb +33 -0
  217. data/spec/fixtures/src/rake-0.8.7/lib/rake/contrib/compositepublisher.rb +24 -0
  218. data/spec/fixtures/src/rake-0.8.7/lib/rake/contrib/ftptools.rb +153 -0
  219. data/spec/fixtures/src/rake-0.8.7/lib/rake/contrib/publisher.rb +75 -0
  220. data/spec/fixtures/src/rake-0.8.7/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  221. data/spec/fixtures/src/rake-0.8.7/lib/rake/contrib/sshpublisher.rb +47 -0
  222. data/spec/fixtures/src/rake-0.8.7/lib/rake/contrib/sys.rb +209 -0
  223. data/spec/fixtures/src/rake-0.8.7/lib/rake/gempackagetask.rb +97 -0
  224. data/spec/fixtures/src/rake-0.8.7/lib/rake/loaders/makefile.rb +42 -0
  225. data/spec/fixtures/src/rake-0.8.7/lib/rake/packagetask.rb +184 -0
  226. data/spec/fixtures/src/rake-0.8.7/lib/rake/rake_test_loader.rb +5 -0
  227. data/spec/fixtures/src/rake-0.8.7/lib/rake/rdoctask.rb +209 -0
  228. data/spec/fixtures/src/rake-0.8.7/lib/rake/ruby182_test_unit_fix.rb +23 -0
  229. data/spec/fixtures/src/rake-0.8.7/lib/rake/runtest.rb +23 -0
  230. data/spec/fixtures/src/rake-0.8.7/lib/rake/tasklib.rb +23 -0
  231. data/spec/fixtures/src/rake-0.8.7/lib/rake/testtask.rb +161 -0
  232. data/spec/fixtures/src/rake-0.8.7/lib/rake/win32.rb +55 -0
  233. data/spec/fixtures/src/rake-0.8.7/package.json +18 -0
  234. data/spec/fixtures/src/rake-0.8.7/test/capture_stdout.rb +26 -0
  235. data/spec/fixtures/src/spade/lib/main.js +1 -0
  236. data/spec/fixtures/src/spade/package.json +15 -0
  237. data/spec/fixtures/transporter/lib/main.js +3 -0
  238. data/spec/fixtures/transporter/packages/transport/lib/wrapper.js +5 -0
  239. data/spec/fixtures/transporter/packages/transport/package.json +21 -0
  240. data/spec/fixtures/transporter/transporter.json +18 -0
  241. data/spec/gauntlet_spec.rb +33 -0
  242. data/spec/package_spec.rb +319 -0
  243. data/spec/pipeline_spec.rb +213 -0
  244. data/spec/project_spec.rb +130 -0
  245. data/spec/spec_helper.rb +42 -0
  246. data/spec/support/cli.rb +93 -0
  247. data/spec/support/env.rb +18 -0
  248. data/spec/support/fake.rb +53 -0
  249. data/spec/support/fake_gem_server.rb +72 -0
  250. data/spec/support/fake_gemcutter.rb +50 -0
  251. data/spec/support/matchers.rb +32 -0
  252. data/spec/support/path.rb +63 -0
  253. data/spec/support/project.rb +43 -0
  254. data/templates/init/assets/bpm_packages.js +7 -0
  255. data/templates/init/assets/bpm_styles.css +7 -0
  256. data/templates/init/project.json +16 -0
  257. data/templates/project/LICENSE +19 -0
  258. data/templates/project/README.md +21 -0
  259. data/templates/project/app.js +1 -0
  260. data/templates/project/index.html +13 -0
  261. metadata +627 -0
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2003, 2004 Jim Weirich
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
@@ -0,0 +1,196 @@
1
+ = RAKE -- Ruby Make
2
+
3
+ Supporting Rake version: 0.8.6
4
+
5
+ This package contains Rake, a simple ruby build program with
6
+ capabilities similar to make.
7
+
8
+ Rake has the following features:
9
+
10
+ * Rakefiles (rake's version of Makefiles) are completely defined in
11
+ standard Ruby syntax. No XML files to edit. No quirky Makefile
12
+ syntax to worry about (is that a tab or a space?)
13
+
14
+ * Users can specify tasks with prerequisites.
15
+
16
+ * Rake supports rule patterns to synthesize implicit tasks.
17
+
18
+ * Flexible FileLists that act like arrays but know about manipulating
19
+ file names and paths.
20
+
21
+ * A library of prepackaged tasks to make building rakefiles easier. For example,
22
+ tasks for building tarballs, gems and RDoc output are provided.
23
+
24
+ * Supports parallel execution of tasks.
25
+
26
+
27
+ == Installation
28
+
29
+ === Gem Installation
30
+
31
+ Download and install rake with the following.
32
+
33
+ gem install rake
34
+
35
+ === Normal Installation
36
+
37
+ You can download the source tarball of the latest version of Rake from
38
+
39
+ * http://rubyforge.org/project/showfiles.php?group_id=50
40
+
41
+ Extract the tarball and run
42
+
43
+ % ruby install.rb
44
+
45
+ from its distribution directory.
46
+
47
+ == Usage
48
+
49
+ === Simple Example
50
+
51
+ First, you must write a "Rakefile" file which contains the build rules. Here's
52
+ a simple example:
53
+
54
+ task :default => [:test]
55
+
56
+ task :test do
57
+ ruby "test/unittest.rb"
58
+ end
59
+
60
+ This Rakefile has two tasks:
61
+
62
+ * A task named "test", which - upon invocation - will run a unit test file in
63
+ Ruby.
64
+ * A task named "default". This task does nothing by itself, but it has exactly
65
+ one dependency, namely the "test" task. Invoking the "default" task will
66
+ cause Rake to invoke the "test" task as well.
67
+
68
+ Running the "rake" command without any options will cause it to run the
69
+ "default" task in the Rakefile:
70
+
71
+ % ls
72
+ Rakefile test/
73
+ % rake
74
+ (in /home/some_user/Projects/rake)
75
+ ruby test/unittest.rb
76
+ ....unit test output here...
77
+
78
+ Type "rake --help" for all available options.
79
+
80
+
81
+ === More Information
82
+
83
+ * For details on Rake's command-line invocation, read
84
+ doc/command_line_usage.rdoc[http://rake.rubyforge.org/files/doc/command_line_usage_rdoc.html]
85
+ * For details on writing Rakefiles, see
86
+ doc/rakefile.rdoc[http://rake.rubyforge.org/files/doc/rakefile_rdoc.html].
87
+ * For the original announcement of Rake, see
88
+ doc/rational.rdoc[http://rake.rubyforge.org/files/doc/rational_rdoc.html].
89
+ * For a glossary of terms, see
90
+ doc/glossary.rdoc[http://rake.rubyforge.org/files/doc/glossary_rdoc.html].
91
+
92
+
93
+ == Development
94
+
95
+ === Source Repository
96
+
97
+ Rake is currently hosted at github. The github web page is
98
+ http://github.com/jimweirich/rake. The public git clone URL is
99
+
100
+ * git://github.com/jimweirich/rake.git
101
+
102
+ === Running the Rake Test Suite
103
+
104
+ If you wish to run the unit and functional tests that come with Rake:
105
+
106
+ * Install the 'session' gem in order to run the functional tests.
107
+ * CD into the top project directory of rake.
108
+ * Type one of the following:
109
+
110
+ rake # If you have a version of rake installed
111
+ ruby -Ilib bin/rake # If you do not have a version of rake installed.
112
+
113
+ === Issues and Bug Reports
114
+
115
+ Bugs, features requests and other issues can be logged at
116
+
117
+ * http://onestepback.org/redmine/projects/show/rake
118
+
119
+ You will need an account to before you can post issues. Register at
120
+ http://onestepback.org/redmine/account/register. Or you can send me
121
+ an email (at jim dot weirich at gmail dot com)
122
+
123
+
124
+ == Online Resources
125
+
126
+ === Rake References
127
+
128
+ * Rake Documentation Home: http://docs.rubyrake.org
129
+ * Rake Project Page: http://rubyforge.org/projects/rake
130
+ * Rake API Documents: http://rake.rubyforge.org
131
+ * Rake Source Code Repo: http://github.com/jimweirich/rake
132
+ * Rake Git Repo Clone URL: git://github.com/jimweirich/rake.git
133
+
134
+ === Presentations and Articles about Rake
135
+
136
+ * Jim Weirich's 2003 RubyConf presentation: http://onestepback.org/articles/buildingwithrake/
137
+ * Martin Fowler's article on Rake: http://martinfowler.com/articles/rake.html
138
+
139
+ == Other Make Reinvisionings ...
140
+
141
+ Rake is a late entry in the make replacement field. Here are links to
142
+ other projects with similar (and not so similar) goals.
143
+
144
+ * http://directory.fsf.org/bras.html -- Bras, one of earliest
145
+ implementations of "make in a scripting language".
146
+ * http://www.a-a-p.org -- Make in Python
147
+ * http://www.aromatic.com/tools/jam.txt -- JAM, Java Automated Make
148
+ * http://ant.apache.org -- The Ant project
149
+ * http://ppt.perl.org/commands/make/index.html -- Make from the Perl
150
+ Power Tools implementation.
151
+ * http://search.cpan.org/search?query=PerlBuildSystem -- The Perl Build System
152
+ * http://make.rubyforge.org -- Rant, another Ruby make tool.
153
+
154
+ == Credits
155
+
156
+ [<b>Ryan Dlugosz</b>] For the initial conversation that sparked Rake.
157
+
158
+ [<b>nobu.nokada@softhome.net</b>] For the initial patch for rule support.
159
+
160
+ [<b>Tilman Sauerbeck <tilman@code-monkey.de></b>] For the recursive rule patch.
161
+
162
+ == License
163
+
164
+ Rake is available under an MIT-style license.
165
+
166
+ :include: MIT-LICENSE
167
+
168
+ == Support
169
+
170
+ The Rake homepage is http://rake.rubyforge.org. You can find the Rake
171
+ RubyForge page at http://rubyforge.org/projects/rake.
172
+
173
+ Feel free to submit commits or feature requests. If you send a patch,
174
+ remember to update the corresponding unit tests. If fact, I prefer
175
+ new feature to be submitted in the form of new unit tests.
176
+
177
+ For other information, feel free to ask on the ruby-talk mailing list
178
+ (which is mirrored to comp.lang.ruby) or contact
179
+ jim dot weirich at gmail.com.
180
+
181
+ ---
182
+
183
+ = Other stuff
184
+
185
+ Author:: Jim Weirich <jim.weirich@gmail.com>
186
+ Requires:: Ruby 1.8.0 or later
187
+ License:: Copyright 2003-2008 by Jim Weirich.
188
+ Released under an MIT-style license. See the LICENSE file
189
+ included in the distribution.
190
+
191
+ == Warranty
192
+
193
+ This software is provided "as is" and without any express or
194
+ implied warranties, including, without limitation, the implied
195
+ warranties of merchantibility and fitness for a particular
196
+ purpose.
@@ -0,0 +1,430 @@
1
+ # Rakefile for rake -*- ruby -*-
2
+
3
+ # Copyright 2003, 2004, 2005 by Jim Weirich (jim@weirichhouse.org)
4
+ # All rights reserved.
5
+
6
+ # This file may be distributed under an MIT style license. See
7
+ # MIT-LICENSE for details.
8
+
9
+ begin
10
+ require 'rubygems'
11
+ require 'rake/gempackagetask'
12
+ rescue Exception
13
+ nil
14
+ end
15
+ require 'rake/clean'
16
+ require 'rake/testtask'
17
+ require 'rake/rdoctask'
18
+
19
+ CLEAN.include('**/*.o', '*.dot', '**/.*.rbc')
20
+ CLOBBER.include('doc/example/main', 'testdata')
21
+ CLOBBER.include('test/data/**/temp_*')
22
+ CLOBBER.include('test/data/chains/play.*')
23
+ CLOBBER.include('test/data/file_creation_task/build')
24
+ CLOBBER.include('test/data/file_creation_task/src')
25
+ CLOBBER.include('TAGS')
26
+ CLOBBER.include('coverage', 'rcov_aggregate')
27
+
28
+ # Prevent OS X from including extended attribute junk in the tar output
29
+ ENV['COPY_EXTENDED_ATTRIBUTES_DISABLE'] = 'true'
30
+
31
+ def announce(msg='')
32
+ STDERR.puts msg
33
+ end
34
+
35
+ # Determine the current version of the software
36
+
37
+ if `ruby -Ilib ./bin/rake --version` =~ /rake, version ([0-9.]+)$/
38
+ CURRENT_VERSION = $1
39
+ else
40
+ CURRENT_VERSION = "0.0.0"
41
+ end
42
+
43
+ $package_version = CURRENT_VERSION
44
+
45
+ SRC_RB = FileList['lib/**/*.rb']
46
+
47
+ # The default task is run if rake is given no explicit arguments.
48
+
49
+ desc "Default Task"
50
+ task :default => :test_all
51
+
52
+ # Test Tasks ---------------------------------------------------------
53
+ task :dbg do |t|
54
+ puts "Arguments are: #{t.args.join(', ')}"
55
+ end
56
+
57
+ # Common Abbreviations ...
58
+
59
+ task :ta => :test_all
60
+ task :tf => :test_functional
61
+ task :tu => :test_units
62
+ task :tc => :test_contribs
63
+ task :test => :test_units
64
+
65
+ Rake::TestTask.new(:test_all) do |t|
66
+ t.test_files = FileList[
67
+ 'test/test*.rb',
68
+ 'test/contrib/test*.rb',
69
+ 'test/fun*.rb'
70
+ ]
71
+ t.warning = true
72
+ t.verbose = false
73
+ end
74
+
75
+ Rake::TestTask.new(:test_units) do |t|
76
+ t.test_files = FileList['test/test*.rb']
77
+ t.warning = true
78
+ t.verbose = false
79
+ end
80
+
81
+ Rake::TestTask.new(:test_functional) do |t|
82
+ t.test_files = FileList['test/fun*.rb']
83
+ t.warning = true
84
+ t.verbose = false
85
+ end
86
+
87
+ Rake::TestTask.new(:test_contribs) do |t|
88
+ t.test_files = FileList['test/contrib/test*.rb']
89
+ t.warning = true
90
+ t.verbose = false
91
+ end
92
+
93
+ begin
94
+ require 'rcov/rcovtask'
95
+
96
+ Rcov::RcovTask.new do |t|
97
+ t.libs << "test"
98
+ dot_rakes =
99
+ t.rcov_opts = [
100
+ '-xRakefile', '-xrakefile', '-xpublish.rf',
101
+ '-xlib/rake/contrib', '-x/Library',
102
+ '--text-report',
103
+ '--sort coverage'
104
+ ] + FileList['rakelib/*.rake'].pathmap("-x%p")
105
+ t.test_files = FileList[
106
+ 'test/test*.rb', 'test/functional.rb'
107
+ ]
108
+ t.output_dir = 'coverage'
109
+ t.verbose = true
110
+ end
111
+ rescue LoadError
112
+ puts "RCov is not available"
113
+ end
114
+
115
+ directory 'testdata'
116
+ [:test_all, :test_units, :test_contribs, :test_functional].each do |t|
117
+ task t => ['testdata']
118
+ end
119
+
120
+ # CVS Tasks ----------------------------------------------------------
121
+
122
+ # Install rake using the standard install.rb script.
123
+
124
+ desc "Install the application"
125
+ task :install do
126
+ ruby "install.rb"
127
+ end
128
+
129
+ # Create a task to build the RDOC documentation tree.
130
+
131
+ begin
132
+ require 'darkfish-rdoc'
133
+ DARKFISH_ENABLED = true
134
+ rescue LoadError => ex
135
+ DARKFISH_ENABLED = false
136
+ end
137
+
138
+ BASE_RDOC_OPTIONS = [
139
+ '--line-numbers',
140
+ '--main', 'README',
141
+ '--title', 'Rake -- Ruby Make',
142
+ ]
143
+
144
+ rd = Rake::RDocTask.new("rdoc") do |rdoc|
145
+ rdoc.rdoc_dir = 'html'
146
+ rdoc.template = 'doc/jamis.rb'
147
+ rdoc.title = "Rake -- Ruby Make"
148
+ rdoc.options = BASE_RDOC_OPTIONS.dup
149
+ rdoc.options << '-SHN' << '-f' << 'darkfish' if DARKFISH_ENABLED
150
+
151
+ rdoc.rdoc_files.include('README', 'MIT-LICENSE', 'TODO', 'CHANGES')
152
+ rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
153
+ rdoc.rdoc_files.exclude(/\bcontrib\b/)
154
+ end
155
+
156
+ # ====================================================================
157
+ # Create a task that will package the Rake software into distributable
158
+ # tar, zip and gem files.
159
+
160
+ PKG_FILES = FileList[
161
+ 'install.rb',
162
+ '[A-Z]*',
163
+ 'bin/**/*',
164
+ 'lib/**/*.rb',
165
+ 'test/**/*.rb',
166
+ 'test/**/*.rf',
167
+ 'test/**/*.mf',
168
+ 'test/**/Rakefile',
169
+ 'test/**/subdir',
170
+ 'doc/**/*'
171
+ ]
172
+ PKG_FILES.exclude('doc/example/*.o')
173
+ PKG_FILES.exclude('TAGS')
174
+ PKG_FILES.exclude(%r{doc/example/main$})
175
+
176
+ if ! defined?(Gem)
177
+ puts "Package Target requires RubyGEMs"
178
+ else
179
+ SPEC = Gem::Specification.new do |s|
180
+
181
+ #### Basic information.
182
+
183
+ s.name = 'rake'
184
+ s.version = $package_version
185
+ s.summary = "Ruby based make-like utility."
186
+ s.description = <<-EOF
187
+ Rake is a Make-like program implemented in Ruby. Tasks
188
+ and dependencies are specified in standard Ruby syntax.
189
+ EOF
190
+
191
+ #### Dependencies and requirements.
192
+
193
+ #s.add_dependency('log4r', '> 1.0.4')
194
+ #s.requirements << ""
195
+
196
+ #### Which files are to be included in this gem? Everything! (Except CVS directories.)
197
+
198
+ s.files = PKG_FILES.to_a
199
+
200
+ #### C code extensions.
201
+
202
+ #s.extensions << "ext/rmagic/extconf.rb"
203
+
204
+ #### Load-time details: library and application (you will need one or both).
205
+
206
+ s.require_path = 'lib' # Use these for libraries.
207
+
208
+ s.bindir = "bin" # Use these for applications.
209
+ s.executables = ["rake"]
210
+ s.default_executable = "rake"
211
+
212
+ #### Documentation and testing.
213
+
214
+ s.has_rdoc = true
215
+ s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
216
+ s.rdoc_options = BASE_RDOC_OPTIONS
217
+
218
+ #### Author and project details.
219
+
220
+ s.author = "Jim Weirich"
221
+ s.email = "jim@weirichhouse.org"
222
+ s.homepage = "http://rake.rubyforge.org"
223
+ s.rubyforge_project = "rake"
224
+ # if ENV['CERT_DIR']
225
+ # s.signing_key = File.join(ENV['CERT_DIR'], 'gem-private_key.pem')
226
+ # s.cert_chain = [File.join(ENV['CERT_DIR'], 'gem-public_cert.pem')]
227
+ # end
228
+ end
229
+
230
+ package_task = Rake::GemPackageTask.new(SPEC) do |pkg|
231
+ pkg.need_zip = true
232
+ pkg.need_tar = true
233
+ end
234
+
235
+ file "rake.gemspec" => ["Rakefile", "lib/rake.rb"] do |t|
236
+ require 'yaml'
237
+ open(t.name, "w") { |f| f.puts SPEC.to_yaml }
238
+ end
239
+
240
+ desc "Create a stand-alone gemspec"
241
+ task :gemspec => "rake.gemspec"
242
+ end
243
+
244
+ # Misc tasks =========================================================
245
+
246
+ def count_lines(filename)
247
+ lines = 0
248
+ codelines = 0
249
+ open(filename) { |f|
250
+ f.each do |line|
251
+ lines += 1
252
+ next if line =~ /^\s*$/
253
+ next if line =~ /^\s*#/
254
+ codelines += 1
255
+ end
256
+ }
257
+ [lines, codelines]
258
+ end
259
+
260
+ def show_line(msg, lines, loc)
261
+ printf "%6s %6s %s\n", lines.to_s, loc.to_s, msg
262
+ end
263
+
264
+ desc "Count lines in the main rake file"
265
+ task :lines do
266
+ total_lines = 0
267
+ total_code = 0
268
+ show_line("File Name", "LINES", "LOC")
269
+ SRC_RB.each do |fn|
270
+ lines, codelines = count_lines(fn)
271
+ show_line(fn, lines, codelines)
272
+ total_lines += lines
273
+ total_code += codelines
274
+ end
275
+ show_line("TOTAL", total_lines, total_code)
276
+ end
277
+
278
+ # Define an optional publish target in an external file. If the
279
+ # publish.rf file is not found, the publish targets won't be defined.
280
+
281
+ load "publish.rf" if File.exist? "publish.rf"
282
+
283
+ # Support Tasks ------------------------------------------------------
284
+
285
+ RUBY_FILES = FileList['**/*.rb'].exclude('pkg')
286
+
287
+ desc "Look for TODO and FIXME tags in the code"
288
+ task :todo do
289
+ RUBY_FILES.egrep(/#.*(FIXME|TODO|TBD)/)
290
+ end
291
+
292
+ desc "Look for Debugging print lines"
293
+ task :dbg do
294
+ RUBY_FILES.egrep(/\bDBG|\bbreakpoint\b/)
295
+ end
296
+
297
+ desc "List all ruby files"
298
+ task :rubyfiles do
299
+ puts RUBY_FILES
300
+ puts FileList['bin/*'].exclude('bin/*.rb')
301
+ end
302
+ task :rf => :rubyfiles
303
+
304
+ desc "Create a TAGS file"
305
+ task :tags => "TAGS"
306
+
307
+ TAGS = 'xctags -e'
308
+
309
+ file "TAGS" => RUBY_FILES do
310
+ puts "Makings TAGS"
311
+ sh "#{TAGS} #{RUBY_FILES}", :verbose => false
312
+ end
313
+
314
+ # --------------------------------------------------------------------
315
+ # Creating a release
316
+
317
+ def plugin(plugin_name)
318
+ require "rake/plugins/#{plugin_name}"
319
+ end
320
+
321
+ task :noop
322
+ #plugin "release_manager"
323
+
324
+ desc "Make a new release"
325
+ task :release, :rel, :reuse, :reltest,
326
+ :needs => [
327
+ :prerelease,
328
+ :clobber,
329
+ :test_all,
330
+ :update_version,
331
+ :package,
332
+ :tag
333
+ ] do
334
+ announce
335
+ announce "**************************************************************"
336
+ announce "* Release #{$package_version} Complete."
337
+ announce "* Packages ready to upload."
338
+ announce "**************************************************************"
339
+ announce
340
+ end
341
+
342
+ # Validate that everything is ready to go for a release.
343
+ task :prerelease, :rel, :reuse, :reltest do |t, args|
344
+ $package_version = args.rel
345
+ announce
346
+ announce "**************************************************************"
347
+ announce "* Making RubyGem Release #{$package_version}"
348
+ announce "* (current version #{CURRENT_VERSION})"
349
+ announce "**************************************************************"
350
+ announce
351
+
352
+ # Is a release number supplied?
353
+ unless args.rel
354
+ fail "Usage: rake release[X.Y.Z] [REUSE=tag_suffix]"
355
+ end
356
+
357
+ # Is the release different than the current release.
358
+ # (or is REUSE set?)
359
+ if $package_version == CURRENT_VERSION && ! args.reuse
360
+ fail "Current version is #{$package_version}, must specify REUSE=tag_suffix to reuse version"
361
+ end
362
+
363
+ # Are all source files checked in?
364
+ if args.reltest
365
+ announce "Release Task Testing, skipping checked-in file test"
366
+ else
367
+ announce "Checking for unchecked-in files..."
368
+ data = `svn st`
369
+ unless data =~ /^$/
370
+ abort "svn status is not clean ... do you have unchecked-in files?"
371
+ end
372
+ announce "No outstanding checkins found ... OK"
373
+ end
374
+ end
375
+
376
+ task :update_version, :rel, :reuse, :reltest,
377
+ :needs => [:prerelease] do |t, args|
378
+ if args.rel == CURRENT_VERSION
379
+ announce "No version change ... skipping version update"
380
+ else
381
+ announce "Updating Rake version to #{args.rel}"
382
+ open("lib/rake.rb") do |rakein|
383
+ open("lib/rake.rb.new", "w") do |rakeout|
384
+ rakein.each do |line|
385
+ if line =~ /^RAKEVERSION\s*=\s*/
386
+ rakeout.puts "RAKEVERSION = '#{args.rel}'"
387
+ else
388
+ rakeout.puts line
389
+ end
390
+ end
391
+ end
392
+ end
393
+ mv "lib/rake.rb.new", "lib/rake.rb"
394
+ if args.reltest
395
+ announce "Release Task Testing, skipping commiting of new version"
396
+ else
397
+ sh %{svn commit -m "Updated to version #{args.rel}" lib/rake.rb} # "
398
+ end
399
+ end
400
+ end
401
+
402
+ desc "Tag all the CVS files with the latest release number (REL=x.y.z)"
403
+ task :tag, :rel, :reuse, :reltest,
404
+ :needs => [:prerelease] do |t, args|
405
+ reltag = "REL_#{args.rel.gsub(/\./, '_')}"
406
+ reltag << args.reuse.gsub(/\./, '_') if args.reuse
407
+ announce "Tagging Repository with [#{reltag}]"
408
+ if args.reltest
409
+ announce "Release Task Testing, skipping CVS tagging"
410
+ else
411
+ sh %{svn copy svn+ssh://rubyforge.org/var/svn/rake/trunk svn+ssh://rubyforge.org/var/svn/rake/tags/#{reltag} -m 'Commiting release #{reltag}'} ###'
412
+ end
413
+ end
414
+
415
+ desc "Install the jamis RDoc template"
416
+ task :install_jamis_template do
417
+ require 'rbconfig'
418
+ dest_dir = File.join(Config::CONFIG['rubylibdir'], "rdoc/generators/template/html")
419
+ fail "Unabled to write to #{dest_dir}" unless File.writable?(dest_dir)
420
+ install "doc/jamis.rb", dest_dir, :verbose => true
421
+ end
422
+
423
+ # Require experimental XForge/Metaproject support.
424
+
425
+ load 'xforge.rf' if File.exist?('xforge.rf')
426
+
427
+ desc "Where is the current directory. This task displays\nthe current rake directory"
428
+ task :where_am_i do
429
+ puts Rake.original_dir
430
+ end