sproutit-sproutcore 1.0.0.20090407205609
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Buildfile +115 -0
- data/History.txt +7 -0
- data/README.txt +102 -0
- data/Rakefile +54 -0
- data/Todo.txt +1 -0
- data/bin/sc-build +13 -0
- data/bin/sc-build-number +13 -0
- data/bin/sc-gen +13 -0
- data/bin/sc-init +13 -0
- data/bin/sc-manifest +13 -0
- data/bin/sc-server +13 -0
- data/bin/sproutcore +14 -0
- data/buildtasks/build.rake +73 -0
- data/buildtasks/entry.rake +59 -0
- data/buildtasks/manifest.rake +469 -0
- data/buildtasks/render.rake +21 -0
- data/buildtasks/target.rake +42 -0
- data/gen/Buildfile +16 -0
- data/gen/app/Buildfile +36 -0
- data/gen/app/README +1 -0
- data/gen/app/USAGE +13 -0
- data/gen/app/templates/apps/{target_name}/core.js +27 -0
- data/gen/app/templates/apps/{target_name}/english.lproj/loading.rhtml +9 -0
- data/gen/app/templates/apps/{target_name}/english.lproj/main_page.js +22 -0
- data/gen/app/templates/apps/{target_name}/english.lproj/strings.js +15 -0
- data/gen/app/templates/apps/{target_name}/main.js +30 -0
- data/gen/controller/Buildfile +18 -0
- data/gen/controller/README +1 -0
- data/gen/controller/USAGE +13 -0
- data/gen/controller/templates/controllers/{filename}.js +18 -0
- data/gen/controller/templates/tests/controllers/{filename}.js +15 -0
- data/gen/framework/Buildfile +36 -0
- data/gen/framework/README +1 -0
- data/gen/framework/USAGE +13 -0
- data/gen/framework/templates/frameworks/{target_name}/core.js +21 -0
- data/gen/framework/templates/frameworks/{target_name}/english.lproj/strings.js +15 -0
- data/gen/language/Buildfile +26 -0
- data/gen/language/README +1 -0
- data/gen/language/USAGE +13 -0
- data/gen/language/templates/{filename}/strings.js +14 -0
- data/gen/model/Buildfile +16 -0
- data/gen/model/README +1 -0
- data/gen/model/USAGE +15 -0
- data/gen/model/templates/fixtures/{filename}.js +35 -0
- data/gen/model/templates/models/{filename}.js +19 -0
- data/gen/model/templates/tests/models/{filename}.js +15 -0
- data/gen/project/Buildfile +45 -0
- data/gen/project/INIT +3 -0
- data/gen/project/README +1 -0
- data/gen/project/USAGE +2 -0
- data/gen/project/templates/{filename}/Buildfile +7 -0
- data/gen/project/templates/{filename}/README +7 -0
- data/gen/test/Buildfile +25 -0
- data/gen/test/README +1 -0
- data/gen/test/USAGE +12 -0
- data/gen/test/templates/tests/{filename}.js +15 -0
- data/gen/theme/Buildfile +36 -0
- data/gen/theme/README +1 -0
- data/gen/theme/USAGE +13 -0
- data/gen/theme/templates/themes/{target_name}/english.lproj/strings.js +15 -0
- data/gen/view/Buildfile +18 -0
- data/gen/view/README +1 -0
- data/gen/view/USAGE +13 -0
- data/gen/view/templates/tests/views/{filename}.js +15 -0
- data/gen/view/templates/views/{filename}.js +18 -0
- data/lib/sproutcore.rb +130 -0
- data/lib/sproutcore/builders/base.rb +79 -0
- data/lib/sproutcore/builders/combine.rb +37 -0
- data/lib/sproutcore/builders/html.rb +177 -0
- data/lib/sproutcore/builders/javascript.rb +55 -0
- data/lib/sproutcore/builders/minify.rb +67 -0
- data/lib/sproutcore/builders/sass.rb +55 -0
- data/lib/sproutcore/builders/strings.rb +44 -0
- data/lib/sproutcore/builders/stylesheet.rb +40 -0
- data/lib/sproutcore/builders/test.rb +58 -0
- data/lib/sproutcore/builders/test_index.rb +26 -0
- data/lib/sproutcore/buildfile.rb +483 -0
- data/lib/sproutcore/buildfile/build_task.rb +33 -0
- data/lib/sproutcore/buildfile/buildfile_dsl.rb +162 -0
- data/lib/sproutcore/buildfile/cloneable.rb +34 -0
- data/lib/sproutcore/buildfile/early_time.rb +29 -0
- data/lib/sproutcore/buildfile/invocation_chain.rb +64 -0
- data/lib/sproutcore/buildfile/namespace.rb +33 -0
- data/lib/sproutcore/buildfile/string_ext.rb +198 -0
- data/lib/sproutcore/buildfile/task.rb +304 -0
- data/lib/sproutcore/buildfile/task_arguments.rb +86 -0
- data/lib/sproutcore/buildfile/task_manager.rb +193 -0
- data/lib/sproutcore/deprecated/view_helper.rb +662 -0
- data/lib/sproutcore/helpers/capture_helper.rb +30 -0
- data/lib/sproutcore/helpers/cssmin.rb +202 -0
- data/lib/sproutcore/helpers/dom_id_helper.rb +21 -0
- data/lib/sproutcore/helpers/entry_sorter.rb +105 -0
- data/lib/sproutcore/helpers/packed_optimizer.rb +102 -0
- data/lib/sproutcore/helpers/static_helper.rb +268 -0
- data/lib/sproutcore/helpers/tag_helper.rb +117 -0
- data/lib/sproutcore/helpers/text_helper.rb +303 -0
- data/lib/sproutcore/models/generator.rb +493 -0
- data/lib/sproutcore/models/hash_struct.rb +109 -0
- data/lib/sproutcore/models/manifest.rb +342 -0
- data/lib/sproutcore/models/manifest_entry.rb +232 -0
- data/lib/sproutcore/models/project.rb +270 -0
- data/lib/sproutcore/models/target.rb +403 -0
- data/lib/sproutcore/rack/builder.rb +269 -0
- data/lib/sproutcore/rack/dev.rb +51 -0
- data/lib/sproutcore/rack/docs.rb +24 -0
- data/lib/sproutcore/rack/proxy.rb +92 -0
- data/lib/sproutcore/rack/service.rb +141 -0
- data/lib/sproutcore/rack/test_runner.rb +24 -0
- data/lib/sproutcore/render_engines/erubis.rb +55 -0
- data/lib/sproutcore/render_engines/haml.rb +39 -0
- data/lib/sproutcore/tools.rb +311 -0
- data/lib/sproutcore/tools/build.rb +80 -0
- data/lib/sproutcore/tools/build_number.rb +23 -0
- data/lib/sproutcore/tools/gen.rb +99 -0
- data/lib/sproutcore/tools/init.rb +40 -0
- data/lib/sproutcore/tools/manifest.rb +84 -0
- data/lib/sproutcore/tools/server.rb +45 -0
- data/spec/buildtasks/build/copy_spec.rb +60 -0
- data/spec/buildtasks/build/spec_helper.rb +36 -0
- data/spec/buildtasks/manifest/catalog_spec.rb +48 -0
- data/spec/buildtasks/manifest/hide_buildfiles_spec.rb +125 -0
- data/spec/buildtasks/manifest/localize_spec.rb +97 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +246 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/css_spec.rb +87 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/html_spec.rb +175 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/javascript_spec.rb +65 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/minify_spec.rb +70 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_spec.rb +152 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/sass_spec.rb +98 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/strings_spec.rb +64 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/tests_spec.rb +163 -0
- data/spec/buildtasks/manifest/prepare_spec.rb +43 -0
- data/spec/buildtasks/manifest/spec_helper.rb +35 -0
- data/spec/buildtasks/target_spec.rb +214 -0
- data/spec/fixtures/builder_tests/Buildfile +15 -0
- data/spec/fixtures/builder_tests/apps/combine_test/a.js +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/b.js +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/c.js +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/a.css +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/b.css +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/c.css +1 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/bar1_sample.rhtml +2 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/erb_sample.html.erb +1 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/icons/image.png +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/image.jpg +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/rhtml_sample.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/strings.js +4 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/style.css +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/french.lproj/french-icons/fr.png +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/french.lproj/strings.js +4 -0
- data/spec/fixtures/builder_tests/apps/html_test/lib/layout_template.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/html_test/scripts.js +0 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/sc_static.js +15 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/sc_super.js +4 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/strings.js +7 -0
- data/spec/fixtures/builder_tests/apps/sass_test/sample.sass +3 -0
- data/spec/fixtures/builder_tests/apps/strings_test/lproj/strings.js +8 -0
- data/spec/fixtures/builder_tests/apps/stylesheet_test/build_directives.css +9 -0
- data/spec/fixtures/builder_tests/apps/stylesheet_test/sc_static.css +12 -0
- data/spec/fixtures/builder_tests/apps/test_test/lib/alt_layout.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/test_test/lib/test_layout.rhtml +3 -0
- data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test.js +1 -0
- data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test2.js +1 -0
- data/spec/fixtures/builder_tests/apps/test_test/tests/rhtml_test.rhtml +4 -0
- data/spec/fixtures/builder_tests/frameworks/debug/core.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/debug/english.lproj/dummy.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/qunit/core.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/qunit/english.lproj/dummy.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/req_style_1.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/strings.js +4 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/test.rhtml +1 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/req_js_1.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/english.lproj/req_style_2.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/english.lproj/test.rhtml +1 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/javascript.js +1 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/lib/alt_layout.rhtml +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/req_js_2.js +0 -0
- data/spec/fixtures/builder_tests/themes/sample_theme/Buildfile +1 -0
- data/spec/fixtures/buildfiles/basic/Buildfile +16 -0
- data/spec/fixtures/buildfiles/basic/task_module.rake +6 -0
- data/spec/fixtures/buildfiles/installed/Buildfile +7 -0
- data/spec/fixtures/buildfiles/installed/Buildfile2 +5 -0
- data/spec/fixtures/buildfiles/project_test/Buildfile +4 -0
- data/spec/fixtures/buildfiles/project_test/not_project/Buildfile +2 -0
- data/spec/fixtures/buildfiles/project_test/not_project/child/PLACEHOLDER +0 -0
- data/spec/fixtures/entry_for_project/Buildfile +1 -0
- data/spec/fixtures/entry_for_project/apps/test_app/entry.txt +0 -0
- data/spec/fixtures/entry_for_project/apps/test_app/frameworks/nested/PLACEHOLDER +0 -0
- data/spec/fixtures/entry_for_project/frameworks/shared/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/Buildfile +8 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/bars/bar1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/bars/bar2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/foos/foo1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/foos/foo2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/Buildfile +5 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/custom_foodir/foo1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/custom_foodir/foo2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/foos/not_foo1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/foo1/bars/bar1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/foo1/bars/bar2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/nested/Buildfile +8 -0
- data/spec/fixtures/find_targets/nested/apps/app1/Buildfile +1 -0
- data/spec/fixtures/find_targets/nested/apps/app1/apps/nested_app/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/Apps/app1/frameworks/framework1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/Apps/app1/frameworks/framework2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/clients/client1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/frameworks/framework1/frameworks/framework1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/frameworks/framework2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/themes/theme1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/themes/theme2/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/caps_long_names/English.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/caps_long_names/FreNCH.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/caps_long_names/UnknOWN.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/english.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/french.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/german.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/italian.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/japanese.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/spanish.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/unknown.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/no_names/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/de.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en-CA.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en-GB.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en-US.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/es.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/foo.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/fr.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/it.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/ja.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/1.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/B.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/a.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/a/a.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/a/b.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/b/a.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/c.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/core.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/B.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a/a.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a/b.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/b/a.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/c.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/lproj/strings.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/utils.js +1 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/a.js +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/b.js +3 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/c.js +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/a.css +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/b.css +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/c.css +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/d.js +1 -0
- data/spec/fixtures/real_world/Buildfile +12 -0
- data/spec/fixtures/real_world/apps/account/README +1 -0
- data/spec/fixtures/real_world/apps/calendar/README +1 -0
- data/spec/fixtures/real_world/apps/contacts/README_BEFORE_EDITING +1 -0
- data/spec/fixtures/real_world/apps/files/README +1 -0
- data/spec/fixtures/real_world/apps/mail/README +1 -0
- data/spec/fixtures/real_world/apps/mobile_photos/README +1 -0
- data/spec/fixtures/real_world/apps/photos/README +1 -0
- data/spec/fixtures/real_world/apps/uploader/README +1 -0
- data/spec/fixtures/real_world/frameworks/core_files/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/core_photos/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/shared/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/Buildfile +26 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/README +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/apps/docs/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/apps/test_runner/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/core.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/debug/debug-resource.html +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/debug/sample_debug.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/demo2.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/debug/sample_debug-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.css +4 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.html +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo2.sass +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.haml +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.html.erb +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.rhtml +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/fixtures/sample_fixtures-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/has_require.css +4 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_require.css +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_sc_resource.rhtml +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/protocols/sample-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.css +6 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.rhtml +3 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/strings.js +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/tests/sample-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/fixtures/sample-json-fixture.json +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/fixtures/sample_fixtures.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/application/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/costello/core.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/data_store/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/debug/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/desktop/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/empty_theme/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/foundation/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/mobile/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/qunit/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/uploader/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/french.lproj/french-resource.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/french.lproj/strings.js +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/german.lproj/german-resource.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/german.lproj/strings.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/has_require.js +4 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/lib/index.html +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/no_require.js +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/protocols/sample.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/sc_resource.js +6 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/nested/sample1.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/nested/sample2.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/sample.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/sample.rhtml +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/themes/standard_theme/README +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/views/view.js +1 -0
- data/spec/fixtures/real_world/generators/sample_custom/Buildfile +0 -0
- data/spec/fixtures/real_world/generators/sample_custom/templates/{filename}.js +1 -0
- data/spec/fixtures/recursive_project/Buildfile +8 -0
- data/spec/fixtures/recursive_project/frameworks/sproutcore/frameworks/costello/PLACEHOLDER +0 -0
- data/spec/lib/builders/combine_spec.rb +67 -0
- data/spec/lib/builders/html_spec.rb +577 -0
- data/spec/lib/builders/javascript_spec.rb +81 -0
- data/spec/lib/builders/sass_spec.rb +43 -0
- data/spec/lib/builders/spec_helper.rb +30 -0
- data/spec/lib/builders/strings_spec.rb +52 -0
- data/spec/lib/builders/stylesheet_spec.rb +63 -0
- data/spec/lib/builders/test_index_spec.rb +44 -0
- data/spec/lib/builders/test_spec.rb +135 -0
- data/spec/lib/buildfile/config_for_spec.rb +81 -0
- data/spec/lib/buildfile/define_spec.rb +59 -0
- data/spec/lib/buildfile/dup_spec.rb +65 -0
- data/spec/lib/buildfile/invoke_spec.rb +130 -0
- data/spec/lib/buildfile/load_spec.rb +49 -0
- data/spec/lib/buildfile/task/dup_spec.rb +55 -0
- data/spec/lib/buildfile/task_defined_spec.rb +17 -0
- data/spec/lib/buildfile_commands/build_task_spec.rb +19 -0
- data/spec/lib/buildfile_commands/config_spec.rb +97 -0
- data/spec/lib/buildfile_commands/import_spec.rb +17 -0
- data/spec/lib/buildfile_commands/namespace_spec.rb +18 -0
- data/spec/lib/buildfile_commands/proxies_spec.rb +38 -0
- data/spec/lib/buildfile_commands/replace_task_spec.rb +29 -0
- data/spec/lib/buildfile_commands/task_spec.rb +36 -0
- data/spec/lib/helpers/packing_optimizer/optimize_spec.rb +26 -0
- data/spec/lib/models/hash_struct/deep_clone_spec.rb +27 -0
- data/spec/lib/models/hash_struct/has_options_spec.rb +32 -0
- data/spec/lib/models/hash_struct/hash_spec.rb +64 -0
- data/spec/lib/models/hash_struct/merge_spec.rb +26 -0
- data/spec/lib/models/hash_struct/method_missing.rb +41 -0
- data/spec/lib/models/manifest/add_entry_spec.rb +36 -0
- data/spec/lib/models/manifest/add_transform_spec.rb +90 -0
- data/spec/lib/models/manifest/build_spec.rb +78 -0
- data/spec/lib/models/manifest/entry_for_spec.rb +94 -0
- data/spec/lib/models/manifest/find_entry.rb +84 -0
- data/spec/lib/models/manifest/prepare_spec.rb +62 -0
- data/spec/lib/models/manifest_entry/cacheable_url_spec.rb +31 -0
- data/spec/lib/models/manifest_entry/prepare_spec.rb +54 -0
- data/spec/lib/models/project/add_target_spec.rb +44 -0
- data/spec/lib/models/project/buildfile_spec.rb +35 -0
- data/spec/lib/models/project/find_targets_for_spec.rb +77 -0
- data/spec/lib/models/project/load_nearest_project_spec.rb +23 -0
- data/spec/lib/models/project/target_for_spec.rb +33 -0
- data/spec/lib/models/project/targets_spec.rb +62 -0
- data/spec/lib/models/target/compute_build_number_spec.rb +125 -0
- data/spec/lib/models/target/config_spec.rb +30 -0
- data/spec/lib/models/target/expand_required_targets_spec.rb +48 -0
- data/spec/lib/models/target/installed_languages_spec.rb +47 -0
- data/spec/lib/models/target/lproj_for_spec.rb +38 -0
- data/spec/lib/models/target/manifest_for_spec.rb +42 -0
- data/spec/lib/models/target/parent_target_spec.rb +21 -0
- data/spec/lib/models/target/prepare_spec.rb +53 -0
- data/spec/lib/models/target/required_targets_spec.rb +119 -0
- data/spec/lib/models/target/target_for_spec.rb +56 -0
- data/spec/lib/tools/build_number_spec.rb +28 -0
- data/spec/lib/tools/gen_spec.rb +207 -0
- data/spec/lib/tools/tools_spec.rb +78 -0
- data/spec/spec_helper.rb +138 -0
- data/sproutcore.gemspec +47 -0
- data/vendor/github_gem_lint.rb +22 -0
- data/vendor/yui-compressor/yuicompressor-2.4.2.jar +0 -0
- metadata +1084 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper])
|
2
|
+
|
3
|
+
describe SC::HashStruct, 'method_missing' do
|
4
|
+
|
5
|
+
before do
|
6
|
+
hash = SC::HashStruct.new :foo => :foo
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should map hash.foo => hash[:foo]" do
|
10
|
+
hash.foo.should eql(:foo)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should map hash.bar = :foo => hash[:bar] = :foo" do
|
14
|
+
hash[:bar].should eql(nil)
|
15
|
+
hash.bar = :foo
|
16
|
+
hash.bar.should eql(:foo)
|
17
|
+
hash[:bar].should eql(:foo)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should map hash.foo? => !!hash[:foo]" do
|
21
|
+
hash.foo?.should eql(true)
|
22
|
+
hash.bar = 1
|
23
|
+
hash.bar?.should eql(true)
|
24
|
+
hash.bar = 0
|
25
|
+
hash.bar?.should eql(0)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should map hash.undefined_prop? => false" do
|
29
|
+
hash.undefined_prop?.should eql(false) # not defined...
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should map hash.bar? = :foo to hash[:bar] = !!:foo" do
|
33
|
+
hash.bar? = :foo
|
34
|
+
hash[:bar].should eql(true)
|
35
|
+
hash.bar? = 0
|
36
|
+
hash[:bar].should eql(false)
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper])
|
2
|
+
|
3
|
+
describe SC::Manifest, 'add_entry' do
|
4
|
+
|
5
|
+
include SC::SpecHelpers
|
6
|
+
|
7
|
+
before do
|
8
|
+
@project = empty_project # no buildfile to avoid running extra code...
|
9
|
+
@project.add_target '/default', :default, :source_root => @project.project_root
|
10
|
+
@target = @project.target_for :default
|
11
|
+
@manifest = @target.manifest_for :language => :en
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should add a new entry with the passed filename and any other options applied and return it" do
|
15
|
+
entry = @manifest.add_entry 'filename', :extra_option => true
|
16
|
+
entry.kind_of?(SC::ManifestEntry).should be_true
|
17
|
+
entry.filename.should eql('filename')
|
18
|
+
entry.extra_option.should be_true
|
19
|
+
end
|
20
|
+
|
21
|
+
it "calling with the same options each time should add a new instance" do
|
22
|
+
entry1 = @manifest.add_entry 'filename', :extra_option => true
|
23
|
+
entry2 = @manifest.add_entry 'filename', :extra_option => true
|
24
|
+
entry1.foo = :entry1
|
25
|
+
entry2.foo = :entry2
|
26
|
+
|
27
|
+
entry1.foo.should eql(:entry1)
|
28
|
+
entry2.foo.should eql(:entry2)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should call prepare! on the new entry" do
|
32
|
+
entry = @manifest.add_entry 'filename', :extra_option => true
|
33
|
+
entry.prepared?.should be_true
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper])
|
2
|
+
|
3
|
+
describe SC::Manifest, 'add_transform' do
|
4
|
+
|
5
|
+
include SC::SpecHelpers
|
6
|
+
|
7
|
+
before do
|
8
|
+
@project = empty_project # no buildfile to avoid running extra code...
|
9
|
+
@project.add_target '/default', :default, :source_root => @project.project_root
|
10
|
+
@target = @project.target_for :default
|
11
|
+
@manifest = @target.manifest_for :language => :en
|
12
|
+
|
13
|
+
@entry = @manifest.add_entry 'foobar.js',
|
14
|
+
:build_task => 'build:copy',
|
15
|
+
:source_path => File.join('source', 'foobar.js'),
|
16
|
+
:build_path => File.join('build', 'foobar.js'),
|
17
|
+
:staging_path => File.join('staging', 'foobar.js'),
|
18
|
+
:url => File.join('url', 'foobar.js')
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should add a composite entry with entry as source" do
|
22
|
+
new_entry = @manifest.add_transform @entry, :build_task => 'foo'
|
23
|
+
new_entry.composite?.should be_true
|
24
|
+
new_entry.source_entries.should == [@entry]
|
25
|
+
end
|
26
|
+
|
27
|
+
it "copy the filename and build_path if no overrides are passed" do
|
28
|
+
new_entry = @manifest.add_transform @entry
|
29
|
+
new_entry.filename.should == @entry.filename
|
30
|
+
new_entry.build_path.should == @entry.build_path
|
31
|
+
end
|
32
|
+
|
33
|
+
it "uses the filename and build_path in options if passed" do
|
34
|
+
new_entry = @manifest.add_transform @entry, :filename => "foo", :build_path => "bar"
|
35
|
+
new_entry.filename.should == "foo"
|
36
|
+
new_entry.build_path.should == "bar"
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should unique the staging path each time it is called" do
|
40
|
+
# try once...
|
41
|
+
entry1 = @manifest.add_transform @entry
|
42
|
+
entry1.staging_path.should_not == @entry.staging_path
|
43
|
+
|
44
|
+
# try again...
|
45
|
+
entry2 = @manifest.add_transform @entry
|
46
|
+
entry2.staging_path.should_not == @entry.staging_path
|
47
|
+
entry2.staging_path.should_not == entry1.staging_path
|
48
|
+
|
49
|
+
# try chaining...
|
50
|
+
entry3 = @manifest.add_transform entry1
|
51
|
+
entry3.staging_path.should_not == @entry.staging_path
|
52
|
+
entry3.staging_path.should_not == entry1.staging_path
|
53
|
+
entry3.staging_path.should_not == entry2.staging_path
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should hide the original entry" do
|
57
|
+
new_entry = @manifest.add_transform @entry, :build_task => 'foo'
|
58
|
+
@entry.should be_hidden
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should mark the new entry as a transform" do
|
62
|
+
new_entry = @manifest.add_transform @entry, :build_task => 'foo'
|
63
|
+
new_entry.should be_transform
|
64
|
+
end
|
65
|
+
|
66
|
+
it "swaps extensions in filename, url, build_path, and staging_path if :ext option is provided" do
|
67
|
+
# Check preconditions
|
68
|
+
File.extname(@entry.filename).should == '.js'
|
69
|
+
File.extname(@entry.build_path).should == '.js'
|
70
|
+
File.extname(@entry.url).should == '.js'
|
71
|
+
File.extname(@entry.staging_path).should == '.js'
|
72
|
+
|
73
|
+
# Create new entry
|
74
|
+
new_entry = @manifest.add_transform @entry, :ext => "html"
|
75
|
+
|
76
|
+
File.extname(new_entry.filename).should == '.html'
|
77
|
+
File.extname(new_entry.build_path).should == '.html'
|
78
|
+
File.extname(new_entry.url).should == '.html'
|
79
|
+
File.extname(new_entry.staging_path).should == '.html'
|
80
|
+
end
|
81
|
+
|
82
|
+
it "rebases the staging path for transform entry to staging_root if original staging_path == source_path" do
|
83
|
+
|
84
|
+
@entry.staging_path = @entry.source_path
|
85
|
+
@manifest.staging_root = "staging/"
|
86
|
+
new_entry = @manifest.add_transform @entry
|
87
|
+
new_entry.staging_path.should =~ /^staging\//
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper])
|
2
|
+
|
3
|
+
describe SC::Manifest, 'build!' do
|
4
|
+
|
5
|
+
include SC::SpecHelpers
|
6
|
+
|
7
|
+
before do
|
8
|
+
@project = fixture_project(:real_world)
|
9
|
+
|
10
|
+
## IMPORTANT: Note the task defined here is assumed by tests below...
|
11
|
+
@project.buildfile.define! do
|
12
|
+
replace_task 'manifest:prepare' do
|
13
|
+
# avoid invoking original machinery...
|
14
|
+
end
|
15
|
+
|
16
|
+
replace_task 'manifest:build' do
|
17
|
+
MANIFEST.task_did_run = (MANIFEST.task_did_run || 0) + 1
|
18
|
+
end
|
19
|
+
|
20
|
+
replace_task 'entry:prepare' do
|
21
|
+
# also avoid original machinery...
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
@target = @project.target_for :contacts
|
27
|
+
@manifest = @target.manifest_for(:language => :en)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should return self" do
|
31
|
+
@manifest.build!.should eql(@manifest)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should call prepare! then call manifest:build if defined" do
|
35
|
+
@manifest.prepared?.should be_false # check precondition
|
36
|
+
@manifest.build!
|
37
|
+
@manifest.prepared?.should be_true
|
38
|
+
|
39
|
+
@manifest.task_did_run.should eql(1) # ran?
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should do nothing manifest:build is not defined" do
|
43
|
+
# get an empty project with no build tasks...
|
44
|
+
project = empty_project
|
45
|
+
project.add_target '/default', :default, :source_root => project.project_root
|
46
|
+
target = project.targets['/default']
|
47
|
+
target.buildfile.lookup('manifest:build').should be_nil
|
48
|
+
|
49
|
+
manifest = target.manifest_for :language => :en
|
50
|
+
lambda { manifest.build! }.should_not raise_error
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should build only once unless reset_entries! is called" do
|
54
|
+
@manifest.build! # do build once...
|
55
|
+
@manifest.add_entry 'example' # pretend this happpened during build...
|
56
|
+
@manifest.entries.size.should eql(1) # precondition
|
57
|
+
|
58
|
+
@manifest.build!
|
59
|
+
@manifest.entries.size.should eql(1) # should NOT be reset.
|
60
|
+
|
61
|
+
# reset and try again
|
62
|
+
@manifest.reset_entries!
|
63
|
+
@manifest.build!
|
64
|
+
@manifest.entries.size.should eql(0) # should be reset.
|
65
|
+
# build! would normally repopulate...
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
it "should execute manifest:build only one time unless reset" do
|
70
|
+
@manifest.prepared?.should be_false # check precondition
|
71
|
+
@manifest.build!.build! # second time should do nothing
|
72
|
+
@manifest.reset_entries!
|
73
|
+
@manifest.build! # should run since we reset...
|
74
|
+
@manifest.prepared?.should be_true
|
75
|
+
@manifest.task_did_run.should eql(2) # ran only once?
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper])
|
2
|
+
|
3
|
+
describe SC::Manifest, 'entry_for' do
|
4
|
+
|
5
|
+
include SC::SpecHelpers
|
6
|
+
|
7
|
+
before do
|
8
|
+
@project = fixture_project :entry_for_project
|
9
|
+
@target = @project.target_for :test_app
|
10
|
+
@manifest = @target.manifest_for :language => :en
|
11
|
+
@manifest.prepare!
|
12
|
+
|
13
|
+
# manually add some entries for testing...
|
14
|
+
|
15
|
+
# not hidden -- extra option :foo
|
16
|
+
@manifest.add_entry 'entry.txt',
|
17
|
+
:hidden => false,
|
18
|
+
:foo => :foo,
|
19
|
+
:item => :visible_foo
|
20
|
+
|
21
|
+
# duplicate of above w/ different :foo option
|
22
|
+
@manifest.add_entry 'entry.txt',
|
23
|
+
:hidden => false,
|
24
|
+
:foo => :bar,
|
25
|
+
:item => :visible_bar
|
26
|
+
|
27
|
+
# hidden
|
28
|
+
@manifest.add_entry 'entry.txt',
|
29
|
+
:hidden => true,
|
30
|
+
:foo => :foo,
|
31
|
+
:item => :hidden
|
32
|
+
|
33
|
+
# since we generate the manifest entries manually for testing purposes,
|
34
|
+
# mark the manifest as built to avoid invoking that machinery...
|
35
|
+
@manifest.instance_variable_set('@is_built', true)
|
36
|
+
|
37
|
+
# add other targets as well..
|
38
|
+
@shared = @project.target_for(:shared).manifest_for(:language => :en)
|
39
|
+
@shared.prepare!
|
40
|
+
@shared.add_entry 'foobar/fake.png'
|
41
|
+
@shared.instance_variable_set('@is_built', true)
|
42
|
+
|
43
|
+
@nested = @project.target_for('/test_app/nested').manifest_for(:language => :en)
|
44
|
+
@nested.prepare!
|
45
|
+
@nested.add_entry 'foobar/fake.png'
|
46
|
+
@nested.instance_variable_set('@is_built', true)
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
it "finds the first visible file matching the filename" do
|
51
|
+
entry = @manifest.entry_for 'entry.txt'
|
52
|
+
entry.should_not be_hidden
|
53
|
+
[:visible_foo, :visible_bar].should include(entry.item) # either one is ok
|
54
|
+
end
|
55
|
+
|
56
|
+
it "finds the first hidden file matching the filename if :hidden => true is passed" do
|
57
|
+
entry = @manifest.entry_for 'entry.txt', :hidden => true
|
58
|
+
entry.should be_hidden
|
59
|
+
entry.item.should == :hidden
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
it "finds the first file matching the filename and any additional passed options" do
|
64
|
+
@manifest.entry_for('entry.txt', :foo => :foo).item.should == :visible_foo
|
65
|
+
@manifest.entry_for('entry.txt', :foo => :bar).item.should == :visible_bar
|
66
|
+
end
|
67
|
+
|
68
|
+
it "requires an exact match on filename" do
|
69
|
+
@manifest.entry_for('entry').should be_nil
|
70
|
+
end
|
71
|
+
|
72
|
+
it "returns nil if no matching entry could be found" do
|
73
|
+
result = nil
|
74
|
+
result = @manifest.entry_for('imaginary')
|
75
|
+
result.should be_nil # and not return entry
|
76
|
+
end
|
77
|
+
|
78
|
+
describe "can name entries in other targets by prefixing entry name with target:entry_name" do
|
79
|
+
|
80
|
+
it "will search another manifest" do
|
81
|
+
entry = @manifest.entry_for('shared:foobar/fake.png')
|
82
|
+
entry.should_not be_nil
|
83
|
+
entry.manifest.should == @shared
|
84
|
+
end
|
85
|
+
|
86
|
+
it "will search for nested targets relative to current target" do
|
87
|
+
entry = @manifest.entry_for('nested:foobar/fake.png')
|
88
|
+
entry.should_not be_nil
|
89
|
+
entry.manifest.should == @nested
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper])
|
2
|
+
|
3
|
+
describe SC::Manifest, 'entry_for' do
|
4
|
+
|
5
|
+
include SC::SpecHelpers
|
6
|
+
|
7
|
+
before do
|
8
|
+
@project = fixture_project :entry_for_project
|
9
|
+
@target = @project.target_for :test_app
|
10
|
+
@manifest = @target.manifest_for :language => :en
|
11
|
+
@manifest.prepare!
|
12
|
+
|
13
|
+
# manually add some entries for testing...
|
14
|
+
|
15
|
+
# NOTE: the order these entries are added is important to the tests
|
16
|
+
# below. See the test descriptions for more info.
|
17
|
+
@manifest.add_entry 'foo'
|
18
|
+
@manifest.add_entry 'images/foo.png'
|
19
|
+
@manifest.add_entry 'images/foo.gif'
|
20
|
+
@manifest.add_entry 'images/sprites/foo.png'
|
21
|
+
@manifest.add_entry 'foo.png'
|
22
|
+
|
23
|
+
@manifest.add_entry 'bark/bite.png', :foo => :foo
|
24
|
+
@manifest.add_entry 'bark/bite.png', :foo => :bar
|
25
|
+
@manifest.add_entry 'hidden/bite.png', :hidden => true
|
26
|
+
|
27
|
+
# add an entry to shared for one later test also...
|
28
|
+
@shared_man = @project.target_for(:shared).manifest_for(:language => :en)
|
29
|
+
@shared_man.prepare!
|
30
|
+
@shared_man.add_entry 'shared/foo.png'
|
31
|
+
end
|
32
|
+
|
33
|
+
def should_find(find_str, expected_filename)
|
34
|
+
entry = @manifest.find_entry(find_str)
|
35
|
+
entry.should_not be_nil
|
36
|
+
entry.filename.should == expected_filename
|
37
|
+
end
|
38
|
+
|
39
|
+
it "matches exact path from url_root" do
|
40
|
+
should_find('images/foo.png', 'images/foo.png')
|
41
|
+
end
|
42
|
+
|
43
|
+
it "returns first match based on order added, regardless of url depth" do
|
44
|
+
should_find('foo.png', 'images/foo.png')
|
45
|
+
end
|
46
|
+
|
47
|
+
it "will match any extension if no extension is provided" do
|
48
|
+
should_find('images/sprites/foo', 'images/sprites/foo.png')
|
49
|
+
end
|
50
|
+
|
51
|
+
it "will match first match if no extension is provided" do
|
52
|
+
should_find('images/foo', 'images/foo.png')
|
53
|
+
end
|
54
|
+
|
55
|
+
it "providing extension can force match" do
|
56
|
+
should_find('foo.gif', 'images/foo.gif')
|
57
|
+
end
|
58
|
+
|
59
|
+
it "prefers to match files with no extension over those with extension if no ext is provided" do
|
60
|
+
should_find('foo', 'foo')
|
61
|
+
end
|
62
|
+
|
63
|
+
it "will match only visible unless :hidden => true" do
|
64
|
+
@manifest.find_entry('hidden/bite.png').should be_nil
|
65
|
+
@manifest.find_entry('hidden/bite.png', :hidden => true).should_not be_nil
|
66
|
+
end
|
67
|
+
|
68
|
+
it "will also match based on additional passed options" do
|
69
|
+
entry = @manifest.find_entry('bark/bite.png', :foo => :bar)
|
70
|
+
entry.should_not be_nil
|
71
|
+
entry.foo.should == :bar
|
72
|
+
|
73
|
+
entry = @manifest.find_entry('bark/bite.png', :foo => :foo)
|
74
|
+
entry.should_not be_nil
|
75
|
+
entry.foo.should == :foo
|
76
|
+
end
|
77
|
+
|
78
|
+
it "will search required targets if the requested resource is not found in current manifest" do
|
79
|
+
entry = @manifest.find_entry('shared/foo')
|
80
|
+
entry.should_not be_nil
|
81
|
+
entry.manifest.should == @shared_man # verify came from other manifest...
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper])
|
2
|
+
|
3
|
+
describe SC::Manifest, 'prepare!' do
|
4
|
+
|
5
|
+
include SC::SpecHelpers
|
6
|
+
|
7
|
+
before do
|
8
|
+
@project = fixture_project(:real_world)
|
9
|
+
@target = @project.target_for :contacts
|
10
|
+
|
11
|
+
@target.buildfile.define! do
|
12
|
+
|
13
|
+
replace_task 'target:prepare' do
|
14
|
+
# avoid invoking original machinery...
|
15
|
+
end
|
16
|
+
|
17
|
+
replace_task 'manifest:prepare' do
|
18
|
+
MANIFEST.task_did_run = (MANIFEST.task_did_run || 0) + 1
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
@manifest = @target.manifest_for(:language => :en)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should return self" do
|
26
|
+
@manifest.prepare!.should eql(@manifest)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should execure prepare! on target" do
|
30
|
+
@target.prepared?.should be_false
|
31
|
+
@manifest.prepare!
|
32
|
+
@target.prepared?.should be_true
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should execute manifest:prepare if defined" do
|
36
|
+
@manifest.prepared?.should be_false # check precondition
|
37
|
+
@manifest.prepare!
|
38
|
+
@manifest.prepared?.should be_true
|
39
|
+
@manifest.task_did_run.should eql(1) # ran?
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should do nothing if manifest:prepare is not defined" do
|
43
|
+
|
44
|
+
# get an empty project with no build tasks...
|
45
|
+
project = empty_project
|
46
|
+
project.add_target '/default', :default, :source_root => project.project_root
|
47
|
+
target = project.targets['/default']
|
48
|
+
target.buildfile.lookup('manifest:prepare').should be_nil
|
49
|
+
|
50
|
+
manifest = target.manifest_for :language => :en
|
51
|
+
lambda { manifest.prepare! }.should_not raise_error
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should execute manifest:prepare only once" do
|
56
|
+
@manifest.prepared?.should be_false # check precondition
|
57
|
+
@manifest.prepare!.prepare!.prepare!
|
58
|
+
@manifest.prepared?.should be_true
|
59
|
+
@manifest.task_did_run.should eql(1) # ran only once?
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|