bpm 0.1.4 → 1.0.0.beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (341) hide show
  1. data/CHANGELOG.md +20 -0
  2. data/README.md +1 -1
  3. data/TODO.md +90 -2
  4. data/bpm.gemspec +3 -3
  5. data/lib/bpm/cli/base.rb +103 -52
  6. data/lib/bpm/errors.rb +51 -0
  7. data/lib/bpm/init_generator.rb +1 -8
  8. data/lib/bpm/libgems_ext/libgems.rb +9 -0
  9. data/lib/bpm/local.rb +6 -11
  10. data/lib/bpm/package.rb +272 -178
  11. data/lib/bpm/pipeline/generated_asset.rb +88 -28
  12. data/lib/bpm/pipeline/plugin_asset.rb +8 -2
  13. data/lib/bpm/pipeline/source_url_processor.rb +16 -0
  14. data/lib/bpm/pipeline/transport_processor.rb +5 -3
  15. data/lib/bpm/pipeline.rb +33 -23
  16. data/lib/bpm/project.rb +492 -167
  17. data/lib/bpm/project_generator.rb +14 -1
  18. data/lib/bpm/remote.rb +6 -4
  19. data/lib/bpm/server.rb +4 -15
  20. data/lib/bpm/version.rb +2 -1
  21. data/lib/bpm.rb +2 -0
  22. data/man/bpm-add.1.ronn +22 -0
  23. data/man/bpm-build.1.ronn +22 -0
  24. data/man/bpm-compile.1.ronn +23 -0
  25. data/man/bpm-config.7.ronn +21 -0
  26. data/man/bpm-fetch.1.ronn +22 -0
  27. data/man/bpm-fetched.1.ronn +22 -0
  28. data/man/bpm-init.1.ronn +22 -0
  29. data/man/bpm-list.1.ronn +22 -0
  30. data/man/bpm-login.1.ronn +22 -0
  31. data/man/bpm-new.1.ronn +22 -0
  32. data/man/bpm-owner.1.ronn +22 -0
  33. data/man/bpm-preview.1.ronn +22 -0
  34. data/man/bpm-push.1.ronn +22 -0
  35. data/man/bpm-remove.1.ronn +22 -0
  36. data/man/bpm-unpack.1.ronn +22 -0
  37. data/man/bpm-yank.1.ronn +22 -0
  38. data/man/bpm.1.ronn +31 -0
  39. data/spec/cli/add_spec.rb +26 -7
  40. data/spec/cli/fetch_spec.rb +15 -6
  41. data/spec/cli/init_spec.rb +165 -25
  42. data/spec/cli/{build_spec.rb → pack_spec.rb} +9 -10
  43. data/spec/cli/push_spec.rb +4 -4
  44. data/spec/cli/rebuild_spec.rb +181 -0
  45. data/spec/cli/remove_spec.rb +3 -4
  46. data/spec/cli/unpack_spec.rb +6 -6
  47. data/spec/fixtures/gems/core-test-0.4.9.bpkg +0 -0
  48. data/spec/fixtures/{core-test-0.4.9.bpkg → gems/uglify-js-1.0.4.bpkg} +0 -0
  49. data/spec/fixtures/packages/core-test/extras/extra_file.html +3 -0
  50. data/spec/fixtures/packages/core-test/index.html +3 -0
  51. data/spec/fixtures/{core-test → packages/core-test}/package.json +9 -3
  52. data/spec/fixtures/packages/invalid_json/package.json +3 -0
  53. data/spec/fixtures/packages/uglify-js/README.html +825 -0
  54. data/spec/fixtures/packages/uglify-js/README.org +431 -0
  55. data/spec/fixtures/packages/uglify-js/bin/uglifyjs +305 -0
  56. data/spec/fixtures/packages/uglify-js/docstyle.css +75 -0
  57. data/spec/fixtures/packages/uglify-js/lib/parse-js.js +1 -0
  58. data/spec/fixtures/packages/uglify-js/lib/process.js +1 -0
  59. data/spec/fixtures/packages/uglify-js/lib/squeeze-more.js +1 -0
  60. data/spec/fixtures/packages/uglify-js/package.json +27 -0
  61. data/spec/fixtures/packages/uglify-js/plugins/minifier.js +6 -0
  62. data/spec/fixtures/packages/uglify-js/uglify-js.js +17 -0
  63. data/spec/fixtures/projects/hello2/README.md +21 -0
  64. data/{templates/init → spec/fixtures/projects/hello2}/assets/bpm_packages.js +6 -1
  65. data/{templates/init → spec/fixtures/projects/hello2}/assets/bpm_styles.css +1 -1
  66. data/spec/fixtures/projects/hello2/hello2.json +16 -0
  67. data/spec/fixtures/projects/hello2/index.html +13 -0
  68. data/spec/fixtures/projects/hello2/packages/a/lib/main.js +2 -0
  69. data/spec/fixtures/projects/hello2/packages/a/package.json +17 -0
  70. data/spec/fixtures/projects/hello2/packages/b/lib/main.js +2 -0
  71. data/spec/fixtures/projects/hello2/packages/b/package.json +17 -0
  72. data/spec/fixtures/projects/hello2/packages/c/lib/main.js +2 -0
  73. data/spec/fixtures/projects/hello2/packages/c/package.json +16 -0
  74. data/spec/fixtures/projects/hello_dev/LICENSE +19 -0
  75. data/spec/fixtures/projects/hello_dev/README.md +21 -0
  76. data/spec/fixtures/projects/hello_dev/app/main.js +6 -0
  77. data/spec/fixtures/projects/hello_dev/assets/bpm_libs.js +5 -0
  78. data/spec/fixtures/projects/hello_dev/assets/bpm_styles.css +6 -0
  79. data/spec/fixtures/projects/hello_dev/css/main.css +1 -0
  80. data/spec/fixtures/projects/hello_dev/hello_dev.json +25 -0
  81. data/spec/fixtures/projects/hello_dev/index.html +14 -0
  82. data/spec/fixtures/projects/hello_dev/packages/style_package/css/some_style.css +3 -0
  83. data/spec/fixtures/{minitest/minitest.json → projects/hello_dev/packages/style_package/package.json} +5 -9
  84. data/spec/fixtures/projects/hello_world/LICENSE +19 -0
  85. data/spec/fixtures/projects/hello_world/assets/bpm_packages.js +1 -0
  86. data/spec/fixtures/projects/hello_world/assets/bpm_styles.css +1 -0
  87. data/spec/fixtures/projects/hello_world/custom_dir/custom.js +1 -0
  88. data/spec/fixtures/projects/hello_world/hello_world.json +41 -0
  89. data/spec/fixtures/projects/hello_world/lib/another.js +1 -0
  90. data/spec/fixtures/{hello_world → projects/hello_world}/packages/custom_package/package.json +5 -2
  91. data/spec/fixtures/projects/hello_world/vendor/lib/something.js +1 -0
  92. data/spec/fixtures/projects/init_app/assets/bpm_libs.js +6 -0
  93. data/spec/fixtures/projects/init_app/assets/bpm_styles.css +5 -0
  94. data/spec/fixtures/projects/init_app/assets/new_project/bpm_libs.js +6 -0
  95. data/spec/fixtures/projects/init_app/assets/new_project/bpm_styles.css +5 -0
  96. data/spec/fixtures/projects/init_app/new_project.json +27 -0
  97. data/spec/fixtures/projects/init_default/assets/bpm_libs.js +6 -0
  98. data/spec/fixtures/projects/init_default/assets/bpm_styles.css +5 -0
  99. data/spec/fixtures/projects/init_default/new_project.json +15 -0
  100. data/spec/fixtures/projects/minitest/minitest.json +26 -0
  101. data/spec/fixtures/{minitest → projects/minitest}/packages/uglyduck/package.json +1 -1
  102. data/spec/fixtures/projects/needs_rake/needs_rake.json +7 -0
  103. data/spec/fixtures/{transporter → projects/transporter}/packages/transport/package.json +1 -1
  104. data/spec/package_spec.rb +343 -315
  105. data/spec/pipeline_spec.rb +89 -71
  106. data/spec/plugins/minifier_spec.rb +25 -16
  107. data/spec/plugins/transport_spec.rb +1 -1
  108. data/spec/project_spec.rb +97 -34
  109. data/spec/spec_helper.rb +41 -0
  110. data/spec/support/fake_gem_server.rb +8 -4
  111. data/spec/support/path.rb +8 -0
  112. data/spec/support/project.rb +50 -17
  113. data/templates/init/project.json +12 -14
  114. data/templates/project/LICENSE +1 -1
  115. data/templates/project/app/main.js +6 -0
  116. data/templates/project/css/main.css +1 -0
  117. data/templates/project/index.html +4 -3
  118. data/vendor/sprockets/.travis.yml +3 -2
  119. data/vendor/sprockets/Gemfile +0 -6
  120. data/vendor/sprockets/lib/sprockets/asset.rb +7 -12
  121. data/vendor/sprockets/lib/sprockets/asset_attributes.rb +70 -53
  122. data/vendor/sprockets/lib/sprockets/base.rb +1 -14
  123. data/vendor/sprockets/lib/sprockets/bundled_asset.rb +72 -45
  124. data/vendor/sprockets/lib/sprockets/caching.rb +28 -23
  125. data/vendor/sprockets/lib/sprockets/context.rb +56 -26
  126. data/vendor/sprockets/lib/sprockets/directive_processor.rb +21 -4
  127. data/vendor/sprockets/lib/sprockets/eco_template.rb +3 -4
  128. data/vendor/sprockets/lib/sprockets/ejs_template.rb +3 -4
  129. data/vendor/sprockets/lib/sprockets/engines.rb +26 -1
  130. data/vendor/sprockets/lib/sprockets/environment.rb +2 -1
  131. data/vendor/sprockets/lib/sprockets/index.rb +1 -0
  132. data/vendor/sprockets/lib/sprockets/mime.rb +38 -0
  133. data/vendor/sprockets/lib/sprockets/processing.rb +4 -45
  134. data/vendor/sprockets/lib/sprockets/static_asset.rb +5 -6
  135. data/vendor/sprockets/lib/sprockets/static_compilation.rb +4 -12
  136. data/vendor/sprockets/lib/sprockets/trail.rb +2 -1
  137. data/vendor/sprockets/test/fixtures/default/blank.gif +0 -0
  138. data/vendor/sprockets/test/fixtures/default/with_data_uri.css.erb +3 -0
  139. data/vendor/sprockets/test/test_asset.rb +121 -15
  140. data/vendor/sprockets/test/test_asset_attributes.rb +85 -21
  141. data/vendor/sprockets/test/test_environment.rb +13 -36
  142. metadata +564 -444
  143. data/spec/cli/new_spec.rb +0 -118
  144. data/spec/fixtures/hello_world/assets/bpm_packages.js +0 -13
  145. data/spec/fixtures/hello_world/assets/bpm_styles.css +0 -14
  146. data/spec/fixtures/hello_world/hello_world.json +0 -20
  147. /data/spec/fixtures/{badrake-0.8.7.bpkg → gems/badrake-0.8.7.bpkg} +0 -0
  148. /data/spec/fixtures/{builder-3.0.0.bpkg → gems/builder-3.0.0.bpkg} +0 -0
  149. /data/spec/fixtures/{bundler-1.1.pre.bpkg → gems/bundler-1.1.pre.bpkg} +0 -0
  150. /data/spec/fixtures/{coffee-1.0.1.pre.bpkg → gems/coffee-1.0.1.pre.bpkg} +0 -0
  151. /data/spec/fixtures/{custom_generator-1.0.bpkg → gems/custom_generator-1.0.bpkg} +0 -0
  152. /data/spec/fixtures/{highline-1.6.1.bpkg → gems/highline-1.6.1.bpkg} +0 -0
  153. /data/spec/fixtures/{ivory-0.0.1.bpkg → gems/ivory-0.0.1.bpkg} +0 -0
  154. /data/spec/fixtures/{jquery-1.4.3.bpkg → gems/jquery-1.4.3.bpkg} +0 -0
  155. /data/spec/fixtures/{optparse-1.0.1.bpkg → gems/optparse-1.0.1.bpkg} +0 -0
  156. /data/spec/fixtures/{rake-0.8.6.bpkg → gems/rake-0.8.6.bpkg} +0 -0
  157. /data/spec/fixtures/{rake-0.8.7.bpkg → gems/rake-0.8.7.bpkg} +0 -0
  158. /data/spec/fixtures/{spade-0.5.0.bpkg → gems/spade-0.5.0.bpkg} +0 -0
  159. /data/spec/fixtures/{src → packages}/README.txt +0 -0
  160. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/.gitignore +0 -0
  161. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/CHANGELOG.md +0 -0
  162. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/ISSUES.md +0 -0
  163. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/LICENSE +0 -0
  164. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/README.md +0 -0
  165. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/UPGRADING.md +0 -0
  166. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/bin/bundle +0 -0
  167. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/lib/bundler/definition.js +0 -0
  168. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/lib/bundler/dependency.js +0 -0
  169. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/lib/bundler/dsl.js +0 -0
  170. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/lib/bundler/ui.js +0 -0
  171. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/lib/bundler.js +0 -0
  172. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/bundle-config.ronn +0 -0
  173. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/bundle-exec.ronn +0 -0
  174. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/bundle-install.ronn +0 -0
  175. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/bundle-package.ronn +0 -0
  176. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/bundle-update.ronn +0 -0
  177. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/bundle.ronn +0 -0
  178. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/gemfile.5.ronn +0 -0
  179. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/index.txt +0 -0
  180. /data/spec/fixtures/{src → packages}/bundler-1.1.pre/package.json +0 -0
  181. /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/bin/cake +0 -0
  182. /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/bin/coffee +0 -0
  183. /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/lib/coffee/base.js +0 -0
  184. /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/lib/coffee/mocha/chai.js +0 -0
  185. /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/lib/coffee.js +0 -0
  186. /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/package.json +0 -0
  187. /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/qunit/coffee/test.js +0 -0
  188. /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/qunit/test.js +0 -0
  189. /data/spec/fixtures/{core-test → packages/core-test}/bin/cot +0 -0
  190. /data/spec/fixtures/{core-test → packages/core-test}/lib/main.js +0 -0
  191. /data/spec/fixtures/{core-test → packages/core-test}/resources/runner.css +0 -0
  192. /data/spec/fixtures/{core-test → packages/core-test}/tests/test.js +0 -0
  193. /data/spec/fixtures/{custom_generator → packages/custom_generator}/lib/main.js +0 -0
  194. /data/spec/fixtures/{custom_generator → packages/custom_generator}/package.json +0 -0
  195. /data/spec/fixtures/{custom_generator → packages/custom_generator}/templates/init/project.json +0 -0
  196. /data/spec/fixtures/{custom_generator → packages/custom_generator}/templates/project/app.js +0 -0
  197. /data/spec/fixtures/{custom_generator → packages/custom_generator}/templates/project/lib/main.js +0 -0
  198. /data/spec/fixtures/{custom_generator → packages/custom_generator}/templates/project_generator.rb +0 -0
  199. /data/spec/fixtures/{src → packages}/jquery/lib/main.js +0 -0
  200. /data/spec/fixtures/{src → packages}/jquery/package.json +0 -0
  201. /data/spec/fixtures/{src → packages}/rake-0.8.6/CHANGES +0 -0
  202. /data/spec/fixtures/{src → packages}/rake-0.8.6/MIT-LICENSE +0 -0
  203. /data/spec/fixtures/{src → packages}/rake-0.8.6/README +0 -0
  204. /data/spec/fixtures/{src → packages}/rake-0.8.6/Rakefile +0 -0
  205. /data/spec/fixtures/{src → packages}/rake-0.8.6/TODO +0 -0
  206. /data/spec/fixtures/{src → packages}/rake-0.8.6/bin/rake +0 -0
  207. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/command_line_usage.rdoc +0 -0
  208. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/example/Rakefile1 +0 -0
  209. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/example/Rakefile2 +0 -0
  210. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/example/a.c +0 -0
  211. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/example/b.c +0 -0
  212. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/example/main.c +0 -0
  213. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/glossary.rdoc +0 -0
  214. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/jamis.rb +0 -0
  215. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/proto_rake.rdoc +0 -0
  216. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/rake.1.gz +0 -0
  217. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/rakefile.rdoc +0 -0
  218. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/rational.rdoc +0 -0
  219. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.4.14.rdoc +0 -0
  220. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.4.15.rdoc +0 -0
  221. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.5.0.rdoc +0 -0
  222. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.5.3.rdoc +0 -0
  223. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.5.4.rdoc +0 -0
  224. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.6.0.rdoc +0 -0
  225. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.7.0.rdoc +0 -0
  226. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.7.1.rdoc +0 -0
  227. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.7.2.rdoc +0 -0
  228. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.7.3.rdoc +0 -0
  229. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.8.0.rdoc +0 -0
  230. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.8.2.rdoc +0 -0
  231. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.8.3.rdoc +0 -0
  232. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.8.4.rdoc +0 -0
  233. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.8.5.rdoc +0 -0
  234. /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.8.6.rdoc +0 -0
  235. /data/spec/fixtures/{src → packages}/rake-0.8.6/install.rb +0 -0
  236. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/alt_system.rb +0 -0
  237. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/classic_namespace.rb +0 -0
  238. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/clean.rb +0 -0
  239. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/contrib/compositepublisher.rb +0 -0
  240. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/contrib/ftptools.rb +0 -0
  241. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/contrib/publisher.rb +0 -0
  242. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/contrib/rubyforgepublisher.rb +0 -0
  243. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/contrib/sshpublisher.rb +0 -0
  244. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/contrib/sys.rb +0 -0
  245. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/gempackagetask.rb +0 -0
  246. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/loaders/makefile.rb +0 -0
  247. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/packagetask.rb +0 -0
  248. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/rake_test_loader.rb +0 -0
  249. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/rdoctask.rb +0 -0
  250. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/ruby182_test_unit_fix.rb +0 -0
  251. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/runtest.rb +0 -0
  252. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/tasklib.rb +0 -0
  253. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/testtask.rb +0 -0
  254. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/win32.rb +0 -0
  255. /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake.rb +0 -0
  256. /data/spec/fixtures/{src → packages}/rake-0.8.6/package.json +0 -0
  257. /data/spec/fixtures/{src → packages}/rake-0.8.6/test/capture_stdout.rb +0 -0
  258. /data/spec/fixtures/{src → packages}/rake-0.8.7/CHANGES +0 -0
  259. /data/spec/fixtures/{src → packages}/rake-0.8.7/MIT-LICENSE +0 -0
  260. /data/spec/fixtures/{src → packages}/rake-0.8.7/README +0 -0
  261. /data/spec/fixtures/{src → packages}/rake-0.8.7/Rakefile +0 -0
  262. /data/spec/fixtures/{src → packages}/rake-0.8.7/TODO +0 -0
  263. /data/spec/fixtures/{src → packages}/rake-0.8.7/bin/rake +0 -0
  264. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/command_line_usage.rdoc +0 -0
  265. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/example/Rakefile1 +0 -0
  266. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/example/Rakefile2 +0 -0
  267. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/example/a.c +0 -0
  268. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/example/b.c +0 -0
  269. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/example/main.c +0 -0
  270. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/glossary.rdoc +0 -0
  271. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/jamis.rb +0 -0
  272. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/proto_rake.rdoc +0 -0
  273. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/rake.1.gz +0 -0
  274. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/rakefile.rdoc +0 -0
  275. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/rational.rdoc +0 -0
  276. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.4.14.rdoc +0 -0
  277. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.4.15.rdoc +0 -0
  278. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.5.0.rdoc +0 -0
  279. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.5.3.rdoc +0 -0
  280. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.5.4.rdoc +0 -0
  281. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.6.0.rdoc +0 -0
  282. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.7.0.rdoc +0 -0
  283. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.7.1.rdoc +0 -0
  284. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.7.2.rdoc +0 -0
  285. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.7.3.rdoc +0 -0
  286. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.0.rdoc +0 -0
  287. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.2.rdoc +0 -0
  288. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.3.rdoc +0 -0
  289. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.4.rdoc +0 -0
  290. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.5.rdoc +0 -0
  291. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.6.rdoc +0 -0
  292. /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.7.rdoc +0 -0
  293. /data/spec/fixtures/{src → packages}/rake-0.8.7/install.rb +0 -0
  294. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/alt_system.rb +0 -0
  295. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/classic_namespace.rb +0 -0
  296. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/clean.rb +0 -0
  297. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/contrib/compositepublisher.rb +0 -0
  298. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/contrib/ftptools.rb +0 -0
  299. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/contrib/publisher.rb +0 -0
  300. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/contrib/rubyforgepublisher.rb +0 -0
  301. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/contrib/sshpublisher.rb +0 -0
  302. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/contrib/sys.rb +0 -0
  303. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/gempackagetask.rb +0 -0
  304. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/loaders/makefile.rb +0 -0
  305. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/packagetask.rb +0 -0
  306. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/rake_test_loader.rb +0 -0
  307. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/rdoctask.rb +0 -0
  308. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/ruby182_test_unit_fix.rb +0 -0
  309. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/runtest.rb +0 -0
  310. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/tasklib.rb +0 -0
  311. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/testtask.rb +0 -0
  312. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/win32.rb +0 -0
  313. /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake.rb +0 -0
  314. /data/spec/fixtures/{src → packages}/rake-0.8.7/package.json +0 -0
  315. /data/spec/fixtures/{src → packages}/rake-0.8.7/test/capture_stdout.rb +0 -0
  316. /data/spec/fixtures/{src → packages}/spade/lib/main.js +0 -0
  317. /data/spec/fixtures/{src → packages}/spade/package.json +0 -0
  318. /data/spec/fixtures/{custom_name → projects/custom_name}/MyProject.json +0 -0
  319. /data/spec/fixtures/{hello_world → projects/hello2}/LICENSE +0 -0
  320. /data/{templates/project → spec/fixtures/projects/hello2}/app.js +0 -0
  321. /data/spec/fixtures/{hello_world → projects/hello_world}/README.md +0 -0
  322. /data/spec/fixtures/{hello_world → projects/hello_world}/assets/papa-smurf.jpg +0 -0
  323. /data/spec/fixtures/{hello_world → projects/hello_world}/css/dummy.css +0 -0
  324. /data/spec/fixtures/{hello_world → projects/hello_world}/lib/main.js +0 -0
  325. /data/spec/fixtures/{hello_world → projects/hello_world}/packages/custom_package/assets/dummy.txt +0 -0
  326. /data/spec/fixtures/{hello_world → projects/hello_world}/packages/custom_package/css/sample_styles.css +0 -0
  327. /data/spec/fixtures/{hello_world → projects/hello_world}/packages/custom_package/custom_dir/basic-module.js +0 -0
  328. /data/spec/fixtures/{hello_world → projects/hello_world}/packages/custom_package/lib/main.js +0 -0
  329. /data/spec/fixtures/{hello_world → projects/hello_world}/tests/main-test.js +0 -0
  330. /data/spec/fixtures/{minitest → projects/minitest}/assets/bpm_packages.js +0 -0
  331. /data/spec/fixtures/{minitest → projects/minitest}/assets/bpm_styles.css +0 -0
  332. /data/spec/fixtures/{minitest → projects/minitest}/assets/minitest/app_package.js +0 -0
  333. /data/spec/fixtures/{minitest → projects/minitest}/lib/main.js +0 -0
  334. /data/spec/fixtures/{minitest → projects/minitest}/packages/uglyduck/lib/main.js +0 -0
  335. /data/spec/fixtures/{minitest → projects/minitest}/packages/uglyduck/minifier/main.js +0 -0
  336. /data/spec/fixtures/{simple_hello/assets/bpm_packages.js → projects/simple_hello/assets/bpm_libs.js} +0 -0
  337. /data/spec/fixtures/{simple_hello → projects/simple_hello}/lib/main.js +0 -0
  338. /data/spec/fixtures/{transporter → projects/transporter}/lib/main.js +0 -0
  339. /data/spec/fixtures/{transporter → projects/transporter}/packages/transport/lib/main.js +0 -0
  340. /data/spec/fixtures/{transporter → projects/transporter}/packages/transport/transports/wrapper.js +0 -0
  341. /data/spec/fixtures/{transporter → projects/transporter}/transporter.json +0 -0
@@ -7,19 +7,32 @@ module BPM
7
7
  return false if directory_exists?
8
8
 
9
9
  empty_directory '.', :verbose => false
10
+ empty_directory 'app'
10
11
 
11
12
  create_files
12
13
 
13
14
  true
14
15
  end
15
16
 
17
+ def company_name
18
+ ENV['COMPANY_NAME'] || "My Company Inc."
19
+ end
20
+
16
21
  private
17
22
 
18
23
  def create_files
19
24
  template "LICENSE"
20
25
  template "README.md"
21
26
  template "index.html"
22
- template "app.js"
27
+
28
+ inside 'app' do
29
+ template 'main.js'
30
+ end
31
+
32
+ inside 'css' do
33
+ template 'main.css'
34
+ end
35
+
23
36
  end
24
37
 
25
38
  def directory_exists?
data/lib/bpm/remote.rb CHANGED
@@ -78,16 +78,18 @@ module BPM
78
78
  end
79
79
 
80
80
  def install(package, version, prerelease)
81
- inst = LibGems::DependencyInstaller.new(:prerelease => prerelease)
82
- inst.install package, LibGems::Requirement.new([version])
83
- inst.installed_gems
81
+ LibGems.with_silence do
82
+ inst = LibGems::DependencyInstaller.new(:prerelease => prerelease)
83
+ inst.install package, LibGems::Requirement.new([version])
84
+ inst.installed_gems
85
+ end
84
86
  end
85
87
 
86
88
  private
87
89
 
88
90
  def raw_request(method, path, &block)
89
91
  require 'net/http'
90
- host = ENV['SPADE_HOST'] || LibGems.host
92
+ host = ENV['BPM_HOST'] || LibGems.host
91
93
  uri = URI.parse "#{host}/#{path}"
92
94
 
93
95
  request_method = Net::HTTP.const_get method.to_s.capitalize
data/lib/bpm/server.rb CHANGED
@@ -3,24 +3,11 @@ require 'sprockets'
3
3
 
4
4
  module BPM
5
5
 
6
- class Trial
7
-
8
- def initialize(app)
9
- @app = app
10
- end
11
-
12
- def call(env)
13
- puts env.to_json
14
- ret = @app.call(env)
15
- puts "RET = \n #{ret * "\n "}"
16
- ret
17
- end
18
- end
19
-
20
6
  class Server < Rack::Server
21
7
 
22
8
  def initialize(project, options=nil)
23
9
  @project = project
10
+ @mode = (options && options[:mode]) || :debug
24
11
  super options
25
12
  end
26
13
 
@@ -29,13 +16,15 @@ module BPM
29
16
  end
30
17
 
31
18
  attr_reader :project
19
+ attr_reader :mode
32
20
 
33
21
  def app
34
22
  cur_project = @project
23
+ cur_mode = @mode
35
24
 
36
25
  @app ||= Rack::Builder.new do
37
26
  map '/assets' do
38
- run BPM::Trial.new(BPM::Pipeline.new cur_project)
27
+ run BPM::Pipeline.new cur_project, cur_mode, true
39
28
  end
40
29
 
41
30
  map '/' do
data/lib/bpm/version.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  module BPM
2
- VERSION = "0.1.4"
2
+ VERSION = "1.0.0.beta.4"
3
+ COMPAT_VERSION = '1.0.0'
3
4
  end
data/lib/bpm.rb CHANGED
@@ -17,9 +17,11 @@ module BPM
17
17
  autoload :DirectiveProcessor, 'bpm/pipeline/directive_processor'
18
18
  autoload :GeneratedAsset, 'bpm/pipeline/generated_asset'
19
19
  autoload :TransportProcessor, 'bpm/pipeline/transport_processor'
20
+ autoload :SourceURLProcessor, 'bpm/pipeline/source_url_processor'
20
21
  autoload :PluginAsset, 'bpm/pipeline/plugin_asset'
21
22
  end
22
23
 
23
24
  # The BPM constants need to be defined first
24
25
  require 'bpm/libgems_ext'
26
+ require 'bpm/errors'
25
27
 
@@ -0,0 +1,22 @@
1
+ bpm-add(1) -- Adds one or more packages to a bpm project
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm add` <PACKAGE> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-init(1) bpm-remove(1)
21
+
22
+
@@ -0,0 +1,22 @@
1
+ bpm-build(1) -- converts a project to use bpm
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm build` <PATH> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-add(1) bpm-remove(1)
21
+
22
+
@@ -0,0 +1,23 @@
1
+ bpm-compile(1) -- converts a project to use bpm
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm compile` <PATH> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-add(1) bpm-remove(1) bpm-preview(1)
21
+
22
+
23
+
@@ -0,0 +1,21 @@
1
+ bpm-config(7) -- BPM project config options
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+
7
+ ## DESCRIPTION
8
+
9
+ ## OPTIONS
10
+
11
+ ## DISCUSSION
12
+
13
+ ## COPYRIGHT
14
+
15
+ 2011 Strobe Inc. and contributors. Available under MIT license.
16
+
17
+ ## SEE ALSO
18
+
19
+ bpm-init(1) bpm-remove(1)
20
+
21
+
@@ -0,0 +1,22 @@
1
+ bpm-fetch(1) -- Fetch one or many bpm packages to local cache
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm fetch` <PATH> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-fetched(1) bpm-list(1)
21
+
22
+
@@ -0,0 +1,22 @@
1
+ bpm-fetched(1) -- Displays what bpm packages have been fetched
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm fetched`
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-fetch(1) bpm-list(1)
21
+
22
+
@@ -0,0 +1,22 @@
1
+ bpm-init(1) -- converts a project to use bpm
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm init` <PATH> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-add(1) bpm-remove(1)
21
+
22
+
@@ -0,0 +1,22 @@
1
+ bpm-list(1) -- converts a project to use bpm
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm list` <PATH> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-add(1) bpm-remove(1)
21
+
22
+
@@ -0,0 +1,22 @@
1
+ bpm-login(1) -- converts a project to use bpm
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm login` <PATH> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-add(1) bpm-remove(1)
21
+
22
+
@@ -0,0 +1,22 @@
1
+ bpm-new(1) -- converts a project to use bpm
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm new` <PATH> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-add(1) bpm-remove(1)
21
+
22
+
@@ -0,0 +1,22 @@
1
+ bpm-owner(1) -- Manage users for a package
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm owner` <PATH> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-add(1) bpm-remove(1)
21
+
22
+
@@ -0,0 +1,22 @@
1
+ bpm-preview(1) -- converts a project to use bpm
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm preview` <PATH> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-add(1) bpm-remove(1)
21
+
22
+
@@ -0,0 +1,22 @@
1
+ bpm-push(1) -- converts a project to use bpm
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm push` <PATH> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-add(1) bpm-remove(1)
21
+
22
+
@@ -0,0 +1,22 @@
1
+ bpm-remove(1) -- Removes one or more packages from a bpm project
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm remove` <PATH> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-add(1) bpm-init(1)
21
+
22
+
@@ -0,0 +1,22 @@
1
+ bpm-unpack(1) -- converts a project to use bpm
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm unpack` <PATH> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-add(1) bpm-remove(1)
21
+
22
+
@@ -0,0 +1,22 @@
1
+ bpm-yank(1) -- converts a project to use bpm
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm yank` <PATH> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## OPTIONS
11
+
12
+ ## DISCUSSION
13
+
14
+ ## COPYRIGHT
15
+
16
+ 2011 Strobe Inc. and contributors. Available under MIT license.
17
+
18
+ ## SEE ALSO
19
+
20
+ bpm-add(1) bpm-remove(1)
21
+
22
+
data/man/bpm.1.ronn ADDED
@@ -0,0 +1,31 @@
1
+ bpm(1) -- browser package manager
2
+ ==================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bpm` <command> <flags>
7
+
8
+ ## DESCRIPTION
9
+
10
+ ## WORKFLOW
11
+
12
+ bpm init | bpm new - create the new project
13
+ bpm add spade - adds the dependency, fetches, compiles.
14
+ bpm remove spade - removes the dependency, compiles
15
+
16
+ bpm fetch - fetches any dependencies locally
17
+ bpm compile - rebuilds the project; uses any current dependencies
18
+ bpm preview - allows you to preview the files. creates any needed files
19
+
20
+
21
+ ## DISCUSSION
22
+
23
+ ## COPYRIGHT
24
+
25
+ 2011 Strobe Inc. and contributors. Available under MIT license.
26
+
27
+ ## SEE ALSO
28
+
29
+ bpm-add(1) bpm-remove(1)
30
+
31
+
data/spec/cli/add_spec.rb CHANGED
@@ -7,10 +7,10 @@ describe 'bpm add' do
7
7
  goto_home
8
8
  set_host
9
9
  start_fake(FakeGemServer.new)
10
- FileUtils.cp_r(fixtures('hello_world'), '.')
10
+ FileUtils.cp_r(project_fixture('hello_world'), '.')
11
11
  cd home('hello_world')
12
12
 
13
- bpm 'compile'
13
+ bpm 'fetch'
14
14
  wait
15
15
  end
16
16
 
@@ -57,7 +57,7 @@ describe 'bpm add' do
57
57
  it "adds no packages when any are invalid" do
58
58
  bpm "add", "jquery", "fake", :track_stderr => true
59
59
 
60
- stderr.read.should == "Could not find eligable package for 'fake' (>= 0)\n"
60
+ stderr.read.should == "Could not find eligible package for 'fake' (>= 0)\n"
61
61
 
62
62
  no_dependency 'jquery'
63
63
  no_dependency 'fake'
@@ -66,7 +66,7 @@ describe 'bpm add' do
66
66
  it "fails when adding invalid package" do
67
67
  bpm "add", "fake", :track_stderr => true
68
68
 
69
- stderr.read.should == "Could not find eligable package for 'fake' (>= 0)\n"
69
+ stderr.read.should == "Could not find eligible package for 'fake' (>= 0)\n"
70
70
  no_dependency 'fake'
71
71
  end
72
72
 
@@ -117,7 +117,7 @@ describe 'bpm add' do
117
117
  it "does not add the normal package when asking for a prerelease" do
118
118
  bpm "add", "rake", "--pre", :track_stderr => true
119
119
  wait
120
- stderr.read.should == "Could not find eligable package for 'rake' (>= 0-pre)\n"
120
+ stderr.read.should == "Could not find eligible package for 'rake' (>= 0-pre)\n"
121
121
  no_dependency 'rake'
122
122
  end
123
123
 
@@ -156,7 +156,26 @@ describe 'bpm add' do
156
156
 
157
157
  it "should verify working with config-less projects"
158
158
 
159
- it "should work with .bpkg file"
160
- # i.e. `bpm add package.bpkg`
159
+ it "should work with .bpkg file" do
160
+ FileUtils.cp fixtures('gems', "custom_generator-1.0.bpkg"), '.'
161
+ bpm "add", "custom_generator-1.0.bpkg" and wait
162
+ output = stdout.read
163
+ output.should include("Added package 'custom_generator' (1.0)")
164
+ has_dependency 'custom_generator', '1.0', '1.0'
165
+ end
166
+
167
+ describe "--dev" do
168
+
169
+ it "should add as a development dependency" do
170
+ bpm "add", "custom_generator", "--dev" and wait
171
+ output = stdout.read
172
+ output.should include("Added development package 'custom_generator' (1.0)")
173
+
174
+ bpm 'compile', '--mode=debug' and wait
175
+ has_development_dependency 'custom_generator', '1.0'
176
+ no_dependency 'custom_generator', false
177
+ end
178
+
179
+ end
161
180
 
162
181
  end
@@ -1,22 +1,31 @@
1
1
  require "spec_helper"
2
-
2
+ require "json"
3
3
  describe 'bpm fetch' do
4
4
 
5
5
  before do
6
6
  goto_home
7
- FileUtils.cp_r(fixtures('hello_world'), '.')
7
+ FileUtils.cp_r(project_fixture('hello_world'), '.')
8
8
  set_host
9
9
  start_fake(FakeGemServer.new)
10
10
  end
11
11
 
12
12
  it "fetches all dependencies in a project when called without command" do
13
13
  cd home('hello_world')
14
- bpm "fetch"
15
14
 
16
- stdout.read.should include("Fetched dependent packages for hello_world")
15
+ # add custom_package as a dependency to test local deps with fetching
16
+ package_info = JSON.load File.read(home('hello_world', 'hello_world.json'))
17
+ package_info['dependencies']['custom_package'] = '>= 0'
18
+ File.open(home('hello_world', 'hello_world.json'), 'w+') { |fd| fd << package_info.to_json }
19
+
20
+ bpm "fetch", '--verbose'
21
+ out = stdout.read
22
+ puts out
23
+ out.should include("Fetched dependent packages for hello_world")
17
24
 
18
25
  # note: ivory is a soft dependency from core-test
19
- %w(spade-0.5.0 core-test-0.4.9 ivory-0.0.1 optparse-1.0.1).each do |package_name|
26
+ # jquery is a development dependency of hello_world
27
+ # rake is a dependency of custom_package (a dep of hello_world)
28
+ %w(spade-0.5.0 core-test-0.4.9 ivory-0.0.1 optparse-1.0.1 jquery-1.4.3 uglify-js-1.0.4 rake-0.8.6).each do |package_name|
20
29
  package_name.should be_fetched
21
30
  package_name.should be_unpacked
22
31
  end
@@ -131,5 +140,5 @@ describe 'bpm fetch' do
131
140
  name.should be_unpacked
132
141
  end
133
142
  end
134
-
143
+
135
144
  end