sproutcore 1.5.0 → 1.6.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.mailmap +32 -0
- data/CHANGELOG +8 -1
- data/Rakefile +16 -0
- data/VERSION.yml +2 -2
- data/bin/sc-build +0 -5
- data/bin/sc-build-number +0 -5
- data/bin/sc-docs +0 -5
- data/bin/sc-gen +0 -5
- data/bin/sc-init +0 -5
- data/bin/sc-manifest +0 -5
- data/bin/sc-server +0 -5
- data/bin/sproutcore +0 -5
- data/lib/frameworks/sproutcore/Buildfile +3 -3
- data/lib/frameworks/sproutcore/CHANGELOG.md +13 -0
- data/lib/frameworks/sproutcore/README.md +77 -7
- data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +0 -2
- data/lib/frameworks/sproutcore/frameworks/animation/core.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +1 -17
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/controller.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/object.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/collection.js +23 -21
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/delegate_support.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/device.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +16 -16
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +1 -34
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +29 -23
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +8 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/string.js +20 -23
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +55 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/collection.js +49 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +19 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +4 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +38 -41
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +7 -82
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +12 -5
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/array_observers.js +82 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/debug/core.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/debug/invoke_once_last_debugging.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +33 -30
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +12 -11
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +20 -20
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/navigation_builder.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +10 -10
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +24 -23
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +51 -54
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/modal.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/select_button.js +29 -29
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/responder.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/checkbox.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/master_detail.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/progress.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio_group.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/slider.js +7 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +31 -31
- data/lib/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +35 -29
- data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +61 -50
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +9 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +6 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +2 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/coders/object.js +12 -12
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/controllers/designs.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/controllers/page_files.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/css/css_style_sheet.js +7 -9
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/object_designer.js +13 -13
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/view_designer.js +37 -37
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/ext/object.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/ext/page.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/ext/view.js +4 -3
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/mixins/snap_lines.js +7 -6
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/designer_drop_target.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/drawing.js +49 -42
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/high_light.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/page_item_view.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/device.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/english.lproj/default_styles.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/english.lproj/strings.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/mixins/edit_mode.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/mixins/emptiness.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/render_delegates/form.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/render_delegates/form_row.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_checkbox_field.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_field.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_label.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_radio_field.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_row.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_text_field.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/views/form.js +13 -14
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/views/form_row.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +4 -6
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +0 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/system/image_queue.js +8 -12
- data/lib/frameworks/sproutcore/frameworks/foundation/views/inline_text_field.js +28 -34
- data/lib/frameworks/sproutcore/frameworks/{foundation → routing}/system/routes.js +31 -47
- data/lib/frameworks/sproutcore/frameworks/{foundation → routing}/tests/system/routes.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +15 -21
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +8 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array_observers.js +23 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/contains.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/intersects.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +66 -133
- data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +68 -139
- data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +11 -11
- data/lib/frameworks/sproutcore/frameworks/testing/system/suite.js +23 -29
- data/lib/frameworks/sproutcore/lib/index.rhtml +5 -2
- data/lib/sproutcore/builders/minify.rb +5 -5
- data/lib/sproutcore/helpers/minifier.rb +6 -10
- data/lib/sproutcore/models/target.rb +2 -2
- data/lib/sproutcore/rack/proxy.rb +8 -7
- data/lib/sproutcore/tools.rb +16 -5
- data/lib/sproutcore.rb +2 -9
- data/spec/lib/builders/html_spec.rb +5 -5
- data/sproutcore.gemspec +11 -5
- data/vendor/chance/lib/chance.rb +4 -2
- data/{lib/sproutcore/vendor → vendor}/jsdoc/README.txt +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Chain.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Dumper.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Hash.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Link.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Namespace.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Opt.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Reflection.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/String.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Testrun.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/FOODOC.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/XMLDOC/DomReader.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/XMLDOC/XMLDoc.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/XMLDOC/XMLParse.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/XMLDOC.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/DocComment.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/DocTag.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/JsDoc.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/JsPlate.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Lang.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Parser.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/PluginManager.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Symbol.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/SymbolSet.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/TextStream.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Token.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/TokenReader.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/TokenStream.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Util.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Walker.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/main.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/commentSrcJson.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/frameworkPrototype.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/functionCall.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/publishSrcHilite.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/sproutcoreTags.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/symbolLink.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/tagParamConfig.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/tagSynonyms.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/run.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/t/TestDoc.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/t/runner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/addon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/anon_inner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/augments.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/augments2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/borrows.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/borrows2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/config.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/constructs.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/encoding.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/encoding_other.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/functions_anon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/functions_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/global.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/globals.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/ignore.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/inner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/jsdoc_test.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/lend.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/memberof.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/memberof_constructor.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/name.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/namespace_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/nocode.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/oblit_anon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/overview.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/param_inline.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/params_optional.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/prototype.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/prototype_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/prototype_oblit.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/prototype_oblit_constructor.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/public.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/shared.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/shared2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/shortcuts.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/static_this.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/synonyms.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/tosource.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/variable_redefine.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/changes.txt +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/conf/sample.conf +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/build.xml +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/build_1.4.xml +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/classes/js.jar +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/src/JsDebugRun.java +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/src/JsRun.java +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/jsdebug.jar +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/jsrun.jar +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/t/TestDoc.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/t/runner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/addon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/anon_inner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/augments.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/augments2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/borrows.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/borrows2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/config.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/constructs.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/encoding.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/encoding_other.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/functions_anon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/functions_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/global.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/globals.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/ignore.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/inner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/jsdoc_test.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/lend.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/memberof.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/memberof_constructor.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/name.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/namespace_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/nocode.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/oblit_anon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/overview.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/param_inline.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/params_optional.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/prototype.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/prototype_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/prototype_oblit.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/prototype_oblit_constructor.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/public.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/shared.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/shared2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/shortcuts.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/static_this.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/synonyms.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/tosource.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/variable_redefine.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test.js +0 -0
- data/vendor/sproutcore/{src/SCCompiler/lib/yuicompressor-2.4.4.jar → lib/yuicompressor-2.4.6.jar} +0 -0
- metadata +176 -202
- data/lib/frameworks/sproutcore/frameworks/desktop/views/file.js +0 -148
- data/lib/sproutcore/vendor/github_gem_lint.rb +0 -22
- data/vendor/sproutcore/SCCompiler.jar +0 -0
- data/vendor/sproutcore/lib/args4j-2.0.12.jar +0 -0
- data/vendor/sproutcore/lib/yuicompressor-2.4.2.jar +0 -0
- data/vendor/sproutcore/src/SCCompiler/build.xml +0 -74
- data/vendor/sproutcore/src/SCCompiler/lib/args4j-2.0.12.jar +0 -0
- data/vendor/sproutcore/src/SCCompiler/lib/htmlcompressor-0.9.3.jar +0 -0
- data/vendor/sproutcore/src/SCCompiler/lib/yuicompressor-2.4.2.jar +0 -0
- data/vendor/sproutcore/src/SCCompiler/manifest.mf +0 -3
- data/vendor/sproutcore/src/SCCompiler/nbproject/build-impl.xml +0 -894
- data/vendor/sproutcore/src/SCCompiler/nbproject/genfiles.properties +0 -8
- data/vendor/sproutcore/src/SCCompiler/nbproject/private/config.properties +0 -0
- data/vendor/sproutcore/src/SCCompiler/nbproject/private/private.properties +0 -10
- data/vendor/sproutcore/src/SCCompiler/nbproject/private/private.xml +0 -4
- data/vendor/sproutcore/src/SCCompiler/nbproject/project.properties +0 -90
- data/vendor/sproutcore/src/SCCompiler/nbproject/project.xml +0 -15
- data/vendor/sproutcore/src/SCCompiler/src/com/sproutcore/Main.java +0 -348
@@ -25,14 +25,10 @@ sc_require('system/state');
|
|
25
25
|
|
26
26
|
The following example shows how states are nested within a statechart:
|
27
27
|
|
28
|
-
{{{
|
29
|
-
|
30
28
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
31
|
-
|
32
29
|
rootState: SC.State.design({
|
33
|
-
|
34
30
|
initialSubstate: 'stateA',
|
35
|
-
|
31
|
+
|
36
32
|
stateA: SC.State.design({
|
37
33
|
// ... can continue to nest further states
|
38
34
|
}),
|
@@ -41,10 +37,7 @@ sc_require('system/state');
|
|
41
37
|
// ... can continue to nest further states
|
42
38
|
})
|
43
39
|
})
|
44
|
-
|
45
|
-
})
|
46
|
-
|
47
|
-
}}}
|
40
|
+
});
|
48
41
|
|
49
42
|
Note how in the example above, the root state as an explicit initial substate to enter into. If no
|
50
43
|
initial substate is provided, then the statechart will default to the the state's first substate.
|
@@ -53,12 +46,9 @@ sc_require('system/state');
|
|
53
46
|
on your object that represents states. Upon initialization, a root state will be constructed automatically
|
54
47
|
by the mixin and make the states on the object substates of the root state. As an example:
|
55
48
|
|
56
|
-
{{{
|
57
|
-
|
58
49
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
59
|
-
|
60
50
|
initialState: 'stateA',
|
61
|
-
|
51
|
+
|
62
52
|
stateA: SC.State.design({
|
63
53
|
// ... can continue to nest further states
|
64
54
|
}),
|
@@ -66,10 +56,7 @@ sc_require('system/state');
|
|
66
56
|
stateB: SC.State.design({
|
67
57
|
// ... can continue to nest further states
|
68
58
|
})
|
69
|
-
|
70
|
-
})
|
71
|
-
|
72
|
-
}}}
|
59
|
+
});
|
73
60
|
|
74
61
|
If you liked to specify a class that should be used as the root state but using the above method to defined
|
75
62
|
states, you can set the rootStateExample property with a class that extends from SC.State. If the
|
@@ -80,14 +67,10 @@ sc_require('system/state');
|
|
80
67
|
independent state structure from other concurrent states. The following example shows how to provide your
|
81
68
|
statechart with concurrent states:
|
82
69
|
|
83
|
-
{{{
|
84
|
-
|
85
70
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
86
|
-
|
87
71
|
rootState: SC.State.design({
|
88
|
-
|
89
72
|
substatesAreConcurrent: YES,
|
90
|
-
|
73
|
+
|
91
74
|
stateA: SC.State.design({
|
92
75
|
// ... can continue to nest further states
|
93
76
|
}),
|
@@ -96,10 +79,7 @@ sc_require('system/state');
|
|
96
79
|
// ... can continue to nest further states
|
97
80
|
})
|
98
81
|
})
|
99
|
-
|
100
|
-
})
|
101
|
-
|
102
|
-
}}}
|
82
|
+
});
|
103
83
|
|
104
84
|
Above, to indicate that a state's substates are concurrent, you just have to set the substatesAreConcurrent to
|
105
85
|
YES. Once done, then stateA and stateB will be independent of each other and each will manage their
|
@@ -108,12 +88,9 @@ sc_require('system/state');
|
|
108
88
|
To define concurrent states directly on the object without explicitly defining a root, you can do the
|
109
89
|
following:
|
110
90
|
|
111
|
-
{{{
|
112
|
-
|
113
91
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
114
|
-
|
115
92
|
statesAreConcurrent: YES,
|
116
|
-
|
93
|
+
|
117
94
|
stateA: SC.State.design({
|
118
95
|
// ... can continue to nest further states
|
119
96
|
}),
|
@@ -121,94 +98,67 @@ sc_require('system/state');
|
|
121
98
|
stateB: SC.State.design({
|
122
99
|
// ... can continue to nest further states
|
123
100
|
})
|
124
|
-
|
125
|
-
})
|
126
|
-
|
127
|
-
}}}
|
101
|
+
});
|
128
102
|
|
129
103
|
Remember that a startchart can have a mixture of nested and concurrent states in order for you to
|
130
104
|
create as complex of statecharts that suite your needs. Here is an example of a mixed state structure:
|
131
105
|
|
132
|
-
{{{
|
133
|
-
|
134
106
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
135
|
-
|
136
107
|
rootState: SC.State.design({
|
137
|
-
|
138
108
|
initialSubstate: 'stateA',
|
139
|
-
|
109
|
+
|
140
110
|
stateA: SC.State.design({
|
141
|
-
|
142
111
|
substatesAreConcurrent: YES,
|
143
|
-
|
112
|
+
|
144
113
|
stateM: SC.State.design({ ... })
|
145
114
|
stateN: SC.State.design({ ... })
|
146
115
|
stateO: SC.State.design({ ... })
|
147
|
-
|
148
116
|
}),
|
149
117
|
|
150
118
|
stateB: SC.State.design({
|
151
|
-
|
152
119
|
initialSubstate: 'stateX',
|
153
|
-
|
120
|
+
|
154
121
|
stateX: SC.State.design({ ... })
|
155
122
|
stateY: SC.State.desgin({ ... })
|
156
|
-
|
157
123
|
})
|
158
124
|
})
|
159
|
-
|
160
|
-
})
|
161
|
-
|
162
|
-
}}}
|
125
|
+
});
|
163
126
|
|
164
127
|
Depending on your needs, a statechart can have lots of states, which can become hard to manage all within
|
165
128
|
one file. To modularize your states and make them easier to manage and maintain, you can plug-in states
|
166
129
|
into other states. Let's say we are using the statechart in the last example above, and all the code is
|
167
130
|
within one file. We could update the code and split the logic across two or more files like so:
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
131
|
+
|
132
|
+
// state_a.js
|
133
|
+
|
172
134
|
MyApp.StateA = SC.State.extend({
|
173
|
-
|
174
135
|
substatesAreConcurrent: YES,
|
175
|
-
|
136
|
+
|
176
137
|
stateM: SC.State.design({ ... })
|
177
138
|
stateN: SC.State.design({ ... })
|
178
139
|
stateO: SC.State.design({ ... })
|
179
|
-
|
180
140
|
});
|
181
|
-
|
182
|
-
|
183
|
-
|
141
|
+
|
142
|
+
// state_b.js
|
143
|
+
|
184
144
|
MyApp.StateB = SC.State.extend({
|
185
|
-
|
186
145
|
substatesAreConcurrent: YES,
|
187
|
-
|
146
|
+
|
188
147
|
stateM: SC.State.design({ ... })
|
189
148
|
stateN: SC.State.design({ ... })
|
190
149
|
stateO: SC.State.design({ ... })
|
191
|
-
|
192
150
|
});
|
193
|
-
|
194
|
-
|
195
|
-
|
151
|
+
|
152
|
+
// statechart.js
|
153
|
+
|
196
154
|
MyApp.Statechart = SC.Object.extend(SC.StatechartManager, {
|
197
|
-
|
198
155
|
rootState: SC.State.design({
|
199
|
-
|
200
156
|
initialSubstate: 'stateA',
|
201
|
-
|
202
157
|
stateA: SC.State.plugin('MyApp.StateA'),
|
203
|
-
|
204
158
|
stateB: SC.State.plugin('MyApp.StateB')
|
205
|
-
|
206
159
|
})
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
}}}
|
211
|
-
|
160
|
+
});
|
161
|
+
|
212
162
|
Using state plug-in functionality is optional. If you use the plug-in feature you can break up your statechart
|
213
163
|
into as many files as you see fit.
|
214
164
|
|
@@ -552,22 +502,18 @@ SC.StatechartManager = {
|
|
552
502
|
|
553
503
|
Method can be called in the following ways:
|
554
504
|
|
555
|
-
|
556
|
-
|
557
|
-
// With one argument.
|
558
|
-
gotoState(<state>)
|
505
|
+
// With one argument.
|
506
|
+
gotoState(<state>)
|
559
507
|
|
560
|
-
|
561
|
-
|
508
|
+
// With two argument.
|
509
|
+
gotoState(<state>, <state | boolean | hash>)
|
562
510
|
|
563
|
-
|
564
|
-
|
565
|
-
|
511
|
+
// With three argument.
|
512
|
+
gotoState(<state>, <state>, <boolean | hash>)
|
513
|
+
gotoState(<state>, <boolean>, <hash>)
|
566
514
|
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
}}}
|
515
|
+
// With four argument.
|
516
|
+
gotoState(<state>, <state>, <boolean>, <hash>)
|
571
517
|
|
572
518
|
where <state> is either a SC.State object or a string and <hash> is a regular JS hash object.
|
573
519
|
|
@@ -885,22 +831,18 @@ SC.StatechartManager = {
|
|
885
831
|
|
886
832
|
Method can be called in the following ways:
|
887
833
|
|
888
|
-
|
889
|
-
|
890
|
-
// With one arguments.
|
891
|
-
gotoHistorytate(<state>)
|
834
|
+
// With one arguments.
|
835
|
+
gotoHistorytate(<state>)
|
892
836
|
|
893
|
-
|
894
|
-
|
837
|
+
// With two arguments.
|
838
|
+
gotoHistorytate(<state>, <state | boolean | hash>)
|
895
839
|
|
896
|
-
|
897
|
-
|
898
|
-
|
840
|
+
// With three arguments.
|
841
|
+
gotoHistorytate(<state>, <state>, <boolean | hash>)
|
842
|
+
gotoHistorytate(<state>, <boolean>, <hash>)
|
899
843
|
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
}}}
|
844
|
+
// With four argumetns
|
845
|
+
gotoHistorytate(<state>, <state>, <boolean>, <hash>)
|
904
846
|
|
905
847
|
where <state> is either a SC.State object or a string and <hash> is a regular JS hash object.
|
906
848
|
|
@@ -1208,23 +1150,18 @@ SC.StatechartManager = {
|
|
1208
1150
|
|
1209
1151
|
A few notes:
|
1210
1152
|
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
to invoke the given method.
|
1153
|
+
1. Calling this is not the same as calling sendEvent or sendAction.
|
1154
|
+
Rather, this should be seen as calling normal methods on a state that
|
1155
|
+
will *not* call gotoState or gotoHistoryState.
|
1156
|
+
2. A state will only ever be invoked once per call. So if there are two
|
1157
|
+
or more current states that have the same parent state, then that parent
|
1158
|
+
state will only be invoked once if none of the current states are able
|
1159
|
+
to invoke the given method.
|
1219
1160
|
|
1220
1161
|
When calling this method, you are able to supply zero ore more arguments
|
1221
1162
|
that can be pass onto the method called on the states. As an example
|
1222
1163
|
|
1223
|
-
|
1224
|
-
|
1225
|
-
invokeStateMethod('render', context, firstTime);
|
1226
|
-
|
1227
|
-
}}}
|
1164
|
+
invokeStateMethod('render', context, firstTime);
|
1228
1165
|
|
1229
1166
|
The above call will invoke the render method on the current states
|
1230
1167
|
and supply the context and firstTime arguments to the method.
|
@@ -1235,14 +1172,10 @@ SC.StatechartManager = {
|
|
1235
1172
|
we want to call a calculate method on the current states where the method
|
1236
1173
|
will return a value when invoked. We can handle the returned values like so:
|
1237
1174
|
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
// on the given state
|
1243
|
-
})
|
1244
|
-
|
1245
|
-
}}}
|
1175
|
+
invokeStateMethod('calculate', value, function(state, result) {
|
1176
|
+
// .. handle the result returned from calculate that was invoked
|
1177
|
+
// on the given state
|
1178
|
+
})
|
1246
1179
|
|
1247
1180
|
If the method invoked does not return a value and a callback function is
|
1248
1181
|
supplied, then result value will simply be undefined. In all cases, if
|
@@ -1414,9 +1347,9 @@ SC.StatechartManager = {
|
|
1414
1347
|
it based on properties found on this state that derive from a SC.State class. For the
|
1415
1348
|
root state to be successfully built, the following much be met:
|
1416
1349
|
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1350
|
+
- The rootStateExample property must be defined with a class that derives from SC.State
|
1351
|
+
- Either the initialState or statesAreConcurrent property must be set, but not both
|
1352
|
+
- There must be one or more states that can be added to the root state
|
1420
1353
|
|
1421
1354
|
*/
|
1422
1355
|
_constructRootStateClass: function() {
|
@@ -1585,25 +1518,21 @@ SC.Async.mixin({
|
|
1585
1518
|
|
1586
1519
|
Examples:
|
1587
1520
|
|
1588
|
-
|
1521
|
+
SC.State.extend({
|
1589
1522
|
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
return SC.Async.perform('foo');
|
1594
|
-
},
|
1523
|
+
enterState: function() {
|
1524
|
+
return SC.Async.perform('foo');
|
1525
|
+
},
|
1595
1526
|
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1527
|
+
exitState: function() {
|
1528
|
+
return SC.Async.perform('bar', 100);
|
1529
|
+
}
|
1599
1530
|
|
1600
|
-
|
1531
|
+
foo: function() { ... },
|
1601
1532
|
|
1602
|
-
|
1603
|
-
|
1604
|
-
});
|
1533
|
+
bar: function(arg) { ... }
|
1605
1534
|
|
1606
|
-
|
1535
|
+
});
|
1607
1536
|
|
1608
1537
|
@param func {String|Function} the functio to be invoked on a state
|
1609
1538
|
@param arg1 Optional. An argument to pass to the given function
|
@@ -25,25 +25,25 @@ var QUNIT_BREAK_ON_TEST_FAIL = false;
|
|
25
25
|
wrapper methods. The methods must accept a Plan object as their first
|
26
26
|
parameter.
|
27
27
|
|
28
|
-
|
28
|
+
## Results
|
29
29
|
|
30
30
|
The results hash contains a summary of the results of running the test
|
31
31
|
plan. It includes the following properties:
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
- *assertions* -- the total number of assertions
|
34
|
+
- *tests* -- the total number of tests
|
35
|
+
- *passed* -- number of assertions that passed
|
36
|
+
- *failed* -- number of assertions that failed
|
37
|
+
- *errors* -- number of assertions with errors
|
38
|
+
- *warnings* -- number of assertions with warnings
|
39
39
|
|
40
40
|
You can also consult the log property, which contains an array of hashes -
|
41
41
|
one for each assertion - with the following properties:
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
- *module* -- module descriptions
|
44
|
+
- *test* -- test description
|
45
|
+
- *message* -- assertion description
|
46
|
+
- *result* -- CoreTest.OK, CoreTest.FAILED, CoreTest.ERROR, CoreTest.WARN
|
47
47
|
|
48
48
|
@since SproutCore 1.0
|
49
49
|
*/
|
@@ -16,7 +16,7 @@
|
|
16
16
|
types of objects to ensure that both the mixin and the object implementing
|
17
17
|
the mixin use the API properly.
|
18
18
|
|
19
|
-
|
19
|
+
## Using a Suite
|
20
20
|
|
21
21
|
To use a Suite, call the generate() method on the suite inside on of your
|
22
22
|
unit test files. This will generate new modules and tests in the suite
|
@@ -27,16 +27,14 @@
|
|
27
27
|
generate() method. See the documentation on the specific test suite for
|
28
28
|
information on the kind of customizations you may need to provide.
|
29
29
|
|
30
|
-
|
30
|
+
### Example
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
});
|
37
|
-
}}}
|
32
|
+
// generates the SC.ArrayTestSuite tests for a built-in array.
|
33
|
+
SC.ArrayTests.generate('Array', {
|
34
|
+
newObject: function() { return []; }
|
35
|
+
});
|
38
36
|
|
39
|
-
|
37
|
+
## Defining a Suite
|
40
38
|
|
41
39
|
To define a test suite, simply call the extend() method, passing any
|
42
40
|
attributs you want to define on the stuie along with this method. You can
|
@@ -45,24 +43,22 @@
|
|
45
43
|
Functions you pass to define will have an instance of the test suite passed
|
46
44
|
as their first parameter when invoked.
|
47
45
|
|
48
|
-
|
46
|
+
### Example
|
49
47
|
|
50
|
-
|
51
|
-
SC.ArrayTests = CoreTest.Suite.create("Verify SC.Array compliance", {
|
48
|
+
SC.ArrayTests = CoreTest.Suite.create("Verify SC.Array compliance", {
|
52
49
|
|
53
|
-
|
54
|
-
|
55
|
-
|
50
|
+
// override to generate a new object that implements SC.Array
|
51
|
+
newObject: function() { return null; }
|
52
|
+
});
|
56
53
|
|
57
|
-
|
58
|
-
|
54
|
+
SC.ArrayTests.define(function(T) {
|
55
|
+
T.module("length tests");
|
59
56
|
|
60
|
-
|
61
|
-
|
62
|
-
|
57
|
+
test("new length", function() {
|
58
|
+
equals(T.object.get('length'), 0, 'array length');
|
59
|
+
});
|
63
60
|
|
64
|
-
|
65
|
-
}}}
|
61
|
+
});
|
66
62
|
|
67
63
|
@since SproutCore 1.0
|
68
64
|
|
@@ -206,13 +202,11 @@ CoreTest.Suite = /** @scope CoreTest.Suite.prototype */ {
|
|
206
202
|
a convenience function for use inside of a definition function. You could
|
207
203
|
do the same thing by calling:
|
208
204
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
}
|
215
|
-
}}}
|
205
|
+
var T = this ;
|
206
|
+
module(T.desc(description), {
|
207
|
+
setup: function() { T.setup(); },
|
208
|
+
teardown: function() { T.teardown(); }
|
209
|
+
}
|
216
210
|
|
217
211
|
@param {String} desc detailed descrition
|
218
212
|
@returns {CoreTest.Suite} receiver
|
@@ -127,9 +127,12 @@
|
|
127
127
|
# set.
|
128
128
|
-%>
|
129
129
|
<% if config.html5_history %>
|
130
|
+
<%# TODO: Can we check for the framework in Ruby instead? %>
|
130
131
|
<script>
|
131
|
-
SC.routes
|
132
|
-
|
132
|
+
if (SC.routes) {
|
133
|
+
SC.routes.wantsHistory = true;
|
134
|
+
SC.routes.baseURI = <%= "#{@bundle.index_root}/#{language}".to_json %>;
|
135
|
+
}
|
133
136
|
</script>
|
134
137
|
<% end %>
|
135
138
|
<% #
|
@@ -35,12 +35,12 @@ module SC
|
|
35
35
|
def build_css(dst_path)
|
36
36
|
a = Regexp.new('^'+MANIFEST.build_root)
|
37
37
|
if dst_path =~ a
|
38
|
-
|
38
|
+
# $to_minify << dst_path
|
39
39
|
FileUtils.mkdir_p(File.dirname(dst_path))
|
40
40
|
FileUtils.copy(entry.source_path, dst_path)
|
41
41
|
else
|
42
42
|
FileUtils.mkdir_p(File.dirname(dst_path)) # make sure loc exists...
|
43
|
-
filecompress = "java -Xmx128m -jar \"" + SC.yui_jar + "\" --charset utf-8 --line-break 0 --nomunge --preserve-semi --disable-optimizations \"" + entry.source_path + "\" -o \"" + dst_path + "\" 2>&1"
|
43
|
+
filecompress = "java -Xmx128m -jar \"" + SC.yui_jar + "\" --type css --charset utf-8 --line-break 0 --nomunge --preserve-semi --disable-optimizations \"" + entry.source_path + "\" -o \"" + dst_path + "\" 2>&1"
|
44
44
|
SC.logger.info 'Compressing CSS with YUI .... '+ dst_path
|
45
45
|
SC.logger.debug `#{filecompress}`
|
46
46
|
|
@@ -50,12 +50,12 @@ module SC
|
|
50
50
|
SC.logger.fatal("!!!!Failed compressing CSS... "+ dst_path)
|
51
51
|
end
|
52
52
|
end
|
53
|
-
|
53
|
+
end
|
54
54
|
|
55
55
|
# Minify some javascript by invoking the YUI compressor.
|
56
56
|
def build_javascript(dst_path)
|
57
57
|
entry.source_entry.build!
|
58
|
-
|
58
|
+
|
59
59
|
# Minify module JavaScript immediately so it can be string-wrapped
|
60
60
|
if entry.target[:target_type] == :module
|
61
61
|
SC::Helpers::Minifier.minify dst_path
|
@@ -67,7 +67,7 @@ module SC
|
|
67
67
|
def build_inline_javascript(dst_path)
|
68
68
|
SC.logger.info 'Compiling inline Javascript with YUI: ' + dst_path + "..."
|
69
69
|
FileUtils.mkdir_p(File.dirname(dst_path)) # make sure loc exists...
|
70
|
-
filecompress = "java -Xmx128m -jar \"" + SC.yui_jar + "\" --js \"" + entry.source_path + "\"
|
70
|
+
filecompress = "java -Xmx128m -jar \"" + SC.yui_jar + "\" --type js \"" + entry.source_path + "\" -o \"" + dst_path + "\" 2>&1"
|
71
71
|
SC.logger.info 'Compiling with YUI: '+ filecompress + "..."
|
72
72
|
|
73
73
|
output = `#{filecompress}` # It'd be nice to just read STDERR, but
|
@@ -80,20 +80,16 @@ module SC::Helpers
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def minify(paths)
|
83
|
-
|
84
|
-
if paths.respond_to? :join
|
85
|
-
paths = paths * "\" \""
|
86
|
-
end
|
87
|
-
|
88
|
-
yui_root = File.expand_path("../../../../vendor/sproutcore", __FILE__)
|
89
|
-
jar_path = File.join(yui_root, "SCCompiler.jar")
|
83
|
+
paths = paths.first if paths.is_a?(Array) && paths.length == 1
|
90
84
|
|
91
|
-
if
|
92
|
-
|
85
|
+
if paths.is_a?(Array)
|
86
|
+
paths = paths.map{|p| '"'+p+'"'}.join(' ')
|
87
|
+
outfile = '".js$:.js"'
|
93
88
|
else
|
94
|
-
|
89
|
+
paths = outfile = '"'+paths+'"'
|
95
90
|
end
|
96
91
|
|
92
|
+
command = %{java -Xmx256m -jar "#{SC.yui_jar}" -o #{outfile} #{paths} 2>&1}
|
97
93
|
output = `#{command}`
|
98
94
|
|
99
95
|
SC.logger.info output
|
@@ -656,7 +656,7 @@ module SC
|
|
656
656
|
end
|
657
657
|
end
|
658
658
|
|
659
|
-
SC::HashStruct.new
|
659
|
+
SC::HashStruct.new({
|
660
660
|
:requires => requires,
|
661
661
|
:css_urls => css_urls,
|
662
662
|
:css_2x_urls => css_2x_urls,
|
@@ -820,7 +820,7 @@ module SC
|
|
820
820
|
FileUtils.mkdir_p(build_root)
|
821
821
|
|
822
822
|
# Prepare jsdoc opts
|
823
|
-
jsdoc_root =
|
823
|
+
jsdoc_root = File.expand_path('../../../../', __FILE__) / 'vendor' / 'jsdoc'
|
824
824
|
jar_path = jsdoc_root / 'jsrun.jar'
|
825
825
|
runjs_path = jsdoc_root / 'app' / 'run.js'
|
826
826
|
|
@@ -60,7 +60,9 @@ module SC
|
|
60
60
|
|
61
61
|
# Rack documentation says CONTENT_TYPE and CONTENT_LENGTH aren't prefixed by HTTP_
|
62
62
|
headers['Content-Type'] = env['CONTENT_TYPE'] if env['CONTENT_TYPE']
|
63
|
-
|
63
|
+
|
64
|
+
length = env['CONTENT_LENGTH']
|
65
|
+
headers['Content-Length'] = length if length
|
64
66
|
|
65
67
|
http_host, http_port = proxy[:to].split(':')
|
66
68
|
http_port = proxy[:secure] ? '443' : '80' if http_port.nil?
|
@@ -95,13 +97,12 @@ module SC
|
|
95
97
|
response = web.send(http_method, http_path, headers)
|
96
98
|
else
|
97
99
|
http_body = env['rack.input']
|
98
|
-
http_body.rewind
|
99
|
-
|
100
|
-
some_request = Net::HTTPGenericRequest.new http_method.upcase,
|
101
|
-
true, true, http_path, headers
|
100
|
+
http_body.rewind # May not be necessary but can't hurt
|
102
101
|
|
103
|
-
|
104
|
-
|
102
|
+
req = Net::HTTPGenericRequest.new(http_method.upcase,
|
103
|
+
true, true, http_path, headers)
|
104
|
+
req.body_stream = http_body if length.to_i > 0
|
105
|
+
response = web.request(req)
|
105
106
|
end
|
106
107
|
end
|
107
108
|
|
data/lib/sproutcore/tools.rb
CHANGED
@@ -44,6 +44,22 @@ module SC
|
|
44
44
|
class_option "library", :type => :string #deprecated
|
45
45
|
class_option "environment", :type => :string #deprecated
|
46
46
|
|
47
|
+
default_task :banner
|
48
|
+
|
49
|
+
desc "help", "How to use the sproutcore command"
|
50
|
+
def banner
|
51
|
+
str = "SproutCore #{SC::VERSION} Usage"
|
52
|
+
puts "#{str}\n"+('='*str.length)+"\n\n"
|
53
|
+
|
54
|
+
help
|
55
|
+
end
|
56
|
+
|
57
|
+
map "--version" => :version
|
58
|
+
desc "version", "Show the SproutCore version number"
|
59
|
+
def version
|
60
|
+
puts "SproutCore #{SC::VERSION}"
|
61
|
+
end
|
62
|
+
|
47
63
|
# This is the core entry method used to run every tool. Extend this
|
48
64
|
# method with any standard preprocessing you want all tools to do before
|
49
65
|
# they do their specific thing.
|
@@ -51,7 +67,6 @@ module SC
|
|
51
67
|
super
|
52
68
|
prepare_logger!
|
53
69
|
prepare_mode!
|
54
|
-
yui_minification!
|
55
70
|
dont_minify!
|
56
71
|
prepare_app!
|
57
72
|
prepare_build_numbers!
|
@@ -124,10 +139,6 @@ module SC
|
|
124
139
|
end
|
125
140
|
end
|
126
141
|
|
127
|
-
def yui_minification!
|
128
|
-
SC.env[:yui_minification] = options[:'yui-minification']
|
129
|
-
end
|
130
|
-
|
131
142
|
def dont_minify!
|
132
143
|
SC.env[:dont_minify] = options[:'dont-minify']
|
133
144
|
end
|