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.
- data/CHANGELOG.md +20 -0
- data/README.md +1 -1
- data/TODO.md +90 -2
- data/bpm.gemspec +3 -3
- data/lib/bpm/cli/base.rb +103 -52
- data/lib/bpm/errors.rb +51 -0
- data/lib/bpm/init_generator.rb +1 -8
- data/lib/bpm/libgems_ext/libgems.rb +9 -0
- data/lib/bpm/local.rb +6 -11
- data/lib/bpm/package.rb +272 -178
- data/lib/bpm/pipeline/generated_asset.rb +88 -28
- data/lib/bpm/pipeline/plugin_asset.rb +8 -2
- data/lib/bpm/pipeline/source_url_processor.rb +16 -0
- data/lib/bpm/pipeline/transport_processor.rb +5 -3
- data/lib/bpm/pipeline.rb +33 -23
- data/lib/bpm/project.rb +492 -167
- data/lib/bpm/project_generator.rb +14 -1
- data/lib/bpm/remote.rb +6 -4
- data/lib/bpm/server.rb +4 -15
- data/lib/bpm/version.rb +2 -1
- data/lib/bpm.rb +2 -0
- data/man/bpm-add.1.ronn +22 -0
- data/man/bpm-build.1.ronn +22 -0
- data/man/bpm-compile.1.ronn +23 -0
- data/man/bpm-config.7.ronn +21 -0
- data/man/bpm-fetch.1.ronn +22 -0
- data/man/bpm-fetched.1.ronn +22 -0
- data/man/bpm-init.1.ronn +22 -0
- data/man/bpm-list.1.ronn +22 -0
- data/man/bpm-login.1.ronn +22 -0
- data/man/bpm-new.1.ronn +22 -0
- data/man/bpm-owner.1.ronn +22 -0
- data/man/bpm-preview.1.ronn +22 -0
- data/man/bpm-push.1.ronn +22 -0
- data/man/bpm-remove.1.ronn +22 -0
- data/man/bpm-unpack.1.ronn +22 -0
- data/man/bpm-yank.1.ronn +22 -0
- data/man/bpm.1.ronn +31 -0
- data/spec/cli/add_spec.rb +26 -7
- data/spec/cli/fetch_spec.rb +15 -6
- data/spec/cli/init_spec.rb +165 -25
- data/spec/cli/{build_spec.rb → pack_spec.rb} +9 -10
- data/spec/cli/push_spec.rb +4 -4
- data/spec/cli/rebuild_spec.rb +181 -0
- data/spec/cli/remove_spec.rb +3 -4
- data/spec/cli/unpack_spec.rb +6 -6
- data/spec/fixtures/gems/core-test-0.4.9.bpkg +0 -0
- data/spec/fixtures/{core-test-0.4.9.bpkg → gems/uglify-js-1.0.4.bpkg} +0 -0
- data/spec/fixtures/packages/core-test/extras/extra_file.html +3 -0
- data/spec/fixtures/packages/core-test/index.html +3 -0
- data/spec/fixtures/{core-test → packages/core-test}/package.json +9 -3
- data/spec/fixtures/packages/invalid_json/package.json +3 -0
- data/spec/fixtures/packages/uglify-js/README.html +825 -0
- data/spec/fixtures/packages/uglify-js/README.org +431 -0
- data/spec/fixtures/packages/uglify-js/bin/uglifyjs +305 -0
- data/spec/fixtures/packages/uglify-js/docstyle.css +75 -0
- data/spec/fixtures/packages/uglify-js/lib/parse-js.js +1 -0
- data/spec/fixtures/packages/uglify-js/lib/process.js +1 -0
- data/spec/fixtures/packages/uglify-js/lib/squeeze-more.js +1 -0
- data/spec/fixtures/packages/uglify-js/package.json +27 -0
- data/spec/fixtures/packages/uglify-js/plugins/minifier.js +6 -0
- data/spec/fixtures/packages/uglify-js/uglify-js.js +17 -0
- data/spec/fixtures/projects/hello2/README.md +21 -0
- data/{templates/init → spec/fixtures/projects/hello2}/assets/bpm_packages.js +6 -1
- data/{templates/init → spec/fixtures/projects/hello2}/assets/bpm_styles.css +1 -1
- data/spec/fixtures/projects/hello2/hello2.json +16 -0
- data/spec/fixtures/projects/hello2/index.html +13 -0
- data/spec/fixtures/projects/hello2/packages/a/lib/main.js +2 -0
- data/spec/fixtures/projects/hello2/packages/a/package.json +17 -0
- data/spec/fixtures/projects/hello2/packages/b/lib/main.js +2 -0
- data/spec/fixtures/projects/hello2/packages/b/package.json +17 -0
- data/spec/fixtures/projects/hello2/packages/c/lib/main.js +2 -0
- data/spec/fixtures/projects/hello2/packages/c/package.json +16 -0
- data/spec/fixtures/projects/hello_dev/LICENSE +19 -0
- data/spec/fixtures/projects/hello_dev/README.md +21 -0
- data/spec/fixtures/projects/hello_dev/app/main.js +6 -0
- data/spec/fixtures/projects/hello_dev/assets/bpm_libs.js +5 -0
- data/spec/fixtures/projects/hello_dev/assets/bpm_styles.css +6 -0
- data/spec/fixtures/projects/hello_dev/css/main.css +1 -0
- data/spec/fixtures/projects/hello_dev/hello_dev.json +25 -0
- data/spec/fixtures/projects/hello_dev/index.html +14 -0
- data/spec/fixtures/projects/hello_dev/packages/style_package/css/some_style.css +3 -0
- data/spec/fixtures/{minitest/minitest.json → projects/hello_dev/packages/style_package/package.json} +5 -9
- data/spec/fixtures/projects/hello_world/LICENSE +19 -0
- data/spec/fixtures/projects/hello_world/assets/bpm_packages.js +1 -0
- data/spec/fixtures/projects/hello_world/assets/bpm_styles.css +1 -0
- data/spec/fixtures/projects/hello_world/custom_dir/custom.js +1 -0
- data/spec/fixtures/projects/hello_world/hello_world.json +41 -0
- data/spec/fixtures/projects/hello_world/lib/another.js +1 -0
- data/spec/fixtures/{hello_world → projects/hello_world}/packages/custom_package/package.json +5 -2
- data/spec/fixtures/projects/hello_world/vendor/lib/something.js +1 -0
- data/spec/fixtures/projects/init_app/assets/bpm_libs.js +6 -0
- data/spec/fixtures/projects/init_app/assets/bpm_styles.css +5 -0
- data/spec/fixtures/projects/init_app/assets/new_project/bpm_libs.js +6 -0
- data/spec/fixtures/projects/init_app/assets/new_project/bpm_styles.css +5 -0
- data/spec/fixtures/projects/init_app/new_project.json +27 -0
- data/spec/fixtures/projects/init_default/assets/bpm_libs.js +6 -0
- data/spec/fixtures/projects/init_default/assets/bpm_styles.css +5 -0
- data/spec/fixtures/projects/init_default/new_project.json +15 -0
- data/spec/fixtures/projects/minitest/minitest.json +26 -0
- data/spec/fixtures/{minitest → projects/minitest}/packages/uglyduck/package.json +1 -1
- data/spec/fixtures/projects/needs_rake/needs_rake.json +7 -0
- data/spec/fixtures/{transporter → projects/transporter}/packages/transport/package.json +1 -1
- data/spec/package_spec.rb +343 -315
- data/spec/pipeline_spec.rb +89 -71
- data/spec/plugins/minifier_spec.rb +25 -16
- data/spec/plugins/transport_spec.rb +1 -1
- data/spec/project_spec.rb +97 -34
- data/spec/spec_helper.rb +41 -0
- data/spec/support/fake_gem_server.rb +8 -4
- data/spec/support/path.rb +8 -0
- data/spec/support/project.rb +50 -17
- data/templates/init/project.json +12 -14
- data/templates/project/LICENSE +1 -1
- data/templates/project/app/main.js +6 -0
- data/templates/project/css/main.css +1 -0
- data/templates/project/index.html +4 -3
- data/vendor/sprockets/.travis.yml +3 -2
- data/vendor/sprockets/Gemfile +0 -6
- data/vendor/sprockets/lib/sprockets/asset.rb +7 -12
- data/vendor/sprockets/lib/sprockets/asset_attributes.rb +70 -53
- data/vendor/sprockets/lib/sprockets/base.rb +1 -14
- data/vendor/sprockets/lib/sprockets/bundled_asset.rb +72 -45
- data/vendor/sprockets/lib/sprockets/caching.rb +28 -23
- data/vendor/sprockets/lib/sprockets/context.rb +56 -26
- data/vendor/sprockets/lib/sprockets/directive_processor.rb +21 -4
- data/vendor/sprockets/lib/sprockets/eco_template.rb +3 -4
- data/vendor/sprockets/lib/sprockets/ejs_template.rb +3 -4
- data/vendor/sprockets/lib/sprockets/engines.rb +26 -1
- data/vendor/sprockets/lib/sprockets/environment.rb +2 -1
- data/vendor/sprockets/lib/sprockets/index.rb +1 -0
- data/vendor/sprockets/lib/sprockets/mime.rb +38 -0
- data/vendor/sprockets/lib/sprockets/processing.rb +4 -45
- data/vendor/sprockets/lib/sprockets/static_asset.rb +5 -6
- data/vendor/sprockets/lib/sprockets/static_compilation.rb +4 -12
- data/vendor/sprockets/lib/sprockets/trail.rb +2 -1
- data/vendor/sprockets/test/fixtures/default/blank.gif +0 -0
- data/vendor/sprockets/test/fixtures/default/with_data_uri.css.erb +3 -0
- data/vendor/sprockets/test/test_asset.rb +121 -15
- data/vendor/sprockets/test/test_asset_attributes.rb +85 -21
- data/vendor/sprockets/test/test_environment.rb +13 -36
- metadata +564 -444
- data/spec/cli/new_spec.rb +0 -118
- data/spec/fixtures/hello_world/assets/bpm_packages.js +0 -13
- data/spec/fixtures/hello_world/assets/bpm_styles.css +0 -14
- data/spec/fixtures/hello_world/hello_world.json +0 -20
- /data/spec/fixtures/{badrake-0.8.7.bpkg → gems/badrake-0.8.7.bpkg} +0 -0
- /data/spec/fixtures/{builder-3.0.0.bpkg → gems/builder-3.0.0.bpkg} +0 -0
- /data/spec/fixtures/{bundler-1.1.pre.bpkg → gems/bundler-1.1.pre.bpkg} +0 -0
- /data/spec/fixtures/{coffee-1.0.1.pre.bpkg → gems/coffee-1.0.1.pre.bpkg} +0 -0
- /data/spec/fixtures/{custom_generator-1.0.bpkg → gems/custom_generator-1.0.bpkg} +0 -0
- /data/spec/fixtures/{highline-1.6.1.bpkg → gems/highline-1.6.1.bpkg} +0 -0
- /data/spec/fixtures/{ivory-0.0.1.bpkg → gems/ivory-0.0.1.bpkg} +0 -0
- /data/spec/fixtures/{jquery-1.4.3.bpkg → gems/jquery-1.4.3.bpkg} +0 -0
- /data/spec/fixtures/{optparse-1.0.1.bpkg → gems/optparse-1.0.1.bpkg} +0 -0
- /data/spec/fixtures/{rake-0.8.6.bpkg → gems/rake-0.8.6.bpkg} +0 -0
- /data/spec/fixtures/{rake-0.8.7.bpkg → gems/rake-0.8.7.bpkg} +0 -0
- /data/spec/fixtures/{spade-0.5.0.bpkg → gems/spade-0.5.0.bpkg} +0 -0
- /data/spec/fixtures/{src → packages}/README.txt +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/.gitignore +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/CHANGELOG.md +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/ISSUES.md +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/LICENSE +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/README.md +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/UPGRADING.md +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/bin/bundle +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/lib/bundler/definition.js +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/lib/bundler/dependency.js +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/lib/bundler/dsl.js +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/lib/bundler/ui.js +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/lib/bundler.js +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/bundle-config.ronn +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/bundle-exec.ronn +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/bundle-install.ronn +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/bundle-package.ronn +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/bundle-update.ronn +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/bundle.ronn +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/gemfile.5.ronn +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/man/index.txt +0 -0
- /data/spec/fixtures/{src → packages}/bundler-1.1.pre/package.json +0 -0
- /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/bin/cake +0 -0
- /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/bin/coffee +0 -0
- /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/lib/coffee/base.js +0 -0
- /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/lib/coffee/mocha/chai.js +0 -0
- /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/lib/coffee.js +0 -0
- /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/package.json +0 -0
- /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/qunit/coffee/test.js +0 -0
- /data/spec/fixtures/{src → packages}/coffee-1.0.1.pre/qunit/test.js +0 -0
- /data/spec/fixtures/{core-test → packages/core-test}/bin/cot +0 -0
- /data/spec/fixtures/{core-test → packages/core-test}/lib/main.js +0 -0
- /data/spec/fixtures/{core-test → packages/core-test}/resources/runner.css +0 -0
- /data/spec/fixtures/{core-test → packages/core-test}/tests/test.js +0 -0
- /data/spec/fixtures/{custom_generator → packages/custom_generator}/lib/main.js +0 -0
- /data/spec/fixtures/{custom_generator → packages/custom_generator}/package.json +0 -0
- /data/spec/fixtures/{custom_generator → packages/custom_generator}/templates/init/project.json +0 -0
- /data/spec/fixtures/{custom_generator → packages/custom_generator}/templates/project/app.js +0 -0
- /data/spec/fixtures/{custom_generator → packages/custom_generator}/templates/project/lib/main.js +0 -0
- /data/spec/fixtures/{custom_generator → packages/custom_generator}/templates/project_generator.rb +0 -0
- /data/spec/fixtures/{src → packages}/jquery/lib/main.js +0 -0
- /data/spec/fixtures/{src → packages}/jquery/package.json +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/CHANGES +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/MIT-LICENSE +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/README +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/Rakefile +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/TODO +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/bin/rake +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/command_line_usage.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/example/Rakefile1 +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/example/Rakefile2 +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/example/a.c +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/example/b.c +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/example/main.c +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/glossary.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/jamis.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/proto_rake.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/rake.1.gz +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/rakefile.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/rational.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.4.14.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.4.15.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.5.0.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.5.3.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.5.4.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.6.0.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.7.0.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.7.1.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.7.2.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.7.3.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.8.0.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.8.2.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.8.3.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.8.4.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.8.5.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/doc/release_notes/rake-0.8.6.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/install.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/alt_system.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/classic_namespace.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/clean.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/contrib/compositepublisher.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/contrib/ftptools.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/contrib/publisher.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/contrib/rubyforgepublisher.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/contrib/sshpublisher.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/contrib/sys.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/gempackagetask.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/loaders/makefile.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/packagetask.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/rake_test_loader.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/rdoctask.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/ruby182_test_unit_fix.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/runtest.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/tasklib.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/testtask.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake/win32.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/lib/rake.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/package.json +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.6/test/capture_stdout.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/CHANGES +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/MIT-LICENSE +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/README +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/Rakefile +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/TODO +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/bin/rake +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/command_line_usage.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/example/Rakefile1 +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/example/Rakefile2 +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/example/a.c +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/example/b.c +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/example/main.c +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/glossary.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/jamis.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/proto_rake.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/rake.1.gz +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/rakefile.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/rational.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.4.14.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.4.15.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.5.0.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.5.3.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.5.4.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.6.0.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.7.0.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.7.1.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.7.2.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.7.3.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.0.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.2.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.3.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.4.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.5.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.6.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/doc/release_notes/rake-0.8.7.rdoc +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/install.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/alt_system.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/classic_namespace.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/clean.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/contrib/compositepublisher.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/contrib/ftptools.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/contrib/publisher.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/contrib/rubyforgepublisher.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/contrib/sshpublisher.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/contrib/sys.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/gempackagetask.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/loaders/makefile.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/packagetask.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/rake_test_loader.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/rdoctask.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/ruby182_test_unit_fix.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/runtest.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/tasklib.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/testtask.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake/win32.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/lib/rake.rb +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/package.json +0 -0
- /data/spec/fixtures/{src → packages}/rake-0.8.7/test/capture_stdout.rb +0 -0
- /data/spec/fixtures/{src → packages}/spade/lib/main.js +0 -0
- /data/spec/fixtures/{src → packages}/spade/package.json +0 -0
- /data/spec/fixtures/{custom_name → projects/custom_name}/MyProject.json +0 -0
- /data/spec/fixtures/{hello_world → projects/hello2}/LICENSE +0 -0
- /data/{templates/project → spec/fixtures/projects/hello2}/app.js +0 -0
- /data/spec/fixtures/{hello_world → projects/hello_world}/README.md +0 -0
- /data/spec/fixtures/{hello_world → projects/hello_world}/assets/papa-smurf.jpg +0 -0
- /data/spec/fixtures/{hello_world → projects/hello_world}/css/dummy.css +0 -0
- /data/spec/fixtures/{hello_world → projects/hello_world}/lib/main.js +0 -0
- /data/spec/fixtures/{hello_world → projects/hello_world}/packages/custom_package/assets/dummy.txt +0 -0
- /data/spec/fixtures/{hello_world → projects/hello_world}/packages/custom_package/css/sample_styles.css +0 -0
- /data/spec/fixtures/{hello_world → projects/hello_world}/packages/custom_package/custom_dir/basic-module.js +0 -0
- /data/spec/fixtures/{hello_world → projects/hello_world}/packages/custom_package/lib/main.js +0 -0
- /data/spec/fixtures/{hello_world → projects/hello_world}/tests/main-test.js +0 -0
- /data/spec/fixtures/{minitest → projects/minitest}/assets/bpm_packages.js +0 -0
- /data/spec/fixtures/{minitest → projects/minitest}/assets/bpm_styles.css +0 -0
- /data/spec/fixtures/{minitest → projects/minitest}/assets/minitest/app_package.js +0 -0
- /data/spec/fixtures/{minitest → projects/minitest}/lib/main.js +0 -0
- /data/spec/fixtures/{minitest → projects/minitest}/packages/uglyduck/lib/main.js +0 -0
- /data/spec/fixtures/{minitest → projects/minitest}/packages/uglyduck/minifier/main.js +0 -0
- /data/spec/fixtures/{simple_hello/assets/bpm_packages.js → projects/simple_hello/assets/bpm_libs.js} +0 -0
- /data/spec/fixtures/{simple_hello → projects/simple_hello}/lib/main.js +0 -0
- /data/spec/fixtures/{transporter → projects/transporter}/lib/main.js +0 -0
- /data/spec/fixtures/{transporter → projects/transporter}/packages/transport/lib/main.js +0 -0
- /data/spec/fixtures/{transporter → projects/transporter}/packages/transport/transports/wrapper.js +0 -0
- /data/spec/fixtures/{transporter → projects/transporter}/transporter.json +0 -0
data/spec/cli/init_spec.rb
CHANGED
@@ -1,50 +1,190 @@
|
|
1
1
|
require "spec_helper"
|
2
|
+
require 'json'
|
2
3
|
|
3
|
-
describe "bpm init" do
|
4
|
+
describe "bpm init on existing directory" do
|
4
5
|
|
5
6
|
before do
|
6
|
-
|
7
|
+
goto_home
|
8
|
+
set_host
|
9
|
+
start_fake(FakeGemServer.new)
|
10
|
+
|
11
|
+
@project_path = home("new_project").to_s
|
7
12
|
FileUtils.mkdir @project_path
|
8
13
|
cd @project_path
|
9
14
|
end
|
10
15
|
|
16
|
+
# compare the generated project to a fixture template
|
17
|
+
def compare_to(project_name)
|
18
|
+
compare_contents @project_path, project_fixture(project_name)
|
19
|
+
end
|
20
|
+
|
11
21
|
it "should create files" do
|
12
|
-
bpm 'init'
|
13
|
-
|
14
|
-
files = %w(new_project.json assets assets/bpm_packages.js assets/bpm_styles.css)
|
15
|
-
|
16
|
-
output = stdout.read.gsub(/\e\[\d+m/,'') #without colors
|
17
|
-
|
18
|
-
files.each do |file|
|
19
|
-
output.should =~ /create\s+#{file}$/
|
20
|
-
File.join(@project_path, file).should exist
|
21
|
-
end
|
22
|
+
bpm 'init' and wait
|
23
|
+
compare_to 'init_default'
|
22
24
|
end
|
23
|
-
|
24
|
-
it "should
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
|
26
|
+
it "should create app files with --app option" do
|
27
|
+
bpm 'init', '--app' and wait
|
28
|
+
compare_to 'init_app'
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should not overwrite existing project file" do
|
29
32
|
File.open("new_project.json", 'w'){|f| f.print "Valuable info!" }
|
30
|
-
|
33
|
+
|
31
34
|
bpm 'init', '--skip' # skip, since we can't test the prompt
|
32
|
-
|
35
|
+
|
33
36
|
output = stdout.read.gsub(/\e\[\d+m/,'') # without colors
|
34
|
-
|
37
|
+
|
35
38
|
output.should =~ /skip\s+new_project.json/
|
36
39
|
File.read("new_project.json").should == "Valuable info!"
|
37
40
|
end
|
38
|
-
|
41
|
+
|
42
|
+
it "should update the project with app but save other settings" do
|
43
|
+
bpm 'init' and wait
|
44
|
+
|
45
|
+
# write a custom property
|
46
|
+
project_json = File.join @project_path, 'new_project.json'
|
47
|
+
json = JSON.load File.read(project_json)
|
48
|
+
json["custom_property"] = "I haz it"
|
49
|
+
File.open(project_json, 'w') { |fd| fd << json.to_json }
|
50
|
+
|
51
|
+
bpm 'init', '--app' and wait
|
52
|
+
|
53
|
+
app_package = home 'new_project', 'assets', 'new_project', 'bpm_libs.js'
|
54
|
+
File.exists?(app_package).should be_true
|
55
|
+
|
56
|
+
json = JSON.load File.read(project_json)
|
57
|
+
json["custom_property"].should == "I haz it"
|
58
|
+
json["bpm:build"]["bpm_libs.js"].should_not be_nil
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
it "should rebuild assets" do
|
63
|
+
|
64
|
+
bpm 'init' and wait
|
65
|
+
|
66
|
+
files = %w(bpm_libs.js bpm_styles.css).map do |fn|
|
67
|
+
File.join(@project_path, 'assets', fn)
|
68
|
+
end
|
69
|
+
|
70
|
+
files.each do |path|
|
71
|
+
FileUtils.mkdir_p File.dirname(path)
|
72
|
+
File.open(path, 'w') { |fd| fd.print "Not valuable info!" }
|
73
|
+
end
|
74
|
+
|
75
|
+
bpm 'init' and wait
|
76
|
+
|
77
|
+
files.each do |path|
|
78
|
+
File.read(path).should_not include("Not valuable info!")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
39
82
|
it "should allow a name to be specified" do
|
40
83
|
bpm 'init', '--name=DifferentName' and wait
|
41
|
-
|
84
|
+
|
42
85
|
File.join(@project_path, "DifferentName.json").should exist
|
43
86
|
File.join(@project_path, "new_project.json").should_not exist
|
44
87
|
end
|
45
88
|
|
46
|
-
|
89
|
+
end
|
90
|
+
|
91
|
+
describe "bpm init on a non-existant directory" do
|
92
|
+
|
93
|
+
describe "normal" do
|
94
|
+
|
95
|
+
before do
|
96
|
+
goto_home
|
97
|
+
set_host
|
98
|
+
start_fake(FakeGemServer.new)
|
99
|
+
cd home
|
100
|
+
end
|
101
|
+
|
102
|
+
it "should create files" do
|
103
|
+
bpm 'init', 'BpmTest'
|
104
|
+
|
105
|
+
|
106
|
+
files = %w(LICENSE README.md index.html app/main.js BpmTest.json)
|
107
|
+
generated_files = %w(assets/bpm_libs.js assets/bpm_styles.css assets/BpmTest/bpm_libs.js assets/BpmTest/bpm_styles.css)
|
108
|
+
|
109
|
+
# output without coloration
|
110
|
+
output = stdout.read.gsub(/\e\[\d+m/,'')
|
47
111
|
|
48
|
-
|
112
|
+
files.each do |file|
|
113
|
+
output.should =~ /create\s+#{file}$/
|
114
|
+
home("bpm_test", *file.split('/')).should exist
|
115
|
+
end
|
116
|
+
|
117
|
+
generated_files.each do |file|
|
118
|
+
home('bpm_test', *file.split('/')).should exist
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
it "should allow a path to be specified" do
|
123
|
+
bpm 'init', 'DifferentLocation', '--name=BpmTest' and wait
|
124
|
+
|
125
|
+
home("DifferentLocation").should exist
|
126
|
+
home("DifferentLocation", "BpmTest.json").should exist
|
127
|
+
home("DifferentLocation", "DifferentLocation.json").should_not exist
|
128
|
+
home("bpm_test").should_not exist
|
129
|
+
end
|
130
|
+
|
131
|
+
end
|
132
|
+
|
133
|
+
describe "package templates" do
|
134
|
+
|
135
|
+
describe "with custom generator" do
|
136
|
+
|
137
|
+
before do
|
138
|
+
goto_home
|
139
|
+
set_host
|
140
|
+
start_fake(FakeGemServer.new)
|
141
|
+
end
|
142
|
+
|
143
|
+
it "should create custom files" do
|
144
|
+
bpm 'init', 'BpmTest', '--package=custom_generator'
|
145
|
+
|
146
|
+
files = %w(lib lib/main.js app.js BpmTest.json)
|
147
|
+
|
148
|
+
# output without coloration
|
149
|
+
output = stdout.read.gsub(/\e\[\d+m/,'')
|
150
|
+
|
151
|
+
files.each do |file|
|
152
|
+
output.should =~ /create\s+#{file}$/
|
153
|
+
home("bpm_test", file).should exist
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
it "should create custom app.js with explicit generator" do
|
158
|
+
bpm 'init', 'BpmTest', '--package=custom_generator' and wait
|
159
|
+
|
160
|
+
File.read(home("bpm_test", "app.js")).should == "require('BpmTest/main.js')\n"
|
161
|
+
end
|
162
|
+
|
163
|
+
it "should create custom project.json without explicit generator" do
|
164
|
+
bpm 'init', 'BpmTest', '--package=core-test' and wait
|
165
|
+
|
166
|
+
File.read(home("bpm_test", "BpmTest.json")).should =~ /"core-test": "0.4.9"/
|
167
|
+
end
|
168
|
+
|
169
|
+
end
|
170
|
+
|
171
|
+
describe "without custom generator" do
|
172
|
+
|
173
|
+
before do
|
174
|
+
goto_home
|
175
|
+
set_host
|
176
|
+
start_fake(FakeGemServer.new)
|
177
|
+
cd home
|
178
|
+
end
|
179
|
+
|
180
|
+
it "should add package as a dependency even if it doesn't have custom generator" do
|
181
|
+
bpm 'init', 'BpmTest', '--package=jquery' and wait
|
182
|
+
|
183
|
+
File.read(home("bpm_test", "BpmTest.json")).should =~ /"dependencies": {\n\s+"jquery": "1.4.3"\n\s+}/
|
184
|
+
end
|
185
|
+
|
186
|
+
end
|
187
|
+
|
188
|
+
end
|
49
189
|
|
50
190
|
end
|
@@ -10,9 +10,9 @@ describe "bpm build when logged in" do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
it "builds a bpm from a given package.json" do
|
13
|
-
FileUtils.cp_r
|
13
|
+
FileUtils.cp_r package_fixture("core-test"), "."
|
14
14
|
cd "core-test"
|
15
|
-
bpm "
|
15
|
+
bpm "pack"
|
16
16
|
|
17
17
|
exit_status.should be_success
|
18
18
|
output = stdout.read
|
@@ -31,9 +31,9 @@ describe "bpm build without logging in" do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
it "builds a bpm from a given package.json" do
|
34
|
-
FileUtils.cp_r
|
34
|
+
FileUtils.cp_r package_fixture("core-test"), "."
|
35
35
|
cd "core-test"
|
36
|
-
bpm "
|
36
|
+
bpm "pack", "-e", "joe@example.com"
|
37
37
|
|
38
38
|
exit_status.should be_success
|
39
39
|
|
@@ -43,8 +43,8 @@ describe "bpm build without logging in" do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it "builds a bpm when given a path to a package" do
|
46
|
-
FileUtils.cp_r
|
47
|
-
bpm "
|
46
|
+
FileUtils.cp_r package_fixture("core-test"), "."
|
47
|
+
bpm "pack", "core-test", "-e", "joe@example.com"
|
48
48
|
|
49
49
|
exit_status.should be_success
|
50
50
|
|
@@ -55,9 +55,9 @@ describe "bpm build without logging in" do
|
|
55
55
|
end
|
56
56
|
|
57
57
|
it "sets the email address if one is given" do
|
58
|
-
FileUtils.cp_r
|
58
|
+
FileUtils.cp_r package_fixture("core-test"), "."
|
59
59
|
cd "core-test"
|
60
|
-
bpm "
|
60
|
+
bpm "pack", "-e", "lucy@allen.com"
|
61
61
|
|
62
62
|
exit_status.should be_success
|
63
63
|
output = stdout.read
|
@@ -77,11 +77,10 @@ describe "bpm build with an invalid package.json" do
|
|
77
77
|
|
78
78
|
it "reports error messages" do
|
79
79
|
FileUtils.touch "package.json"
|
80
|
-
bpm "
|
80
|
+
bpm "pack", :track_stderr => true
|
81
81
|
|
82
82
|
exit_status.should_not be_success
|
83
83
|
output = stderr.read
|
84
|
-
output.should include("BPM encountered the following problems building your package:")
|
85
84
|
output.should include("There was a problem parsing package.json")
|
86
85
|
end
|
87
86
|
end
|
data/spec/cli/push_spec.rb
CHANGED
@@ -16,7 +16,7 @@ describe "bpm push" do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
it "registers a gem when sent with the right api key" do
|
19
|
-
bpm "push",
|
19
|
+
bpm "push", fixtures('gems', 'rake-0.8.7.bpkg').to_s
|
20
20
|
|
21
21
|
stdout.read.should include("Successfully registered rake (0.8.7)")
|
22
22
|
end
|
@@ -25,7 +25,7 @@ describe "bpm push" do
|
|
25
25
|
it "shows rejection message if wrong api key is supplied" do
|
26
26
|
write_api_key("beefbeef")
|
27
27
|
|
28
|
-
bpm "push",
|
28
|
+
bpm "push", fixtures('gems', 'rake-0.8.7.bpkg').to_s
|
29
29
|
|
30
30
|
stdout.read.should include("One cannot simply walk into Mordor!")
|
31
31
|
end
|
@@ -46,7 +46,7 @@ describe "bpm push without api key" do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
it "must push a valid gem" do
|
49
|
-
bpm "push",
|
49
|
+
bpm "push", fixtures('gems', 'badrake-0.8.7.bpkg').to_s
|
50
50
|
|
51
51
|
stdout.read.should include("There was a problem opening your package.")
|
52
52
|
end
|
@@ -66,7 +66,7 @@ describe "bpm push without api key" do
|
|
66
66
|
end
|
67
67
|
|
68
68
|
it "asks for login first if api key does not exist" do
|
69
|
-
bpm "push",
|
69
|
+
bpm "push", fixtures('gems', 'rake-0.8.7.bpkg').to_s
|
70
70
|
|
71
71
|
stdout.read.should include("Please login first with `bpm login`")
|
72
72
|
end
|
@@ -0,0 +1,181 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
describe 'bpm compile' do
|
5
|
+
|
6
|
+
describe 'complex dependencies' do
|
7
|
+
|
8
|
+
before do
|
9
|
+
goto_home
|
10
|
+
set_host
|
11
|
+
start_fake(FakeGemServer.new)
|
12
|
+
FileUtils.cp_r(fixtures('projects', 'hello2'), '.')
|
13
|
+
cd home('hello2')
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should order the packages property with dependencies" do
|
17
|
+
bpm 'rebuild', '--mode=debug' # avoid minification.
|
18
|
+
wait
|
19
|
+
|
20
|
+
file = File.read home('hello2', 'assets', 'bpm_libs.js')
|
21
|
+
expected = <<EOF
|
22
|
+
/* ===========================================================================
|
23
|
+
BPM Combined Asset File
|
24
|
+
MANIFEST: a (1.0.0) b (1.0.0) c (1.0.0)
|
25
|
+
This file is generated automatically by the bpm (http://www.bpmjs.org)
|
26
|
+
=========================================================================*/
|
27
|
+
|
28
|
+
// HELLO C
|
29
|
+
|
30
|
+
// HELLO B
|
31
|
+
|
32
|
+
// HELLO A
|
33
|
+
|
34
|
+
EOF
|
35
|
+
|
36
|
+
file.should == expected
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe 'development dependencies' do
|
41
|
+
|
42
|
+
before do
|
43
|
+
goto_home
|
44
|
+
set_host
|
45
|
+
start_fake(FakeGemServer.new)
|
46
|
+
FileUtils.cp_r(project_fixture('hello_dev'), '.')
|
47
|
+
cd home('hello_dev')
|
48
|
+
|
49
|
+
bpm 'fetch'
|
50
|
+
wait
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_include(does_include, build_file, *source_file)
|
54
|
+
contents_path = home('hello_dev', 'assets', build_file)
|
55
|
+
expected_path = home('hello_dev', *source_file)
|
56
|
+
|
57
|
+
if does_include
|
58
|
+
File.read(contents_path).should include(File.read(expected_path))
|
59
|
+
else
|
60
|
+
File.read(contents_path).should_not include(File.read(expected_path))
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_development_dependencies(should_include)
|
66
|
+
|
67
|
+
js_reg = [
|
68
|
+
# fetch regular dependency
|
69
|
+
%w(.bpm packages spade lib main.js)
|
70
|
+
]
|
71
|
+
|
72
|
+
js_dev = [
|
73
|
+
# fetched development dependency
|
74
|
+
%w(.bpm packages uglify-js lib parse-js.js),
|
75
|
+
|
76
|
+
# required dependency of development dependency
|
77
|
+
%w(.bpm packages optparse lib optparse.js)
|
78
|
+
]
|
79
|
+
|
80
|
+
css_dev = [
|
81
|
+
# css of a locally installed development dependency
|
82
|
+
%w(packages style_package css some_style.css)
|
83
|
+
]
|
84
|
+
|
85
|
+
if should_include
|
86
|
+
expected_manifest = 'optparse (1.0.1) spade (0.5.0) style_package (1.0.0) uglify-js (1.0.4)'
|
87
|
+
else
|
88
|
+
expected_manifest = 'spade (0.5.0)'
|
89
|
+
end
|
90
|
+
|
91
|
+
# validate manifest
|
92
|
+
expected_manifest = "MANIFEST: #{expected_manifest}"
|
93
|
+
File.read(home('hello_dev', 'assets', 'bpm_libs.js')).should include(expected_manifest)
|
94
|
+
|
95
|
+
js_reg.each do |path|
|
96
|
+
test_include true, 'bpm_libs.js', *path
|
97
|
+
end
|
98
|
+
|
99
|
+
js_dev.each do |path|
|
100
|
+
test_include(should_include, 'bpm_libs.js', *path)
|
101
|
+
end
|
102
|
+
|
103
|
+
css_dev.each do |path|
|
104
|
+
test_include(should_include, 'bpm_styles.css', *path)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
it "building in debug mode" do
|
109
|
+
bpm 'rebuild', '--mode=debug'
|
110
|
+
wait
|
111
|
+
|
112
|
+
test_development_dependencies true
|
113
|
+
end
|
114
|
+
|
115
|
+
it "building in production mode" do
|
116
|
+
bpm 'rebuild', '--mode=production'
|
117
|
+
wait
|
118
|
+
|
119
|
+
test_development_dependencies false
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
123
|
+
|
124
|
+
describe "update" do
|
125
|
+
|
126
|
+
before do
|
127
|
+
goto_home
|
128
|
+
set_host
|
129
|
+
start_fake(FakeGemServer.new)
|
130
|
+
FileUtils.cp_r project_fixture('needs_rake'), '.'
|
131
|
+
cd home('needs_rake')
|
132
|
+
end
|
133
|
+
|
134
|
+
it "should not update dependencies with no-update if they can be met" do
|
135
|
+
bpm 'fetch', 'rake', '--version=0.8.6' and wait
|
136
|
+
bpm 'rebuild', '--no-update', '--verbose'
|
137
|
+
out = stdout.read
|
138
|
+
out.should_not include('Fetching packages from remote...')
|
139
|
+
out.should include("'rake' (0.8.6)")
|
140
|
+
end
|
141
|
+
|
142
|
+
it "should update dependencies without no-update if they can be met" do
|
143
|
+
bpm 'fetch', 'rake', '--version=0.8.6' and wait
|
144
|
+
bpm 'rebuild', '--update', '--verbose'
|
145
|
+
out = stdout.read
|
146
|
+
out.should include('Fetching packages from remote...')
|
147
|
+
out.should include("'rake' (0.8.7)")
|
148
|
+
end
|
149
|
+
|
150
|
+
it "should update dependencies with no-update if they cannot be met" do
|
151
|
+
bpm 'rebuild', '--no-update', '--verbose'
|
152
|
+
out = stdout.read
|
153
|
+
out.should include('Fetching packages from remote...')
|
154
|
+
out.should include("'rake' (0.8.7)")
|
155
|
+
end
|
156
|
+
|
157
|
+
end
|
158
|
+
|
159
|
+
describe "error conditions" do
|
160
|
+
|
161
|
+
before do
|
162
|
+
goto_home
|
163
|
+
set_host
|
164
|
+
start_fake(FakeGemServer.new)
|
165
|
+
FileUtils.cp_r(project_fixture('hello_dev'), '.')
|
166
|
+
cd home('hello_dev')
|
167
|
+
end
|
168
|
+
|
169
|
+
it "should automatically recover if packages are damaged" do
|
170
|
+
bpm 'rebuild' and wait
|
171
|
+
out = stdout.read
|
172
|
+
out.should include('~ Building bpm_libs.js')
|
173
|
+
|
174
|
+
FileUtils.rm_r home('.bpm') # delete linked directories.
|
175
|
+
bpm 'rebuild', '--verbose', :track_stderr => true
|
176
|
+
err = stderr.read
|
177
|
+
err.should_not include('Could not find eligible')
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
end
|
data/spec/cli/remove_spec.rb
CHANGED
@@ -7,15 +7,14 @@ describe 'bpm remove' do
|
|
7
7
|
goto_home
|
8
8
|
set_host
|
9
9
|
start_fake(FakeGemServer.new)
|
10
|
-
FileUtils.cp_r(
|
10
|
+
FileUtils.cp_r(project_fixture('hello_world'), '.')
|
11
11
|
cd home('hello_world')
|
12
|
-
bpm '
|
12
|
+
bpm 'fetch' # make sure existing packages are installed
|
13
13
|
wait
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should remove direct dependency from project" do
|
17
17
|
bpm 'remove', 'spade'
|
18
|
-
wait
|
19
18
|
|
20
19
|
output = stdout.read
|
21
20
|
output.should include("Removed package 'spade'")
|
@@ -79,6 +78,6 @@ describe 'bpm remove' do
|
|
79
78
|
File.exists?(home('hello_world', 'packages', 'custom_package', 'package.json')).should be_true
|
80
79
|
end
|
81
80
|
|
82
|
-
it "should
|
81
|
+
it "should remove development dependencies"
|
83
82
|
|
84
83
|
end
|
data/spec/cli/unpack_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe "bpm unpack" do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
it "builds a gem from a given package.json" do
|
9
|
-
FileUtils.cp fixtures("coffee-1.0.1.pre.bpkg"), "."
|
9
|
+
FileUtils.cp fixtures('gems', "coffee-1.0.1.pre.bpkg"), "."
|
10
10
|
bpm "unpack", "coffee-1.0.1.pre.bpkg"
|
11
11
|
|
12
12
|
exit_status.should be_success
|
@@ -22,7 +22,7 @@ describe "bpm unpack" do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
it "can unpack to a different directory" do
|
25
|
-
FileUtils.cp fixtures("coffee-1.0.1.pre.bpkg"), "."
|
25
|
+
FileUtils.cp fixtures('gems', "coffee-1.0.1.pre.bpkg"), "."
|
26
26
|
bpm "unpack", "coffee-1.0.1.pre.bpkg", "--target", "star/bucks"
|
27
27
|
|
28
28
|
exit_status.should be_success
|
@@ -33,8 +33,8 @@ describe "bpm unpack" do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it "can unpack more than one package" do
|
36
|
-
FileUtils.cp fixtures("coffee-1.0.1.pre.bpkg"), "."
|
37
|
-
FileUtils.cp fixtures("jquery-1.4.3.bpkg"), "."
|
36
|
+
FileUtils.cp fixtures('gems', "coffee-1.0.1.pre.bpkg"), "."
|
37
|
+
FileUtils.cp fixtures('gems', "jquery-1.4.3.bpkg"), "."
|
38
38
|
bpm "unpack", "coffee-1.0.1.pre.bpkg", "jquery-1.4.3.bpkg"
|
39
39
|
|
40
40
|
exit_status.should be_success
|
@@ -49,7 +49,7 @@ describe "bpm unpack" do
|
|
49
49
|
it "shows a friendly error message if bpm can't write to the given directory" do
|
50
50
|
FileUtils.mkdir_p(home("bad"))
|
51
51
|
cd(home("bad"))
|
52
|
-
FileUtils.cp fixtures("jquery-1.4.3.bpkg"), "."
|
52
|
+
FileUtils.cp fixtures('gems', "jquery-1.4.3.bpkg"), "."
|
53
53
|
FileUtils.chmod 0555, "."
|
54
54
|
bpm "unpack", "jquery-1.4.3.bpkg", :track_stderr => true
|
55
55
|
|
@@ -60,7 +60,7 @@ describe "bpm unpack" do
|
|
60
60
|
end
|
61
61
|
|
62
62
|
it "shows a friendly error message if bpm can't read the package" do
|
63
|
-
FileUtils.cp fixtures("jquery-1.4.3.bpkg"), "."
|
63
|
+
FileUtils.cp fixtures('gems', "jquery-1.4.3.bpkg"), "."
|
64
64
|
FileUtils.chmod 0000, "jquery-1.4.3.bpkg"
|
65
65
|
bpm "unpack", "jquery-1.4.3.bpkg", :track_stderr => true
|
66
66
|
|
Binary file
|
Binary file
|
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
"directories": {
|
24
24
|
"lib": "./lib",
|
25
|
-
"resources": "
|
25
|
+
"resources": "resources",
|
26
26
|
"tests": "./tests"
|
27
27
|
},
|
28
28
|
|
@@ -37,8 +37,14 @@
|
|
37
37
|
"optparse": "= 1.0.1"
|
38
38
|
},
|
39
39
|
|
40
|
-
"
|
41
|
-
"css":
|
40
|
+
"bpm:build": {
|
41
|
+
"bpm_styles.css": {
|
42
|
+
"directories": ["resources"]
|
43
|
+
},
|
44
|
+
|
45
|
+
"core-test": {
|
46
|
+
"assets": ["index.html", "extras"]
|
47
|
+
}
|
42
48
|
}
|
43
49
|
}
|
44
50
|
|