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
data/gen/language/README
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Your language is now ready to use!
|
data/gen/language/USAGE
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
language - Create a new language for a SproutCore application.
|
2
|
+
|
3
|
+
USAGE:
|
4
|
+
|
5
|
+
sc-gen language LanguageName [--target=TARGET_NAME]
|
6
|
+
|
7
|
+
DISCUSSION:
|
8
|
+
|
9
|
+
This generator will create a new language for a particular application. Please make sure you are in the specific application directory first, or specify one with the target parameter. You should pass as the first parameter the LanguageName you want to create. For example:
|
10
|
+
|
11
|
+
sc-gen language Norwegian
|
12
|
+
|
13
|
+
defines a new language in your current application in the directory norwegian.lproj .
|
@@ -0,0 +1,14 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: <%= namespace %> Strings
|
3
|
+
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
+
// ==========================================================================
|
5
|
+
|
6
|
+
// Place strings you want to localize here. In your app, use the key and
|
7
|
+
// localize it using "key string".loc(). HINT: For your key names, use the
|
8
|
+
// english string with an underscore in front. This way you can still see
|
9
|
+
// how your UI will look and you'll notice right away when something needs a
|
10
|
+
// localized string added to this file!
|
11
|
+
//
|
12
|
+
SC.stringsFor('<%= language %>', {
|
13
|
+
// "_String Key": "Localized String"
|
14
|
+
}) ;
|
data/gen/model/Buildfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# ==========================================================================
|
2
|
+
# Generator: Model
|
3
|
+
# Copyright: ©2006-2009 Sprout Systems, Inc. and contributors
|
4
|
+
# portions copyright ©2009 Apple, Inc.
|
5
|
+
# ==========================================================================
|
6
|
+
|
7
|
+
namespace :generator do
|
8
|
+
|
9
|
+
# Verify required properties are present. Also accept second argument as
|
10
|
+
# base class.
|
11
|
+
task :prepare do
|
12
|
+
GENERATOR.requires! :target_project, :target, :namespace, :class_name
|
13
|
+
GENERATOR.base_class_name ||= GENERATOR.arguments[2]
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
data/gen/model/README
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Your model is now ready to use!
|
data/gen/model/USAGE
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
model - Create a new model class in your SproutCore app.
|
2
|
+
|
3
|
+
USAGE:
|
4
|
+
|
5
|
+
sc-gen model AppName.ClassName [--filename=FILENAME] [--target=TARGET_NAME]
|
6
|
+
|
7
|
+
DISCUSSION:
|
8
|
+
|
9
|
+
This generator will create a new SproutCore model file in your app. You should pass as the first parameter your AppName.ClassName combination you want to create. For example:
|
10
|
+
|
11
|
+
sc-gen model Todos.Task
|
12
|
+
|
13
|
+
defines a new class called Todos.Task in the file apps/todos/models/task.js .
|
14
|
+
|
15
|
+
In addition to creating a model class, this will also create a stub for you to add Fixture data. This is a convenient way to preload your application with data while you develop the client but have not yet connected to your server.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: <%= namespace_class_name %> Fixtures
|
3
|
+
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
+
// ==========================================================================
|
5
|
+
/*globals <%= namespace %> */
|
6
|
+
|
7
|
+
sc_require('models/<%= filename.ext('') %>');
|
8
|
+
|
9
|
+
<%= namespace_class_name %>.FIXTURES = [
|
10
|
+
|
11
|
+
// TODO: Add your data fixtures here.
|
12
|
+
// All fixture records must have a unique primary key (default 'guid'). See
|
13
|
+
// the example below.
|
14
|
+
|
15
|
+
// { guid: 1,
|
16
|
+
// firstName: "Michael",
|
17
|
+
// lastName: "Scott" },
|
18
|
+
//
|
19
|
+
// { guid: 2,
|
20
|
+
// firstName: "Dwight",
|
21
|
+
// lastName: "Schrute" },
|
22
|
+
//
|
23
|
+
// { guid: 3,
|
24
|
+
// firstName: "Jim",
|
25
|
+
// lastName: "Halpert" },
|
26
|
+
//
|
27
|
+
// { guid: 4,
|
28
|
+
// firstName: "Pam",
|
29
|
+
// lastName: "Beesly" },
|
30
|
+
//
|
31
|
+
// { guid: 5,
|
32
|
+
// firstName: "Ryan",
|
33
|
+
// lastName: "Howard" }
|
34
|
+
|
35
|
+
];
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: <%= namespace_class_name %>
|
3
|
+
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
+
// ==========================================================================
|
5
|
+
/*globals <%= namespace %> */
|
6
|
+
|
7
|
+
/** @class
|
8
|
+
|
9
|
+
(Document your Model here)
|
10
|
+
|
11
|
+
@extends <%= base_class_name || 'SC.Record' %>
|
12
|
+
@version 0.1
|
13
|
+
*/
|
14
|
+
<%= namespace_class_name %> = <%= base_class_name || 'SC.Record' %>.extend(
|
15
|
+
/** @scope <%= namespace_class_name %>.prototype */ {
|
16
|
+
|
17
|
+
// TODO: Add your own code here.
|
18
|
+
|
19
|
+
}) ;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: <%= namespace_class_name %> Unit Test
|
3
|
+
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
+
// ==========================================================================
|
5
|
+
/*globals <%= namespace %> module test ok equals same stop start */
|
6
|
+
|
7
|
+
module("<%= namespace_class_name %>");
|
8
|
+
|
9
|
+
// TODO: Replace with real unit test for <%= class_name %>
|
10
|
+
test("test description", function() {
|
11
|
+
var expected = "test";
|
12
|
+
var result = "test";
|
13
|
+
equals(result, expected, "test should equal test");
|
14
|
+
});
|
15
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# ==========================================================================
|
2
|
+
# Generator: PROJECT
|
3
|
+
# Copyright: ©2006-2009 Sprout Systems, Inc. and contributors
|
4
|
+
# portions copyright ©2009 Apple, Inc.
|
5
|
+
# ==========================================================================
|
6
|
+
|
7
|
+
namespace :generator do
|
8
|
+
|
9
|
+
# Accept the following types of arguments:
|
10
|
+
#
|
11
|
+
# project . #=> Make current working directory. like sc-init
|
12
|
+
# project project_name #=> Create project_name, namespace: ProjectName
|
13
|
+
# project ProjectName #=> Create project_name, namespace: ProjectName
|
14
|
+
# project NameSpace path/to/project #=> Create path/to/project, NameSpace
|
15
|
+
#
|
16
|
+
task :prepare do
|
17
|
+
# get arguments & normalize
|
18
|
+
gen = GENERATOR
|
19
|
+
namespace = gen.arguments[1]
|
20
|
+
project_path = gen.arguments[2]
|
21
|
+
|
22
|
+
if project_path
|
23
|
+
project_path = File.expand_path(project_path)
|
24
|
+
namespace = File.basename(project_path) if namespace == '.'
|
25
|
+
elsif namespace == '.'
|
26
|
+
project_path = Dir.pwd
|
27
|
+
namespace = File.basename(project_path)
|
28
|
+
else
|
29
|
+
project_path = Dir.pwd / gen.snake_case(namespace)
|
30
|
+
end
|
31
|
+
|
32
|
+
# Setup standard options for generating a project
|
33
|
+
gen.target_name = gen.target = gen.method_name = gen.class_name = nil
|
34
|
+
gen.build_root = File.dirname(project_path) # dir where project dir lives
|
35
|
+
gen.filename = File.basename(project_path) # project dir name
|
36
|
+
gen.namespace = gen.camel_case namespace
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
# default behavior for a template is to just copy the contents of the
|
42
|
+
# templates directory to the end destination. Add any additional configs here.
|
43
|
+
config :templates,
|
44
|
+
:root_dir => '_file_path_'
|
45
|
+
|
data/gen/project/INIT
ADDED
data/gen/project/README
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Your project is now ready to use!
|
data/gen/project/USAGE
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# ===========================================================================
|
2
|
+
# Project: <%= namespace %>
|
3
|
+
# Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
+
# ===========================================================================
|
5
|
+
|
6
|
+
# Add initial buildfile information here
|
7
|
+
config :all, :required => :sproutcore
|
@@ -0,0 +1,7 @@
|
|
1
|
+
=============================================================================
|
2
|
+
Project: <%= namespace %>
|
3
|
+
Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
+
=============================================================================
|
5
|
+
|
6
|
+
TODO: Describe Your Project
|
7
|
+
|
data/gen/test/Buildfile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# ==========================================================================
|
2
|
+
# Generator: Model
|
3
|
+
# Copyright: ©2006-2009 Sprout Systems, Inc. and contributors
|
4
|
+
# portions copyright ©2009 Apple, Inc.
|
5
|
+
# ==========================================================================
|
6
|
+
|
7
|
+
namespace :generator do
|
8
|
+
|
9
|
+
# - Verify required properties are present.
|
10
|
+
# - If class_name & method_name is passed, add it to the filename.
|
11
|
+
# - If second param is passed, use it as the filename
|
12
|
+
task :prepare do
|
13
|
+
GENERATOR.requires! :target_project, :target, :namespace
|
14
|
+
|
15
|
+
class_name = GENERATOR.class_name
|
16
|
+
method_name = GENERATOR.method_name
|
17
|
+
if class_name && method_name
|
18
|
+
GENERATOR.filename = GENERATOR.snake_case(class_name) / GENERATOR.snake_case(method_name)
|
19
|
+
end
|
20
|
+
|
21
|
+
arguments = GENERATOR.arguments
|
22
|
+
GENERATOR.filename = arguments[2] if arguments[2]
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
data/gen/test/README
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Your unit test has been generated and is now ready to be configured!
|
data/gen/test/USAGE
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
test - Create a new SproutCore unit test.
|
2
|
+
|
3
|
+
USAGE:
|
4
|
+
sc-gen app AppName.ClassName[.methodName] [--filename=FILENAME] [--target=TARGET_NAME]
|
5
|
+
|
6
|
+
DISCUSSION:
|
7
|
+
|
8
|
+
This generator will create a new SproutCore unit test for a particular application. You should pass as the first parameter as AppName.ClassName, for example:
|
9
|
+
|
10
|
+
sc-gen test Todos.Task
|
11
|
+
|
12
|
+
defines a new unit test called Todos.Task in the file apps/todos/tests/models/task.js .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: <%= namespace %> Unit Test
|
3
|
+
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
+
// ==========================================================================
|
5
|
+
/*globals <%= namespace %> module test ok equals same stop start */
|
6
|
+
|
7
|
+
module("<%= namespace %>");
|
8
|
+
|
9
|
+
// TODO: Replace with real unit test
|
10
|
+
test("test description", function() {
|
11
|
+
var expected = "test";
|
12
|
+
var result = "test";
|
13
|
+
equals(result, expected, "test should equal test");
|
14
|
+
});
|
15
|
+
|
data/gen/theme/Buildfile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# ==========================================================================
|
2
|
+
# Generator: Theme
|
3
|
+
# Copyright: ©2006-2009 Sprout Systems, Inc. and contributors
|
4
|
+
# portions copyright ©2009 Apple, Inc.
|
5
|
+
# ==========================================================================
|
6
|
+
|
7
|
+
namespace :generator do
|
8
|
+
|
9
|
+
# Require a project then make sure the build root is always the project
|
10
|
+
# root.
|
11
|
+
task :prepare do
|
12
|
+
GENERATOR.requires! :target_project
|
13
|
+
|
14
|
+
# if the target name has a slash in it, then we are trying to create a
|
15
|
+
# nested target. extract the final part (since this is the target name)
|
16
|
+
# and then set the build root to the parent target.
|
17
|
+
if GENERATOR.target_name && GENERATOR.target_name =~ /\//
|
18
|
+
parent_target_name = GENERATOR.target_name.split('/')
|
19
|
+
GENERATOR.target_name = parent_target_name.pop
|
20
|
+
|
21
|
+
parent_target_name = parent_target_name * "/"
|
22
|
+
project = GENERATOR.target_project
|
23
|
+
|
24
|
+
GENERATOR.parent_target_name = parent_target_name
|
25
|
+
GENERATOR.parent_target = project.target_for(parent_target_name)
|
26
|
+
GENERATOR.requires! :parent_target, :parent_target_name
|
27
|
+
|
28
|
+
GENERATOR.build_root = GENERATOR.parent_target.source_root
|
29
|
+
|
30
|
+
# otherwise just use project_root
|
31
|
+
else
|
32
|
+
GENERATOR.build_root = GENERATOR.target_project.project_root
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
data/gen/theme/README
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Your theme is now ready to use!
|
data/gen/theme/USAGE
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
theme - Create a new SproutCore theme.
|
2
|
+
|
3
|
+
USAGE:
|
4
|
+
|
5
|
+
sc-gen theme ThemeName [--filename=FILENAME] [--target=TARGET_NAME]
|
6
|
+
|
7
|
+
DISCUSSION:
|
8
|
+
|
9
|
+
This generator will create a new SproutCore theme for a particular project. You should pass as the first parameter your ThemeName you want to create. For example:
|
10
|
+
|
11
|
+
sc-gen theme Todos
|
12
|
+
|
13
|
+
defines a new theme called Todos in the file themes/todos/ .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: <%= namespace %> Strings
|
3
|
+
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
+
// ==========================================================================
|
5
|
+
/*globals <%= namespace %> */
|
6
|
+
|
7
|
+
// Place strings you want to localize here. In your app, use the key and
|
8
|
+
// localize it using "key string".loc(). HINT: For your key names, use the
|
9
|
+
// english string with an underscore in front. This way you can still see
|
10
|
+
// how your UI will look and you'll notice right away when something needs a
|
11
|
+
// localized string added to this file!
|
12
|
+
//
|
13
|
+
SC.stringsFor('English', {
|
14
|
+
// "_String Key": "Localized String"
|
15
|
+
}) ;
|
data/gen/view/Buildfile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# ==========================================================================
|
2
|
+
# Generator: View
|
3
|
+
# Copyright: ©2006-2009 Sprout Systems, Inc. and contributors
|
4
|
+
# portions copyright ©2009 Apple, Inc.
|
5
|
+
# ==========================================================================
|
6
|
+
|
7
|
+
namespace :generator do
|
8
|
+
|
9
|
+
# - Verify required properties are present
|
10
|
+
# - Accept second argument as base class
|
11
|
+
# - If file name ends in "_view", strip it off
|
12
|
+
task :prepare do
|
13
|
+
GENERATOR.requires! :target_project, :target, :namespace, :class_name
|
14
|
+
GENERATOR.base_class_name ||= GENERATOR.arguments[2]
|
15
|
+
GENERATOR.filename = GENERATOR.filename.sub(/_view$/,'')
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
data/gen/view/README
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Your controller is now ready to use!
|
data/gen/view/USAGE
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
model - Create a new controller class in your SproutCore app.
|
2
|
+
|
3
|
+
USAGE:
|
4
|
+
|
5
|
+
sc-gen controller AppName.ClassNameController [--filename=FILENAME] [--target=TARGET_NAME]
|
6
|
+
|
7
|
+
DISCUSSION:
|
8
|
+
|
9
|
+
This generator will create a new SproutCore controller file in your app. You should pass as the first parameter your AppName.ClassNameController combination you want to create. For example:
|
10
|
+
|
11
|
+
sc-gen controller Todos.TaskController
|
12
|
+
|
13
|
+
defines a new class called Todos.TaskController in the file apps/todos/controllers/task.js .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: <%= namespace_class_name %> Unit Test
|
3
|
+
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
+
// ==========================================================================
|
5
|
+
/*globals <%= namespace %> module test ok equals same stop start */
|
6
|
+
|
7
|
+
module("<%= namespace_class_name %>");
|
8
|
+
|
9
|
+
// TODO: Replace with real unit test for <%= namespace_class_name %>
|
10
|
+
test("test description", function() {
|
11
|
+
var expected = "test";
|
12
|
+
var result = "test";
|
13
|
+
equals(result, expected, "test should equal test");
|
14
|
+
});
|
15
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: <%= namespace_class_name %>
|
3
|
+
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
+
// ==========================================================================
|
5
|
+
/*globals <%= namespace %> */
|
6
|
+
|
7
|
+
/** @class
|
8
|
+
|
9
|
+
(Document Your View Here)
|
10
|
+
|
11
|
+
@extends <%= base_class_name || 'SC.View' %>
|
12
|
+
*/
|
13
|
+
<%= namespace_class_name %> = <%= base_class_name || 'SC.View' %>.extend(
|
14
|
+
/** @scope <%= namespace_class_name %>.prototype */ {
|
15
|
+
|
16
|
+
// TODO: Add your own code here.
|
17
|
+
|
18
|
+
});
|
data/lib/sproutcore.rb
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
# ===========================================================================
|
2
|
+
# Project: Abbot - SproutCore Build Tools
|
3
|
+
# Copyright: ©2009 Apple, Inc.
|
4
|
+
# portions copyright @2006-2009 Sprout Systems, Inc.
|
5
|
+
# ===========================================================================
|
6
|
+
|
7
|
+
require 'rubygems'
|
8
|
+
require 'logger'
|
9
|
+
require 'extlib'
|
10
|
+
|
11
|
+
$KCODE = 'u'
|
12
|
+
require 'jcode'
|
13
|
+
|
14
|
+
# Makes code more readable
|
15
|
+
YES = true
|
16
|
+
NO = false
|
17
|
+
|
18
|
+
module SproutCore
|
19
|
+
|
20
|
+
# :stopdoc:
|
21
|
+
VERSION = '1.0.0'
|
22
|
+
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
23
|
+
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
24
|
+
# :startdoc:
|
25
|
+
|
26
|
+
# Returns the version string for the library.
|
27
|
+
#
|
28
|
+
def self.version
|
29
|
+
VERSION
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns the library path for the module. If any arguments are given,
|
33
|
+
# they will be joined to the end of the libray path using
|
34
|
+
# <tt>File.join</tt>.
|
35
|
+
#
|
36
|
+
def self.libpath( *args )
|
37
|
+
args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns the lpath for the module. If any arguments are given,
|
41
|
+
# they will be joined to the end of the path using
|
42
|
+
# <tt>File.join</tt>.
|
43
|
+
#
|
44
|
+
def self.path( *args )
|
45
|
+
args.empty? ? PATH : ::File.join(PATH, args.flatten)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Utility method used to rquire all files ending in .rb that lie in the
|
49
|
+
# directory below this file that has the same name as the filename passed
|
50
|
+
# in. Optionally, a specific _directory_ name can be passed in such that
|
51
|
+
# the _filename_ does not have to be equivalent to the directory.
|
52
|
+
#
|
53
|
+
def self.require_all_libs_relative_to( fname, dir = nil )
|
54
|
+
dir ||= ::File.basename(fname, '.*')
|
55
|
+
search_me = ::File.expand_path(
|
56
|
+
::File.join(::File.dirname(fname), dir, '*.rb'))
|
57
|
+
|
58
|
+
Dir.glob(search_me).sort.each {|rb| require rb}
|
59
|
+
end
|
60
|
+
|
61
|
+
# Global variable that can store specific environmental settings. This is
|
62
|
+
# where you will find the build mode among other things set by sc-build.
|
63
|
+
#
|
64
|
+
def self.env
|
65
|
+
@env ||= HashStruct.new(:build_mode => :debug, :buildfile_names => %w(Buildfile sc-config sc-config.rb))
|
66
|
+
end
|
67
|
+
def self.env=(hash); @env = HashStruct.new(hash); end
|
68
|
+
|
69
|
+
# Returns a standard logger object. You can replace this with your own
|
70
|
+
# logger to redirect all SproutCore log output if needed. Otherwise, a
|
71
|
+
# logger will bre created based on your env.log_level and env.logfile
|
72
|
+
# options.
|
73
|
+
def self.logger
|
74
|
+
return @logger unless @logger.nil?
|
75
|
+
|
76
|
+
if env.logfile
|
77
|
+
@logger = Logger.new env.logfile, 10, 1024000
|
78
|
+
else
|
79
|
+
@logger = Logger.new $stderr
|
80
|
+
|
81
|
+
# if we are logging to the screen, no reason to use a std loggin fmt
|
82
|
+
@logger.formatter = lambda do |severity, time, progname, msg|
|
83
|
+
[severity, '~', msg.to_s, "\n"].join(' ')
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
@logger.level = (env.log_level == :debug) ? Logger::DEBUG : ((env.log_level == :info) ? Logger::INFO : Logger::WARN)
|
88
|
+
|
89
|
+
return @logger
|
90
|
+
end
|
91
|
+
attr_writer :logger
|
92
|
+
|
93
|
+
# Returns the current build mode. The build mode is determined based on the
|
94
|
+
# current environment build_mode settings. Note that for backwards
|
95
|
+
# compatibility reasons, :development and :debug are treated as being
|
96
|
+
# identical.
|
97
|
+
def self.build_mode
|
98
|
+
ret = env.build_mode || :production
|
99
|
+
ret = ret.to_sym unless ret.nil?
|
100
|
+
ret = :debug if ret == :development # backwards compatibility
|
101
|
+
ret
|
102
|
+
end
|
103
|
+
|
104
|
+
def self.build_mode=(new_mode)
|
105
|
+
new_mode = new_mode.to_sym
|
106
|
+
new_mode = :debug if new_mode == :development
|
107
|
+
env.build_mode = new_mode
|
108
|
+
self.build_mode
|
109
|
+
end
|
110
|
+
|
111
|
+
# Returns a project instance representing the builtin library
|
112
|
+
def self.builtin_project
|
113
|
+
@builtin_project ||= SC::Project.new(PATH)
|
114
|
+
end
|
115
|
+
|
116
|
+
# Returns the current project, if defined. This is normally only set
|
117
|
+
# when you start sc-server in interactive mode.
|
118
|
+
def self.project; @project; end
|
119
|
+
def self.project=(project); @project = project; end
|
120
|
+
|
121
|
+
end # module SC
|
122
|
+
|
123
|
+
SC = SproutCore # alias
|
124
|
+
|
125
|
+
SC.require_all_libs_relative_to(__FILE__)
|
126
|
+
%w(buildfile models helpers deprecated builders render_engines tools rack).each do |dir|
|
127
|
+
SC.require_all_libs_relative_to(__FILE__, ['sproutcore', dir])
|
128
|
+
end
|
129
|
+
|
130
|
+
# EOF
|