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/pipeline_spec.rb
CHANGED
@@ -4,7 +4,10 @@ describe BPM::Pipeline, "asset_path" do
|
|
4
4
|
|
5
5
|
before do
|
6
6
|
goto_home
|
7
|
-
|
7
|
+
set_host
|
8
|
+
start_fake(FakeGemServer.new)
|
9
|
+
FileUtils.cp_r(project_fixture('hello_world'), '.')
|
10
|
+
cd home('hello_world')
|
8
11
|
end
|
9
12
|
|
10
13
|
subject do
|
@@ -13,31 +16,22 @@ describe BPM::Pipeline, "asset_path" do
|
|
13
16
|
end
|
14
17
|
|
15
18
|
it "should find any asset in the assets directory" do
|
19
|
+
bpm 'update' and wait
|
16
20
|
asset = subject.find_asset 'papa-smurf.jpg'
|
17
21
|
asset.pathname.should == home('hello_world', 'assets', 'papa-smurf.jpg')
|
18
22
|
end
|
19
23
|
|
20
24
|
it "should find any asset in packages" do
|
21
|
-
|
22
|
-
|
23
|
-
start_fake(FakeGemServer.new)
|
24
|
-
cd home('hello_world')
|
25
|
-
|
26
|
-
bpm 'add', 'custom_package'
|
27
|
-
wait
|
25
|
+
bpm 'fetch' and wait
|
26
|
+
bpm 'add', 'custom_package' and wait
|
28
27
|
|
29
28
|
asset = subject.find_asset 'custom_package/assets/dummy.txt'
|
30
29
|
asset.pathname.should == home('hello_world', '.bpm', 'packages', 'custom_package', 'assets', 'dummy.txt')
|
31
30
|
end
|
32
31
|
|
33
32
|
it "should find any asset in installed packages" do
|
34
|
-
|
35
|
-
|
36
|
-
start_fake(FakeGemServer.new)
|
37
|
-
cd home('hello_world')
|
38
|
-
|
39
|
-
bpm 'compile'
|
40
|
-
wait
|
33
|
+
bpm 'fetch' and wait
|
34
|
+
bpm 'compile' and wait
|
41
35
|
|
42
36
|
asset = subject.find_asset 'core-test/resources/runner.css'
|
43
37
|
asset.pathname.should == home('hello_world', '.bpm', 'packages', 'core-test', 'resources', 'runner.css')
|
@@ -46,37 +40,33 @@ describe BPM::Pipeline, "asset_path" do
|
|
46
40
|
describe "generated assets" do
|
47
41
|
|
48
42
|
before do
|
49
|
-
|
50
|
-
|
51
|
-
start_fake(FakeGemServer.new)
|
52
|
-
cd home('hello_world')
|
53
|
-
|
54
|
-
bpm 'add', 'custom_package'
|
55
|
-
wait
|
43
|
+
bpm 'fetch' and wait
|
44
|
+
bpm 'add', 'custom_package' and wait
|
56
45
|
|
57
46
|
@project = BPM::Project.new home('hello_world')
|
58
47
|
end
|
59
48
|
|
60
|
-
describe "
|
61
|
-
|
49
|
+
describe "bpm_libs.js" do
|
50
|
+
|
62
51
|
subject do
|
63
|
-
BPM::Pipeline.new(@project).find_asset '
|
52
|
+
BPM::Pipeline.new(@project).find_asset 'bpm_libs.js'
|
64
53
|
end
|
65
54
|
|
66
55
|
it "should return an asset of type BPM::GeneratedAsset" do
|
67
56
|
subject.class.should == BPM::GeneratedAsset
|
68
57
|
end
|
69
58
|
|
70
|
-
it "should find the
|
71
|
-
subject.pathname.should == home('hello_world', 'assets', '
|
59
|
+
it "should find the bpm_libs.js" do
|
60
|
+
subject.pathname.should == home('hello_world', 'assets', 'bpm_libs.js')
|
72
61
|
end
|
73
|
-
|
74
|
-
it "should find
|
75
|
-
BPM::Pipeline.new(@project).find_asset('
|
62
|
+
|
63
|
+
it "should find bpm_libs as well" do
|
64
|
+
BPM::Pipeline.new(@project).find_asset('bpm_libs').should == subject
|
76
65
|
end
|
77
66
|
|
78
67
|
it "should have a manifest line" do
|
79
|
-
|
68
|
+
# Right now we're including dev deps
|
69
|
+
subject.to_s.should include('MANIFEST: core-test (0.4.9) custom_generator (1.0) custom_package (2.0.0) ivory (0.0.1) optparse (1.0.1) rake (0.8.6) spade (0.5.0)')
|
80
70
|
end
|
81
71
|
|
82
72
|
it "should include any required modules in the bpm_package.js" do
|
@@ -88,9 +78,9 @@ describe BPM::Pipeline, "asset_path" do
|
|
88
78
|
end
|
89
79
|
|
90
80
|
end
|
91
|
-
|
81
|
+
|
92
82
|
describe "bpm_styles.css" do
|
93
|
-
|
83
|
+
|
94
84
|
subject do
|
95
85
|
BPM::Pipeline.new(@project).find_asset 'bpm_styles.css'
|
96
86
|
end
|
@@ -102,78 +92,106 @@ describe BPM::Pipeline, "asset_path" do
|
|
102
92
|
it "should include any required modules in the bpm_styles.css" do
|
103
93
|
subject.to_s.should include(File.read(home('hello_world', 'packages', 'custom_package', 'css', 'sample_styles.css')))
|
104
94
|
end
|
105
|
-
|
95
|
+
|
106
96
|
it "should reference installed package styles as well" do
|
107
97
|
subject.to_s.should include(File.read(home('hello_world', '.bpm', 'packages', 'core-test', 'resources', 'runner.css')))
|
108
98
|
end
|
109
99
|
|
110
100
|
end
|
111
|
-
|
112
|
-
describe "hello_world/
|
101
|
+
|
102
|
+
describe "hello_world/bpm_libs.js" do
|
113
103
|
|
104
|
+
subject do
|
105
|
+
BPM::Pipeline.new(@project).find_asset 'hello_world/bpm_libs.js'
|
106
|
+
end
|
107
|
+
|
108
|
+
it "should return an asset of type BPM::GeneratedAsset" do
|
109
|
+
subject.class.should == BPM::GeneratedAsset
|
110
|
+
end
|
111
|
+
|
112
|
+
it "should find the bpm_libs.js" do
|
113
|
+
subject.pathname.should == home('hello_world', 'assets', 'hello_world', 'bpm_libs.js')
|
114
|
+
end
|
115
|
+
|
116
|
+
it "should find bpm_libs as well" do
|
117
|
+
BPM::Pipeline.new(@project).find_asset('hello_world/bpm_libs').should == subject
|
118
|
+
end
|
119
|
+
|
120
|
+
it "should have a manifest line" do
|
121
|
+
subject.to_s.should include('MANIFEST: hello_world (2.0.0)')
|
122
|
+
end
|
123
|
+
|
124
|
+
it "should include any required modules in the bpm_libs" do
|
125
|
+
subject.to_s.should include(File.read(home('hello_world', 'lib', 'main.js')))
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
describe "hello_world/bpm_styles.css" do
|
130
|
+
|
114
131
|
before do
|
115
132
|
FileUtils.mkdir_p home('hello_world', 'assets', 'hello_world')
|
116
|
-
FileUtils.touch home('hello_world', 'assets', 'hello_world', '
|
133
|
+
FileUtils.touch home('hello_world', 'assets', 'hello_world', 'bpm_styles.css')
|
117
134
|
end
|
118
135
|
|
119
136
|
subject do
|
120
|
-
BPM::Pipeline.new(@project).find_asset 'hello_world/
|
137
|
+
BPM::Pipeline.new(@project).find_asset 'hello_world/bpm_styles.css'
|
121
138
|
end
|
122
139
|
|
123
140
|
it "should return an asset of type BPM::GeneratedAsset" do
|
124
141
|
subject.class.should == BPM::GeneratedAsset
|
125
142
|
end
|
126
143
|
|
127
|
-
it "should find the
|
128
|
-
subject.pathname.should == home('hello_world', 'assets', 'hello_world', '
|
144
|
+
it "should find the app_styles.css" do
|
145
|
+
subject.pathname.should == home('hello_world', 'assets', 'hello_world', 'bpm_styles.css')
|
129
146
|
end
|
130
|
-
|
131
|
-
it "should find
|
132
|
-
BPM::Pipeline.new(@project).find_asset('hello_world/
|
147
|
+
|
148
|
+
it "should find bpm_styles as well" do
|
149
|
+
BPM::Pipeline.new(@project).find_asset('hello_world/bpm_styles').should == subject
|
133
150
|
end
|
134
151
|
|
135
152
|
it "should have a manifest line" do
|
136
153
|
subject.to_s.should include('MANIFEST: hello_world (2.0.0)')
|
137
154
|
end
|
138
155
|
|
139
|
-
it "should include any required modules in the
|
140
|
-
subject.to_s.should include(File.read(home('hello_world', '
|
156
|
+
it "should include any required modules in the bpm_styles" do
|
157
|
+
subject.to_s.should include(File.read(home('hello_world', 'css', 'dummy.css')))
|
141
158
|
end
|
159
|
+
|
142
160
|
end
|
143
|
-
|
144
|
-
describe "hello_world/
|
145
|
-
|
161
|
+
|
162
|
+
describe "hello_world/app_tests.js" do
|
163
|
+
|
146
164
|
before do
|
147
165
|
FileUtils.mkdir_p home('hello_world', 'assets', 'hello_world')
|
148
|
-
FileUtils.touch home('hello_world', 'assets', 'hello_world', '
|
166
|
+
FileUtils.touch home('hello_world', 'assets', 'hello_world', 'app_tests.js')
|
149
167
|
end
|
150
|
-
|
168
|
+
|
151
169
|
subject do
|
152
|
-
BPM::Pipeline.new(@project).find_asset 'hello_world/
|
170
|
+
BPM::Pipeline.new(@project).find_asset 'hello_world/bpm_tests.js'
|
153
171
|
end
|
154
|
-
|
172
|
+
|
155
173
|
it "should return an asset of type BPM::GeneratedAsset" do
|
156
174
|
subject.class.should == BPM::GeneratedAsset
|
157
175
|
end
|
158
|
-
|
159
|
-
it "should find the
|
160
|
-
subject.pathname.should == home('hello_world', 'assets', 'hello_world', '
|
176
|
+
|
177
|
+
it "should find the app_tests.js" do
|
178
|
+
subject.pathname.should == home('hello_world', 'assets', 'hello_world', 'bpm_tests.js')
|
161
179
|
end
|
162
|
-
|
163
|
-
it "should find
|
164
|
-
BPM::Pipeline.new(@project).find_asset('hello_world/
|
180
|
+
|
181
|
+
it "should find app_tests as well" do
|
182
|
+
BPM::Pipeline.new(@project).find_asset('hello_world/bpm_tests').should == subject
|
165
183
|
end
|
166
|
-
|
184
|
+
|
167
185
|
it "should have a manifest line" do
|
168
186
|
subject.to_s.should include('MANIFEST: hello_world (2.0.0)')
|
169
187
|
end
|
170
|
-
|
171
|
-
it "should include any required modules in the
|
172
|
-
subject.to_s.should include(File.read(home('hello_world', '
|
188
|
+
|
189
|
+
it "should include any required modules in the bpm_tests" do
|
190
|
+
subject.to_s.should include(File.read(home('hello_world', 'tests', 'main-test.js')))
|
173
191
|
end
|
174
|
-
|
192
|
+
|
175
193
|
end
|
176
|
-
|
194
|
+
|
177
195
|
end
|
178
196
|
|
179
197
|
end
|
@@ -184,14 +202,14 @@ describe BPM::Pipeline, "buildable_assets" do
|
|
184
202
|
before do
|
185
203
|
set_host
|
186
204
|
goto_home
|
187
|
-
FileUtils.cp_r(
|
205
|
+
FileUtils.cp_r(project_fixture('hello_world'), '.')
|
188
206
|
reset_libgems bpm_dir.to_s
|
189
207
|
|
190
208
|
start_fake(FakeGemServer.new)
|
191
209
|
cd home('hello_world')
|
192
210
|
|
193
|
-
bpm '
|
194
|
-
wait
|
211
|
+
bpm 'fetch' and wait
|
212
|
+
bpm 'add', 'custom_package', '--verbose' and wait
|
195
213
|
|
196
214
|
@project = BPM::Project.new home('hello_world')
|
197
215
|
end
|
@@ -208,10 +226,10 @@ describe BPM::Pipeline, "buildable_assets" do
|
|
208
226
|
subject.find { |x| x.logical_path == logical_path }
|
209
227
|
end
|
210
228
|
|
211
|
-
it "should include
|
212
|
-
asset = find_asset '
|
229
|
+
it "should include bpm_libs.js" do
|
230
|
+
asset = find_asset 'bpm_libs.js'
|
213
231
|
asset.should_not be_nil
|
214
|
-
asset.pathname.should == project('assets', '
|
232
|
+
asset.pathname.should == project('assets', 'bpm_libs.js')
|
215
233
|
end
|
216
234
|
|
217
235
|
it "should include bpm_styles.css" do
|
@@ -238,4 +256,4 @@ describe BPM::Pipeline, "buildable_assets" do
|
|
238
256
|
end
|
239
257
|
|
240
258
|
end
|
241
|
-
|
259
|
+
|
@@ -8,7 +8,7 @@ describe BPM::Pipeline, 'minifier' do
|
|
8
8
|
reset_libgems bpm_dir.to_s
|
9
9
|
start_fake(FakeGemServer.new)
|
10
10
|
|
11
|
-
FileUtils.cp_r
|
11
|
+
FileUtils.cp_r project_fixture('minitest'), '.'
|
12
12
|
cd home('minitest')
|
13
13
|
|
14
14
|
bpm 'compile'
|
@@ -17,23 +17,21 @@ describe BPM::Pipeline, 'minifier' do
|
|
17
17
|
|
18
18
|
subject do
|
19
19
|
project = BPM::Project.new home('minitest')
|
20
|
-
BPM::Pipeline.new project
|
20
|
+
BPM::Pipeline.new project, :production
|
21
21
|
end
|
22
22
|
|
23
|
-
it "should wrap
|
24
|
-
asset = subject.find_asset '
|
25
|
-
file_path = home('minitest', 'packages', 'uglyduck', 'lib', 'main.js')
|
23
|
+
it "should wrap bpm_libs.js" do
|
24
|
+
asset = subject.find_asset 'bpm_libs.js'
|
26
25
|
expected = <<EOF
|
27
|
-
//MINIFIED START
|
28
|
-
UGLY DUCK IS UGLY
|
29
26
|
/* ===========================================================================
|
30
|
-
BPM
|
31
|
-
MANIFEST:
|
27
|
+
BPM Combined Asset File
|
28
|
+
MANIFEST: (none)
|
32
29
|
This file is generated automatically by the bpm (http://www.bpmjs.org)
|
33
|
-
To use this file, load this file in your HTML head.
|
34
30
|
=========================================================================*/
|
31
|
+
//MINIFIED START
|
32
|
+
UGLY DUCK IS UGLY
|
33
|
+
|
35
34
|
|
36
|
-
#{File.read file_path}
|
37
35
|
//MINIFIED END
|
38
36
|
EOF
|
39
37
|
|
@@ -41,17 +39,16 @@ EOF
|
|
41
39
|
end
|
42
40
|
|
43
41
|
it "should wrap app_package.js" do
|
44
|
-
asset = subject.find_asset 'minitest/
|
42
|
+
asset = subject.find_asset 'minitest/bpm_libs.js'
|
45
43
|
file_path = home('minitest', 'lib', 'main.js')
|
46
44
|
expected = <<EOF
|
47
|
-
//MINIFIED START
|
48
|
-
UGLY DUCK IS UGLY
|
49
45
|
/* ===========================================================================
|
50
|
-
BPM
|
46
|
+
BPM Combined Asset File
|
51
47
|
MANIFEST: minitest (2.0.0)
|
52
48
|
This file is generated automatically by the bpm (http://www.bpmjs.org)
|
53
|
-
To use this file, load this file in your HTML head.
|
54
49
|
=========================================================================*/
|
50
|
+
//MINIFIED START
|
51
|
+
UGLY DUCK IS UGLY
|
55
52
|
|
56
53
|
#{File.read(file_path)}
|
57
54
|
//MINIFIED END
|
@@ -59,6 +56,18 @@ EOF
|
|
59
56
|
asset.to_s.should == expected
|
60
57
|
end
|
61
58
|
|
59
|
+
subject do
|
60
|
+
project = BPM::Project.new home('minitest')
|
61
|
+
BPM::Pipeline.new project, :production
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should not wrap bpm_libs.js in debug mode" do
|
65
|
+
project = BPM::Project.new home('minitest')
|
66
|
+
pipeline = BPM::Pipeline.new project, :debug
|
67
|
+
asset = pipeline.find_asset 'minitest/app_package.js'
|
68
|
+
asset.to_s.should_not include('//MINIFIED START')
|
69
|
+
end
|
70
|
+
|
62
71
|
end
|
63
72
|
|
64
73
|
|
data/spec/project_spec.rb
CHANGED
@@ -3,23 +3,23 @@ require "spec_helper"
|
|
3
3
|
describe BPM::Project, "project_file_path" do
|
4
4
|
|
5
5
|
it "should return project file path" do
|
6
|
-
path =
|
6
|
+
path = project_fixture('hello_world')
|
7
7
|
expected = File.join(path, 'hello_world.json')
|
8
8
|
BPM::Project.project_file_path(path).should == expected
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should return nil on a package" do
|
12
|
-
path =
|
12
|
+
path = package_fixture('core-test')
|
13
13
|
BPM::Project.project_file_path(path).should == nil
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should return nil on a project with no file" do
|
17
|
-
path =
|
17
|
+
path = project_fixture('simple_hello')
|
18
18
|
BPM::Project.project_file_path(path).should == nil
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should return project path with different name" do
|
22
|
-
path =
|
22
|
+
path = project_fixture('custom_name')
|
23
23
|
expected = File.join(path, 'MyProject.json')
|
24
24
|
BPM::Project.project_file_path(path).should == expected
|
25
25
|
end
|
@@ -29,15 +29,15 @@ end
|
|
29
29
|
describe BPM::Project, "is_project_root?" do
|
30
30
|
|
31
31
|
it "should return true for a project path" do
|
32
|
-
BPM::Project.is_project_root?(
|
32
|
+
BPM::Project.is_project_root?(project_fixture('hello_world')).should == true
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should return false for a package" do
|
36
|
-
BPM::Project.is_project_root?(
|
36
|
+
BPM::Project.is_project_root?(package_fixture('core-test')).should == false
|
37
37
|
end
|
38
38
|
|
39
39
|
it "should return true for a project with no project file" do
|
40
|
-
BPM::Project.is_project_root?(
|
40
|
+
BPM::Project.is_project_root?(project_fixture('simple_hello')).should == true
|
41
41
|
end
|
42
42
|
|
43
43
|
end
|
@@ -46,7 +46,7 @@ describe BPM::Project, "nearest_project" do
|
|
46
46
|
|
47
47
|
describe "standard project" do
|
48
48
|
subject do
|
49
|
-
|
49
|
+
project_fixture('hello_world').to_s # string not Pathname
|
50
50
|
end
|
51
51
|
|
52
52
|
it "should return project instance for project path" do
|
@@ -61,7 +61,7 @@ describe BPM::Project, "nearest_project" do
|
|
61
61
|
|
62
62
|
describe "simple project" do
|
63
63
|
subject do
|
64
|
-
|
64
|
+
project_fixture('simple_hello').to_s # string not Pathname
|
65
65
|
end
|
66
66
|
|
67
67
|
it "should return project instance for project path" do
|
@@ -75,7 +75,7 @@ describe BPM::Project, "nearest_project" do
|
|
75
75
|
end
|
76
76
|
|
77
77
|
it "should return nil for a package" do
|
78
|
-
BPM::Project.nearest_project(
|
78
|
+
BPM::Project.nearest_project(package_fixture('core-test')).should == nil
|
79
79
|
end
|
80
80
|
|
81
81
|
end
|
@@ -84,13 +84,11 @@ describe BPM::Project, "project metadata" do
|
|
84
84
|
|
85
85
|
describe "standard project" do
|
86
86
|
subject do
|
87
|
-
BPM::Project.new
|
87
|
+
BPM::Project.new project_fixture('hello_world')
|
88
88
|
end
|
89
89
|
|
90
|
-
it
|
91
|
-
|
92
|
-
end
|
93
|
-
|
90
|
+
it { should be_valid }
|
91
|
+
|
94
92
|
it "should get project name" do
|
95
93
|
subject.name.should == "hello_world"
|
96
94
|
end
|
@@ -105,18 +103,42 @@ describe BPM::Project, "project metadata" do
|
|
105
103
|
"core-test" => "0.4.9"
|
106
104
|
}
|
107
105
|
end
|
108
|
-
|
106
|
+
|
107
|
+
it "should get development dependencies" do
|
108
|
+
subject.dependencies_development.should == {
|
109
|
+
"custom_generator" => "1.0",
|
110
|
+
"jquery" => "1.4.3"
|
111
|
+
}
|
112
|
+
end
|
113
|
+
|
109
114
|
end
|
110
115
|
|
116
|
+
describe "project with different name" do
|
117
|
+
before do
|
118
|
+
goto_home
|
119
|
+
FileUtils.cp_r project_fixture('hello_world'), 'HelloWorld2'
|
120
|
+
end
|
121
|
+
|
122
|
+
subject do
|
123
|
+
BPM::Project.new home('HelloWorld2')
|
124
|
+
end
|
125
|
+
|
126
|
+
# packages do not allow the directory and "name" to be different. make
|
127
|
+
# sure project doesn't inherit this.
|
128
|
+
it "should not raise exception when loading json" do
|
129
|
+
lambda {
|
130
|
+
subject.load_json
|
131
|
+
}.should_not raise_error
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
111
135
|
describe "simple project" do
|
112
136
|
subject do
|
113
|
-
BPM::Project.new
|
137
|
+
BPM::Project.new project_fixture('simple_hello')
|
114
138
|
end
|
115
139
|
|
116
|
-
it
|
117
|
-
|
118
|
-
end
|
119
|
-
|
140
|
+
it { should be_valid }
|
141
|
+
|
120
142
|
it "should get project name" do
|
121
143
|
subject.name.should == "simple_hello"
|
122
144
|
end
|
@@ -126,7 +148,8 @@ describe BPM::Project, "project metadata" do
|
|
126
148
|
subject.version.should == "0.0.1"
|
127
149
|
end
|
128
150
|
|
129
|
-
|
151
|
+
# FIXME: Is this test even useful?
|
152
|
+
it "should get dependencies read from bpm_libs.js file" do
|
130
153
|
subject.dependencies.should == {
|
131
154
|
}
|
132
155
|
end
|
@@ -137,30 +160,70 @@ end
|
|
137
160
|
|
138
161
|
describe BPM::Project, "converting" do
|
139
162
|
subject do
|
140
|
-
BPM::Project.nearest_project(
|
163
|
+
BPM::Project.nearest_project(project_fixture("hello_world")).as_json
|
141
164
|
end
|
142
165
|
|
143
|
-
it "should have bpm set to current version" do
|
144
|
-
subject["bpm"].should == BPM::
|
166
|
+
it "should have bpm set to current compatible version" do
|
167
|
+
subject["bpm"].should == BPM::COMPAT_VERSION
|
145
168
|
end
|
146
169
|
end
|
147
170
|
|
148
171
|
describe BPM::Project, "package_and_module_from_path" do
|
149
172
|
|
150
|
-
|
173
|
+
before do
|
174
|
+
# This seems a bit overkill, but we need our dependencies installed
|
175
|
+
goto_home
|
176
|
+
set_host
|
177
|
+
start_fake(FakeGemServer.new)
|
178
|
+
FileUtils.cp_r(project_fixture('hello_world'), '.')
|
179
|
+
cd home('hello_world')
|
180
|
+
end
|
151
181
|
|
152
|
-
|
182
|
+
subject do
|
183
|
+
proj = BPM::Project.nearest_project('.')
|
184
|
+
with_env{ proj.fetch_dependencies }
|
185
|
+
proj
|
186
|
+
end
|
153
187
|
|
154
|
-
|
188
|
+
# TODO: Make into a nice matcher
|
189
|
+
def check_package_and_module(proj, path, pkg_name, module_id)
|
190
|
+
pkg, id = proj.package_and_module_from_path(path)
|
191
|
+
pkg.name.should == pkg_name
|
192
|
+
id.should == module_id
|
193
|
+
end
|
155
194
|
|
156
|
-
it "should
|
157
|
-
|
195
|
+
it "should find path in self" do
|
196
|
+
check_package_and_module(subject, home("hello_world", "css", "dummy.css"),
|
197
|
+
"hello_world", "~css/dummy")
|
198
|
+
end
|
158
199
|
|
159
|
-
it "should
|
160
|
-
|
200
|
+
it "should find path in dependencies" do
|
201
|
+
check_package_and_module(subject, home("hello_world", ".bpm", "packages", "core-test", "resources", "runner.css"),
|
202
|
+
"core-test", "~resources/runner")
|
203
|
+
end
|
204
|
+
|
205
|
+
it "should throw error if no package" do
|
206
|
+
l = lambda{ subject.package_and_module_from_path(project_fixture("simple_hello")) }
|
207
|
+
l.should raise_error(/simple_hello is not within a known package/)
|
208
|
+
end
|
161
209
|
|
162
|
-
it "should
|
210
|
+
it "should not match partial directories" do
|
211
|
+
# We're verifying that core-testing doesn't match core-test
|
212
|
+
# Since there is no core-testing package it will fall back to the base package, hello_world
|
213
|
+
check_package_and_module(subject, home("hello_world", ".bpm", "packages", "core-testing", "resources", "runner.css"),
|
214
|
+
"hello_world", "~.bpm/packages/core-testing/resources/runner")
|
215
|
+
end
|
163
216
|
|
164
|
-
it "should
|
217
|
+
it "should handle directory reference in package directories array" do
|
218
|
+
check_package_and_module(subject, home("hello_world", "lib", "main.js"),
|
219
|
+
"hello_world", "main")
|
220
|
+
check_package_and_module(subject, home("hello_world", "vendor", "lib", "something.js"),
|
221
|
+
"hello_world", "something")
|
222
|
+
end
|
223
|
+
|
224
|
+
it "should replace with directory names" do
|
225
|
+
check_package_and_module(subject, home("hello_world", "custom_dir", "custom.js"),
|
226
|
+
"hello_world", "~custom/custom")
|
227
|
+
end
|
165
228
|
|
166
229
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -21,6 +21,47 @@ module SpecHelpers
|
|
21
21
|
LibGems.host = @original_host if @original_host
|
22
22
|
LibGems.sources = @original_sources if @original_sources
|
23
23
|
end
|
24
|
+
|
25
|
+
# Use to avoid throwing errors just because an extra newline shows up
|
26
|
+
# somewhere
|
27
|
+
def normalize_whitespace(string)
|
28
|
+
string.gsub(/ +/, ' ').gsub(/\n+/,"\n")
|
29
|
+
end
|
30
|
+
|
31
|
+
def compare_file_contents(actual_path, expected_path)
|
32
|
+
actual_contents = normalize_whitespace File.read(actual_path)
|
33
|
+
expected_contents = normalize_whitespace File.read(expected_path)
|
34
|
+
actual_contents.should == expected_contents
|
35
|
+
end
|
36
|
+
|
37
|
+
# compares the contents of two directories to ensure they are the same.
|
38
|
+
# ignores any whitespaces on files.
|
39
|
+
def compare_contents(actual_root, expected_root)
|
40
|
+
actual_root = actual_root.to_s
|
41
|
+
expected_root = expected_root.to_s # incase Pathname is passed
|
42
|
+
|
43
|
+
if File.directory? expected_root
|
44
|
+
# first make sure the same files are in each.
|
45
|
+
expected_files = Dir.glob(File.join(expected_root, '**', '*')).sort
|
46
|
+
actual_files = Dir.glob(File.join(actual_root, '**', '*')).sort
|
47
|
+
|
48
|
+
actual_files.map! { |path| expected_root + path[actual_root.size..-1] }
|
49
|
+
actual_files.should == expected_files
|
50
|
+
|
51
|
+
expected_files.each do |expected_path|
|
52
|
+
display_path = expected_path[expected_root.size..-1]
|
53
|
+
actual_path = @project_path + display_path
|
54
|
+
if File.directory? expected_path
|
55
|
+
File.directory?(actual_path).should be_true
|
56
|
+
else
|
57
|
+
compare_file_contents actual_path, expected_path
|
58
|
+
end
|
59
|
+
end
|
60
|
+
else
|
61
|
+
compare_file_contents actual_path, expected_path
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
24
65
|
end
|
25
66
|
|
26
67
|
RSpec.configure do |config|
|