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
@@ -17,7 +17,9 @@ class FakeGemServer
|
|
17
17
|
index("spade", "0.5.0"),
|
18
18
|
index("jquery", "1.4.3"),
|
19
19
|
index("ivory", "0.0.1"),
|
20
|
-
index("optparse", "1.0.1")
|
20
|
+
index("optparse", "1.0.1"),
|
21
|
+
index("uglify-js", "1.0.4"),
|
22
|
+
index("custom_generator", "1.0")
|
21
23
|
]
|
22
24
|
[200, {"Content-Type" => "application/octet-stream"}, compress(latest_index)]
|
23
25
|
elsif request.path =~ /prerelease_specs/
|
@@ -36,7 +38,9 @@ class FakeGemServer
|
|
36
38
|
index("spade", "0.5.0"),
|
37
39
|
index("jquery", "1.4.3"),
|
38
40
|
index("ivory", "0.0.1"),
|
39
|
-
index("optparse", "1.0.1")
|
41
|
+
index("optparse", "1.0.1"),
|
42
|
+
index("uglify-js", "1.0.4"),
|
43
|
+
index("custom_generator", "1.0")
|
40
44
|
]
|
41
45
|
[200, {"Content-Type" => "application/octet-stream"}, compress(big_index)]
|
42
46
|
elsif request.path =~ /\/quick\/Marshal\.4\.8\/(.*)\.gemspec\.rz$/
|
@@ -63,8 +67,8 @@ class FakeGemServer
|
|
63
67
|
private
|
64
68
|
|
65
69
|
def gem_or_bpkg(name)
|
66
|
-
fixture = fixtures("#{name}.gem")
|
67
|
-
fixture = fixtures("#{name}.bpkg") unless File.exist?(fixture)
|
70
|
+
fixture = fixtures('gems', "#{name}.gem")
|
71
|
+
fixture = fixtures('gems', "#{name}.bpkg") unless File.exist?(fixture)
|
68
72
|
fixture
|
69
73
|
end
|
70
74
|
|
data/spec/support/path.rb
CHANGED
@@ -34,6 +34,14 @@ module SpecHelpers
|
|
34
34
|
root.join('spec/fixtures', *path)
|
35
35
|
end
|
36
36
|
|
37
|
+
def project_fixture(*path)
|
38
|
+
fixtures 'projects', *path
|
39
|
+
end
|
40
|
+
|
41
|
+
def package_fixture(*path)
|
42
|
+
fixtures 'packages', *path
|
43
|
+
end
|
44
|
+
|
37
45
|
def tmp(*path)
|
38
46
|
root.join("tmp", *path)
|
39
47
|
end
|
data/spec/support/project.rb
CHANGED
@@ -1,43 +1,76 @@
|
|
1
|
-
module SpecHelpers
|
1
|
+
module SpecHelpers
|
2
2
|
|
3
|
-
def validate_dependency_in_project_file(package_name, package_version)
|
3
|
+
def validate_dependency_in_project_file(package_name, package_version, development=false)
|
4
4
|
json = JSON.parse File.read(home('hello_world', 'hello_world.json'))
|
5
|
-
|
5
|
+
key = development ? "dependencies:development" : "dependencies"
|
6
|
+
json[key][package_name].should == package_version
|
6
7
|
end
|
7
8
|
|
8
9
|
def validate_installed_dependency(package_name, package_version)
|
9
|
-
|
10
|
+
bpm_libs = home 'hello_world', 'assets', 'bpm_libs.js'
|
10
11
|
bpm_styles = home 'hello_world', 'assets', 'bpm_styles.css'
|
11
|
-
|
12
|
+
version_regexp = package_version ? Regexp.escape(package_version) : ".+?"
|
13
|
+
exp_str = /#{package_name} \(#{version_regexp}\)/
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
if package_version
|
16
|
+
File.exists?(bpm_libs).should be_true
|
17
|
+
File.exists?(bpm_styles).should be_true
|
18
|
+
bpm_libs = File.readlines(bpm_libs)[0..6].join("")
|
19
|
+
bpm_styles = File.readlines(bpm_styles)[0..6].join("")
|
20
|
+
else
|
21
|
+
if !File.exists?(bpm_libs)
|
22
|
+
File.exists?(bpm_libs).should_not be_true
|
23
|
+
bpm_libs = nil
|
24
|
+
else
|
25
|
+
bpm_libs = File.readlines(bpm_libs)[0..6].join("")
|
26
|
+
end
|
15
27
|
|
28
|
+
if !File.exists?(bpm_styles)
|
29
|
+
File.exists?(bpm_styles).should_not be_true
|
30
|
+
bpm_styles = nil
|
31
|
+
else
|
32
|
+
bpm_styles = File.readlines(bpm_styles)[0..6].join("")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
16
36
|
if package_version
|
17
|
-
|
18
|
-
bpm_styles.should
|
37
|
+
bpm_libs.should =~ exp_str
|
38
|
+
bpm_styles.should =~ exp_str
|
19
39
|
else
|
20
|
-
|
21
|
-
|
40
|
+
# note: it's ok if the file does not exist; means asset was not built
|
41
|
+
bpm_libs.should_not =~ exp_str if bpm_libs
|
42
|
+
bpm_styles.should_not =~ exp_str if bpm_styles
|
22
43
|
end
|
23
44
|
end
|
24
45
|
|
25
46
|
def has_dependency(package_name, package_version, hard_version = '>= 0')
|
26
47
|
validate_dependency_in_project_file package_name, hard_version
|
27
48
|
validate_installed_dependency package_name, package_version
|
28
|
-
# TODO: Verify packages built into
|
49
|
+
# TODO: Verify packages built into bpm_libs.js and css
|
50
|
+
end
|
51
|
+
|
52
|
+
def has_development_dependency(package_name, package_version, hard_version = '>= 0')
|
53
|
+
validate_dependency_in_project_file package_name, hard_version, true
|
54
|
+
validate_installed_dependency package_name, package_version
|
55
|
+
# TODO: Verify packages built into bpm_libs.js and css
|
29
56
|
end
|
30
57
|
|
31
58
|
def has_soft_dependency(package_name, package_version)
|
32
59
|
validate_dependency_in_project_file package_name, nil
|
33
60
|
validate_installed_dependency package_name, package_version
|
34
|
-
# TODO: Verify packages built into
|
61
|
+
# TODO: Verify packages built into bpm_libs.js and css
|
35
62
|
end
|
36
63
|
|
37
|
-
def no_dependency(package_name)
|
64
|
+
def no_dependency(package_name, check_installed=true)
|
38
65
|
validate_dependency_in_project_file package_name, nil
|
39
|
-
validate_installed_dependency package_name, nil
|
40
|
-
# TODO: Verify packages not built into
|
66
|
+
validate_installed_dependency package_name, nil if check_installed
|
67
|
+
# TODO: Verify packages not built into bpm_libs.js and css
|
41
68
|
end
|
42
|
-
|
69
|
+
|
70
|
+
def no_development_dependency(package_name, check_installed=true)
|
71
|
+
validate_dependency_in_project_file package_name, nil, true
|
72
|
+
validate_installed_dependency package_name, nil if check_installed
|
73
|
+
# TODO: Verify packages not built into bpm_libs.js and css
|
74
|
+
end
|
75
|
+
|
43
76
|
end
|
data/templates/init/project.json
CHANGED
@@ -1,18 +1,16 @@
|
|
1
1
|
{
|
2
|
-
"name":
|
3
|
-
"
|
4
|
-
"bpm": "<%= bpm_version %>",
|
2
|
+
"name": "<%= name %>",
|
3
|
+
"bpm": "<%= bpm_version %>",
|
5
4
|
|
6
|
-
"
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
"
|
13
|
-
|
14
|
-
|
15
|
-
"dependencies": {
|
16
|
-
<%= %["#{package.name}": "#{package.version}"] if package %>
|
5
|
+
"bpm:build": {
|
6
|
+
"bpm_libs.js": {
|
7
|
+
"directories": [],
|
8
|
+
"minifier": "uglify-js"
|
9
|
+
},
|
10
|
+
|
11
|
+
"bpm_styles.css": {
|
12
|
+
"directories": []
|
13
|
+
}
|
17
14
|
}
|
18
15
|
}
|
16
|
+
|
data/templates/project/LICENSE
CHANGED
@@ -0,0 +1,6 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: <%= name %>
|
3
|
+
// Copyright: ©<%= current_year %> <%= company_name %> All rights reserved.
|
4
|
+
// ==========================================================================
|
5
|
+
|
6
|
+
// TODO: Your app code goes here
|
@@ -0,0 +1 @@
|
|
1
|
+
/* TODO: Add your app CSS here */
|
@@ -1,13 +1,14 @@
|
|
1
1
|
<html>
|
2
2
|
<head>
|
3
|
-
<script type="text/javascript" src="assets/bpm_packages.js"></script>
|
4
|
-
<script type="text/javascript" src="app.js"></script>
|
5
|
-
|
6
3
|
<link rel="stylesheet" href="assets/bpm_styles.css" type="text/css" media="screen" charset="utf-8" />
|
4
|
+
<link rel="stylesheet" href="assets/<%= name %>/bpm_styles.css" type="text/css" media="screen" charset="utf-8" />
|
7
5
|
|
8
6
|
<title><%= name %></title>
|
9
7
|
</head>
|
10
8
|
<body>
|
11
9
|
<h1>Hello World</h1>
|
12
10
|
</body>
|
11
|
+
|
12
|
+
<script type="text/javascript" src="assets/bpm_libs.js"></script>
|
13
|
+
<script type="text/javascript" src="assets/<%= name %>/bpm_libs.js"></script>
|
13
14
|
</html>
|
data/vendor/sprockets/Gemfile
CHANGED
@@ -12,39 +12,39 @@ module Sprockets
|
|
12
12
|
|
13
13
|
# Define base set of attributes to be serialized.
|
14
14
|
def self.serialized_attributes
|
15
|
-
%w(
|
16
|
-
logical_path pathname
|
17
|
-
content_type mtime length digest )
|
15
|
+
%w( id logical_path pathname )
|
18
16
|
end
|
19
17
|
|
20
18
|
attr_reader :environment
|
21
|
-
attr_reader :logical_path, :pathname
|
19
|
+
attr_reader :id, :logical_path, :pathname
|
22
20
|
|
23
21
|
def initialize(environment, logical_path, pathname)
|
24
22
|
@environment = environment
|
25
23
|
@logical_path = logical_path.to_s
|
26
24
|
@pathname = Pathname.new(pathname)
|
25
|
+
@id = environment.digest.update(object_id.to_s).to_s
|
27
26
|
end
|
28
27
|
|
29
28
|
# Initialize `Asset` from serialized `Hash`.
|
30
29
|
def init_with(environment, coder)
|
31
30
|
@environment = environment
|
31
|
+
@pathname = @mtime = @length = nil
|
32
32
|
|
33
33
|
self.class.serialized_attributes.each do |attr|
|
34
34
|
instance_variable_set("@#{attr}", coder[attr].to_s) if coder[attr]
|
35
35
|
end
|
36
36
|
|
37
|
-
if @pathname
|
37
|
+
if @pathname && @pathname.is_a?(String)
|
38
38
|
# Expand `$root` placeholder and wrapper string in a `Pathname`
|
39
39
|
@pathname = Pathname.new(expand_root_path(@pathname))
|
40
40
|
end
|
41
41
|
|
42
|
-
if @mtime
|
42
|
+
if @mtime && @mtime.is_a?(String)
|
43
43
|
# Parse time string
|
44
44
|
@mtime = Time.parse(@mtime)
|
45
45
|
end
|
46
46
|
|
47
|
-
if @length
|
47
|
+
if @length && @length.is_a?(String)
|
48
48
|
# Convert length to an `Integer`
|
49
49
|
@length = Integer(@length)
|
50
50
|
end
|
@@ -140,11 +140,6 @@ module Sprockets
|
|
140
140
|
alias_method :==, :eql?
|
141
141
|
|
142
142
|
protected
|
143
|
-
# Stores the environment digest from when the asset was first created.
|
144
|
-
def environment_hexdigest
|
145
|
-
@environment_hexdigest ||= environment.digest.hexdigest
|
146
|
-
end
|
147
|
-
|
148
143
|
# Get pathname with its root stripped.
|
149
144
|
def relative_pathname
|
150
145
|
Pathname.new(relativize_root_path(pathname))
|
@@ -13,24 +13,6 @@ module Sprockets
|
|
13
13
|
@pathname = path.is_a?(Pathname) ? path : Pathname.new(path.to_s)
|
14
14
|
end
|
15
15
|
|
16
|
-
# Returns `Array` of extension `String`s.
|
17
|
-
#
|
18
|
-
# "foo.js.coffee"
|
19
|
-
# # => [".js", ".coffee"]
|
20
|
-
#
|
21
|
-
def extensions
|
22
|
-
@extensions ||= @pathname.basename.to_s.scan(/\.[^.]+/)
|
23
|
-
end
|
24
|
-
|
25
|
-
# Returns basename alone.
|
26
|
-
#
|
27
|
-
# "foo/bar.js"
|
28
|
-
# # => "bar"
|
29
|
-
#
|
30
|
-
def basename_without_extensions
|
31
|
-
@pathname.basename(extensions.join)
|
32
|
-
end
|
33
|
-
|
34
16
|
# Replaces `$root` placeholder with actual environment root.
|
35
17
|
def expand_root
|
36
18
|
pathname.to_s.sub(/^\$root/, environment.root)
|
@@ -48,27 +30,66 @@ module Sprockets
|
|
48
30
|
sub(/^#{Regexp.escape(environment.root)}\//, '')
|
49
31
|
end
|
50
32
|
|
51
|
-
# Returns the
|
52
|
-
|
53
|
-
|
54
|
-
|
33
|
+
# Returns paths search the load path for.
|
34
|
+
def search_paths
|
35
|
+
paths = [pathname.to_s]
|
36
|
+
|
37
|
+
if format_extension && engine_extensions.empty?
|
38
|
+
environment.engine_formats(format_extension).each do |ext, engine|
|
39
|
+
paths << pathname.sub(format_extension, ext).to_s
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
if pathname.basename(extensions.join).to_s != 'index'
|
44
|
+
path_without_extensions = extensions.inject(pathname) { |p, ext| p.sub(ext, '') }
|
45
|
+
index_path = path_without_extensions.join("index#{extensions.join}").to_s
|
46
|
+
|
47
|
+
paths << index_path
|
48
|
+
|
49
|
+
if format_extension && engine_extensions.empty?
|
50
|
+
environment.engine_formats(format_extension).each do |ext, engine|
|
51
|
+
paths << index_path.sub(format_extension, ext).to_s
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
paths
|
57
|
+
end
|
58
|
+
|
59
|
+
# Reverse guess logical path for fully expanded path.
|
55
60
|
#
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
61
|
+
# This has some known issues. For an example if a file is
|
62
|
+
# shaddowed in the path, but is required relatively, its logical
|
63
|
+
# path will be incorrect.
|
64
|
+
def logical_path
|
65
|
+
raise ArgumentError unless pathname.absolute?
|
66
|
+
|
67
|
+
if root_path = environment.paths.detect { |path| pathname.to_s[path] }
|
68
|
+
path = pathname.relative_path_from(Pathname.new(root_path)).to_s
|
69
|
+
path = engine_extensions.inject(path) { |p, ext| p.sub(ext, '') }
|
70
|
+
path = "#{path}#{engine_format_extension}" unless format_extension
|
71
|
+
path
|
62
72
|
end
|
63
73
|
end
|
64
74
|
|
75
|
+
# Returns `Array` of extension `String`s.
|
76
|
+
#
|
77
|
+
# "foo.js.coffee"
|
78
|
+
# # => [".js", ".coffee"]
|
79
|
+
#
|
80
|
+
def extensions
|
81
|
+
@extensions ||= @pathname.basename.to_s.scan(/\.[^.]+/)
|
82
|
+
end
|
83
|
+
|
65
84
|
# Returns the format extension.
|
66
85
|
#
|
67
86
|
# "foo.js.coffee"
|
68
87
|
# # => ".js"
|
69
88
|
#
|
70
89
|
def format_extension
|
71
|
-
extensions.detect { |ext|
|
90
|
+
extensions.detect { |ext|
|
91
|
+
@environment.mime_types(ext) && !@environment.engines(ext)
|
92
|
+
}
|
72
93
|
end
|
73
94
|
|
74
95
|
# Returns an `Array` of engine extensions.
|
@@ -86,17 +107,6 @@ module Sprockets
|
|
86
107
|
exts.select { |ext| @environment.engines(ext) }
|
87
108
|
end
|
88
109
|
|
89
|
-
# Returns path without any engine extensions.
|
90
|
-
#
|
91
|
-
# "foo.js.coffee.erb"
|
92
|
-
# # => "foo.js"
|
93
|
-
#
|
94
|
-
def without_engine_extensions
|
95
|
-
engine_extensions.inject(pathname) do |p, ext|
|
96
|
-
p.sub(ext, '')
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
110
|
# Returns engine classes.
|
101
111
|
def engines
|
102
112
|
engine_extensions.map { |ext| @environment.engines(ext) }
|
@@ -109,19 +119,6 @@ module Sprockets
|
|
109
119
|
environment.postprocessors(content_type)
|
110
120
|
end
|
111
121
|
|
112
|
-
# Returns implicit engine content type.
|
113
|
-
#
|
114
|
-
# `.coffee` files carry an implicit `application/javascript`
|
115
|
-
# content type.
|
116
|
-
def engine_content_type
|
117
|
-
engines.reverse.each do |engine|
|
118
|
-
if engine.respond_to?(:default_mime_type) && engine.default_mime_type
|
119
|
-
return engine.default_mime_type
|
120
|
-
end
|
121
|
-
end
|
122
|
-
nil
|
123
|
-
end
|
124
|
-
|
125
122
|
# Returns the content type for the pathname. Falls back to `application/octet-stream`.
|
126
123
|
def content_type
|
127
124
|
@content_type ||= begin
|
@@ -157,5 +154,25 @@ module Sprockets
|
|
157
154
|
pathname.dirname.to_s == '.' ? basename : pathname.dirname.join(basename).to_s
|
158
155
|
end
|
159
156
|
end
|
157
|
+
|
158
|
+
private
|
159
|
+
# Returns implicit engine content type.
|
160
|
+
#
|
161
|
+
# `.coffee` files carry an implicit `application/javascript`
|
162
|
+
# content type.
|
163
|
+
def engine_content_type
|
164
|
+
engines.reverse.each do |engine|
|
165
|
+
if engine.respond_to?(:default_mime_type) && engine.default_mime_type
|
166
|
+
return engine.default_mime_type
|
167
|
+
end
|
168
|
+
end
|
169
|
+
nil
|
170
|
+
end
|
171
|
+
|
172
|
+
def engine_format_extension
|
173
|
+
if content_type = engine_content_type
|
174
|
+
environment.extension_for_mime_type(content_type)
|
175
|
+
end
|
176
|
+
end
|
160
177
|
end
|
161
178
|
end
|
@@ -97,7 +97,7 @@ module Sprockets
|
|
97
97
|
pathname = Pathname.new(path)
|
98
98
|
|
99
99
|
if pathname.absolute?
|
100
|
-
build_asset(
|
100
|
+
build_asset(attributes_for(pathname).logical_path, pathname, options)
|
101
101
|
else
|
102
102
|
find_asset_in_path(pathname, options)
|
103
103
|
end
|
@@ -130,18 +130,5 @@ module Sprockets
|
|
130
130
|
StaticAsset.new(self, logical_path, pathname)
|
131
131
|
end
|
132
132
|
end
|
133
|
-
|
134
|
-
# Reverse guess logical path for fully expanded path.#
|
135
|
-
#
|
136
|
-
# This has some known issues. For an example if a file is
|
137
|
-
# shaddowed in the path, but is required relatively, its logical
|
138
|
-
# path will be incorrect.
|
139
|
-
def detect_logical_path(filename)
|
140
|
-
if root_path = paths.detect { |path| filename.to_s[path] }
|
141
|
-
root_pathname = Pathname.new(root_path)
|
142
|
-
logical_path = Pathname.new(filename).relative_path_from(root_pathname)
|
143
|
-
attributes_for(logical_path).without_engine_extensions
|
144
|
-
end
|
145
|
-
end
|
146
133
|
end
|
147
134
|
end
|