sproutcore 1.0.1003 → 1.0.1008

Sign up to get free protection for your applications and to get access to all the features.
Files changed (276) hide show
  1. data/Buildfile +15 -3
  2. data/Rakefile +3 -7
  3. data/VERSION.yml +2 -2
  4. data/buildtasks/manifest.rake +2 -0
  5. data/frameworks/sproutcore/Buildfile +2 -0
  6. data/frameworks/sproutcore/HISTORY +218 -203
  7. data/frameworks/sproutcore/README +47 -6
  8. data/frameworks/sproutcore/apps/tests/english.lproj/main_page.css +4 -0
  9. data/frameworks/sproutcore/design/Design Charts.graffle +2945 -4332
  10. data/frameworks/sproutcore/frameworks/bootstrap/README +9 -0
  11. data/frameworks/sproutcore/frameworks/bootstrap/core.js +7 -0
  12. data/frameworks/sproutcore/frameworks/bootstrap/setup_body_class_names.js +10 -0
  13. data/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +28 -0
  14. data/frameworks/sproutcore/frameworks/bootstrap/system/loader.js +45 -0
  15. data/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +9 -8
  16. data/frameworks/sproutcore/frameworks/datastore/models/record.js +49 -9
  17. data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +9 -0
  18. data/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +3 -2
  19. data/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +81 -8
  20. data/frameworks/sproutcore/frameworks/datastore/system/query.js +26 -5
  21. data/frameworks/sproutcore/frameworks/datastore/system/record_array.js +47 -0
  22. data/frameworks/sproutcore/frameworks/datastore/system/store.js +164 -32
  23. data/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +32 -4
  24. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/error_methods.js +56 -0
  25. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +1 -1
  26. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/unknownProperty.js +15 -0
  27. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +16 -1
  28. data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +1 -1
  29. data/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +22 -1
  30. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +32 -1
  31. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/core_methods.js +70 -0
  32. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation.js +12 -0
  33. data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js +50 -0
  34. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +9 -9
  35. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +8 -1
  36. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataHashDidChange.js +79 -0
  37. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +24 -0
  38. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/error_methods.js +62 -0
  39. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/init.js +2 -0
  40. data/frameworks/sproutcore/frameworks/debug/core.js +10 -6
  41. data/frameworks/sproutcore/frameworks/designer/controllers/page_design.js +43 -18
  42. data/frameworks/sproutcore/frameworks/designer/core.js +10 -0
  43. data/frameworks/sproutcore/frameworks/designer/english.lproj/selection_handles.css +58 -0
  44. data/frameworks/sproutcore/frameworks/designer/{views/mixins → mixins}/button.js +0 -0
  45. data/frameworks/sproutcore/frameworks/designer/views/{controls/button.js → button.js} +6 -2
  46. data/frameworks/sproutcore/frameworks/designer/views/designer.js +566 -136
  47. data/frameworks/sproutcore/frameworks/designer/views/selection_handles.js +77 -0
  48. data/frameworks/sproutcore/frameworks/desktop/core.js +12 -0
  49. data/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +1 -1
  50. data/frameworks/sproutcore/frameworks/desktop/english.lproj/drag.css +3 -2
  51. data/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +0 -36
  52. data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu.css +14 -0
  53. data/frameworks/sproutcore/frameworks/desktop/english.lproj/modal.css +4 -0
  54. data/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +2 -0
  55. data/frameworks/sproutcore/frameworks/desktop/english.lproj/tab.css +0 -4
  56. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +8 -5
  57. data/frameworks/sproutcore/frameworks/desktop/panes/alert.js +2 -2
  58. data/frameworks/sproutcore/frameworks/desktop/panes/menu.js +100 -111
  59. data/frameworks/sproutcore/frameworks/desktop/panes/panel.js +1 -1
  60. data/frameworks/sproutcore/frameworks/desktop/panes/picker.js +51 -13
  61. data/frameworks/sproutcore/frameworks/desktop/panes/{drop_down.js → select_button.js} +70 -109
  62. data/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +8 -0
  63. data/frameworks/sproutcore/frameworks/desktop/system/root_responder.js +69 -23
  64. data/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +4 -4
  65. data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +2 -0
  66. data/frameworks/sproutcore/frameworks/desktop/tests/panes/{dropDown → select_button}/methods.js +15 -11
  67. data/frameworks/sproutcore/frameworks/desktop/tests/panes/{dropDown → select_button}/ui.js +22 -22
  68. data/frameworks/sproutcore/frameworks/desktop/tests/views/button/methods.js +1 -1
  69. data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +0 -1
  70. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deleteSelection.js +1 -1
  71. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deselect.js +19 -3
  72. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +1 -1
  73. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +53 -28
  74. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/select.js +6 -6
  75. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectNextItem.js +23 -9
  76. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectPreviousItem.js +24 -10
  77. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +1 -1
  78. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +1 -1
  79. data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +10 -3
  80. data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/methods.js +1 -1
  81. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +50 -28
  82. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/methods.js +6 -6
  83. data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +3 -3
  84. data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +8 -8
  85. data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +1 -1
  86. data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +1 -1
  87. data/frameworks/sproutcore/frameworks/desktop/views/button.js +5 -3
  88. data/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +4 -3
  89. data/frameworks/sproutcore/frameworks/desktop/views/collection.js +125 -96
  90. data/frameworks/sproutcore/frameworks/desktop/views/grid.js +1 -0
  91. data/frameworks/sproutcore/frameworks/desktop/views/list.js +68 -18
  92. data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +134 -56
  93. data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +18 -11
  94. data/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +562 -2
  95. data/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +13 -0
  96. data/frameworks/sproutcore/frameworks/desktop/views/progress.js +11 -8
  97. data/frameworks/sproutcore/frameworks/desktop/views/radio.js +7 -7
  98. data/frameworks/sproutcore/frameworks/desktop/views/scroll.js +99 -33
  99. data/frameworks/sproutcore/frameworks/desktop/views/scroller.js +3 -7
  100. data/frameworks/sproutcore/frameworks/desktop/views/segmented.js +0 -7
  101. data/frameworks/sproutcore/frameworks/desktop/views/separator.js +2 -3
  102. data/frameworks/sproutcore/frameworks/desktop/views/slider.js +0 -8
  103. data/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +1 -1
  104. data/frameworks/sproutcore/frameworks/desktop/views/split.js +27 -7
  105. data/frameworks/sproutcore/frameworks/desktop/views/tab.js +2 -6
  106. data/frameworks/sproutcore/frameworks/foundation/controllers/array.js +15 -10
  107. data/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +20 -1
  108. data/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +1 -1
  109. data/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +3 -6
  110. data/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +3 -0
  111. data/frameworks/sproutcore/frameworks/foundation/english.lproj/core.css +8 -0
  112. data/frameworks/sproutcore/frameworks/foundation/english.lproj/inline_editor.css +12 -0
  113. data/frameworks/sproutcore/frameworks/foundation/english.lproj/label.css +11 -0
  114. data/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +13 -0
  115. data/frameworks/sproutcore/frameworks/foundation/mixins/button.js +1 -2
  116. data/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +70 -21
  117. data/frameworks/sproutcore/frameworks/foundation/mixins/selection_support.js +88 -54
  118. data/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +0 -25
  119. data/frameworks/sproutcore/frameworks/foundation/mixins/string.js +23 -2
  120. data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +34 -23
  121. data/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +20 -0
  122. data/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +32 -23
  123. data/frameworks/sproutcore/frameworks/foundation/system/browser.js +2 -2
  124. data/frameworks/sproutcore/frameworks/foundation/system/bundle.js +77 -15
  125. data/frameworks/sproutcore/frameworks/foundation/system/core_query.js +5 -4
  126. data/frameworks/sproutcore/frameworks/foundation/system/cursor.js +1 -1
  127. data/frameworks/sproutcore/frameworks/foundation/system/render_context.js +22 -7
  128. data/frameworks/sproutcore/frameworks/foundation/system/request.js +466 -309
  129. data/frameworks/sproutcore/frameworks/foundation/system/responder.js +2 -1
  130. data/frameworks/sproutcore/frameworks/foundation/system/response.js +457 -0
  131. data/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +66 -15
  132. data/frameworks/sproutcore/frameworks/foundation/system/routes.js +4 -4
  133. data/frameworks/sproutcore/frameworks/foundation/system/timer.js +6 -4
  134. data/frameworks/sproutcore/frameworks/foundation/system/utils.js +46 -8
  135. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/array_case.js +17 -0
  136. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/enum_case.js +18 -5
  137. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/null_case.js +1 -1
  138. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +0 -2
  139. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js +11 -0
  140. data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/group_case.js +14 -14
  141. data/frameworks/sproutcore/frameworks/foundation/tests/system/builder.js +2 -2
  142. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_core.js +15 -3
  143. data/frameworks/sproutcore/frameworks/foundation/tests/system/datetime.js +1 -1
  144. data/frameworks/sproutcore/frameworks/foundation/tests/system/locale.js +8 -7
  145. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/tag.js +3 -2
  146. data/frameworks/sproutcore/frameworks/foundation/tests/system/request.js +51 -44
  147. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/targetForAction.js +2 -2
  148. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/isPaused.js +4 -4
  149. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/performAction.js +2 -0
  150. data/frameworks/sproutcore/frameworks/foundation/tests/validators/credit_card.js +9 -9
  151. data/frameworks/sproutcore/frameworks/foundation/tests/validators/number.js +2 -2
  152. data/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +3 -3
  153. data/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +10 -3
  154. data/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +2 -2
  155. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/append_remove.js +14 -0
  156. data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +5 -5
  157. data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +1 -11
  158. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/clippingFrame.js +2 -2
  159. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/destroyLayer.js +2 -4
  160. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/findLayerInParentLayer.js +2 -4
  161. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/insertBefore.js +1 -1
  162. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutStyle.js +0 -2
  163. data/frameworks/sproutcore/frameworks/foundation/validators/password.js +5 -5
  164. data/frameworks/sproutcore/frameworks/foundation/validators/validator.js +4 -2
  165. data/frameworks/sproutcore/frameworks/foundation/views/field.js +5 -8
  166. data/frameworks/sproutcore/frameworks/foundation/views/label.js +21 -5
  167. data/frameworks/sproutcore/frameworks/foundation/views/text_field.js +112 -69
  168. data/frameworks/sproutcore/frameworks/foundation/views/view.js +67 -6
  169. data/frameworks/sproutcore/frameworks/runtime/core.js +51 -2
  170. data/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +4 -1
  171. data/frameworks/sproutcore/frameworks/runtime/system/binding.js +2 -1
  172. data/frameworks/sproutcore/frameworks/runtime/system/enumerator.js +5 -4
  173. data/frameworks/sproutcore/frameworks/runtime/system/index_set.js +6 -1
  174. data/frameworks/sproutcore/frameworks/runtime/system/logger.js +408 -0
  175. data/frameworks/sproutcore/frameworks/runtime/system/object.js +15 -4
  176. data/frameworks/sproutcore/frameworks/runtime/system/selection_set.js +30 -2
  177. data/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js +5 -1
  178. data/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js +1 -1
  179. data/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js +3 -3
  180. data/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +2 -0
  181. data/frameworks/sproutcore/frameworks/runtime/tests/core/isArray.js +1 -1
  182. data/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +2 -1
  183. data/frameworks/sproutcore/frameworks/runtime/tests/core/tupleForPropertyPath.js +2 -2
  184. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +1 -1
  185. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +1 -0
  186. data/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +11 -7
  187. data/frameworks/sproutcore/frameworks/runtime/tests/system/error.js +3 -2
  188. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +18 -1
  189. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/remove.js +1 -1
  190. data/frameworks/sproutcore/frameworks/runtime/tests/system/logger.js +165 -0
  191. data/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +3 -0
  192. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/copy.js +1 -1
  193. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/indexSetForSource.js +13 -0
  194. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/remove.js +24 -0
  195. data/frameworks/sproutcore/frameworks/runtime/tests/system/sparse_array.js +32 -13
  196. data/frameworks/sproutcore/frameworks/testing/english.lproj/runner.css +2 -2
  197. data/frameworks/sproutcore/frameworks/testing/english.lproj/testsuite.css +7 -2
  198. data/frameworks/sproutcore/lib/index.rhtml +6 -20
  199. data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x.psd +0 -0
  200. data/frameworks/sproutcore/themes/standard_theme/english.lproj/button.css +0 -1
  201. data/frameworks/sproutcore/themes/standard_theme/english.lproj/checkbox.css +5 -4
  202. data/frameworks/sproutcore/themes/standard_theme/english.lproj/collection.css +4 -3
  203. data/frameworks/sproutcore/themes/standard_theme/english.lproj/disclosure.css +7 -7
  204. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-repeat-x.png +0 -0
  205. data/frameworks/sproutcore/themes/standard_theme/english.lproj/list_item.css +38 -0
  206. data/frameworks/sproutcore/themes/standard_theme/english.lproj/menu.css +20 -0
  207. data/frameworks/sproutcore/themes/standard_theme/english.lproj/progress.css +1 -0
  208. data/frameworks/sproutcore/themes/standard_theme/english.lproj/radio.css +3 -1
  209. data/frameworks/sproutcore/themes/standard_theme/english.lproj/segmented.css +1 -0
  210. data/frameworks/sproutcore/themes/standard_theme/english.lproj/split_view.css +1 -1
  211. data/frameworks/sproutcore/themes/standard_theme/english.lproj/text_field.css +0 -15
  212. data/gen/data-source/Buildfile +18 -0
  213. data/gen/data-source/README +1 -0
  214. data/gen/data-source/USAGE +15 -0
  215. data/gen/data-source/templates/data_sources/@filename@.js +64 -0
  216. data/lib/sproutcore/builders/combine.rb +23 -0
  217. data/lib/sproutcore/builders/javascript.rb +27 -2
  218. data/lib/sproutcore/buildfile/task.rb +1 -1
  219. data/lib/sproutcore/helpers/entry_sorter.rb +2 -2
  220. data/lib/sproutcore/helpers/static_helper.rb +79 -0
  221. data/lib/sproutcore/models/manifest.rb +2 -2
  222. data/lib/sproutcore/models/target.rb +1 -1
  223. data/lib/sproutcore/tools/build.rb +1 -1
  224. data/lib/sproutcore/tools/docs.rb +3 -3
  225. data/lib/sproutcore/tools/gen.rb +17 -15
  226. data/lib/sproutcore/tools/manifest.rb +9 -9
  227. data/lib/sproutcore/tools/server.rb +3 -3
  228. data/lib/sproutcore/tools.rb +259 -250
  229. data/lib/sproutcore.rb +9 -1
  230. data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +2 -2
  231. data/spec/fixtures/entry_for_project/frameworks/unrelated/PLACEHOLDER +0 -0
  232. data/spec/fixtures/ordered_entries/apps/no_requires/{lproj → english.lproj}/strings.js +0 -0
  233. data/spec/fixtures/ordered_entries/apps/no_requires/main.js +1 -0
  234. data/spec/fixtures/ordered_entries/apps/no_requires/resources/main_page.js +1 -0
  235. data/spec/fixtures/ordered_entries/apps/no_requires/t.js +1 -0
  236. data/spec/lib/models/manifest/find_entry.rb +12 -0
  237. data/spec/lib/tools/gen_spec.rb +1 -0
  238. data/spec/lib/tools/tools_spec.rb +1 -0
  239. data/sproutcore-abbot.gemspec +36 -44
  240. metadata +43 -44
  241. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/indicator.gif +0 -0
  242. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sc-theme-sprite.png +0 -0
  243. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sticky-note.png +0 -0
  244. data/frameworks/sproutcore/frameworks/desktop/views/form.js +0 -594
  245. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-sprite.png +0 -0
  246. data/lib/thor/CHANGELOG.rdoc +0 -52
  247. data/lib/thor/LICENSE +0 -20
  248. data/lib/thor/README.markdown +0 -76
  249. data/lib/thor/Rakefile +0 -6
  250. data/lib/thor/Thorfile +0 -45
  251. data/lib/thor/bin/rake2thor +0 -83
  252. data/lib/thor/bin/thor +0 -7
  253. data/lib/thor/lib/thor/error.rb +0 -3
  254. data/lib/thor/lib/thor/options.rb +0 -267
  255. data/lib/thor/lib/thor/ordered_hash.rb +0 -64
  256. data/lib/thor/lib/thor/runner.rb +0 -305
  257. data/lib/thor/lib/thor/task.rb +0 -83
  258. data/lib/thor/lib/thor/task_hash.rb +0 -22
  259. data/lib/thor/lib/thor/tasks/package.rb +0 -18
  260. data/lib/thor/lib/thor/tasks.rb +0 -77
  261. data/lib/thor/lib/thor/util.rb +0 -75
  262. data/lib/thor/lib/thor.rb +0 -170
  263. data/lib/thor/script/destroy +0 -14
  264. data/lib/thor/script/generate +0 -14
  265. data/lib/thor/spec/fixtures/task.thor +0 -10
  266. data/lib/thor/spec/options_spec.rb +0 -271
  267. data/lib/thor/spec/ordered_hash_spec.rb +0 -84
  268. data/lib/thor/spec/spec.opts +0 -1
  269. data/lib/thor/spec/spec_helper.rb +0 -30
  270. data/lib/thor/spec/task_spec.rb +0 -11
  271. data/lib/thor/spec/tasks_spec.rb +0 -28
  272. data/lib/thor/spec/thor_runner_spec.rb +0 -194
  273. data/lib/thor/spec/thor_spec.rb +0 -206
  274. data/lib/thor/spec/util_spec.rb +0 -99
  275. data/lib/thor/task.thor +0 -15
  276. data/lib/thor/thor.gemspec +0 -29
@@ -12,7 +12,7 @@
12
12
  }
13
13
 
14
14
  .sc-theme .sc-split-view.vertical > .sc-split-divider-view {
15
- background: static_url('images/sc-theme-sprite.png') repeat-x 0px -1397px;
15
+ background: static_url('images/sc-theme-repeat-x.png') repeat-x 0px -1397px;
16
16
  /* border-top: 1px #888 solid;
17
17
  border-bottom: 1px #888 solid;
18
18
  */ z-index: 5;
@@ -2,19 +2,4 @@
2
2
 
3
3
  /* SC.TextFieldView - sc-theme */
4
4
 
5
- .sc-text-field-view input {
6
- border: none;
7
- outline: none;
8
- }
9
-
10
- .sc-text-field-view textarea {
11
- border: none;
12
- outline: none;
13
- }
14
-
15
- .sc-theme .sc-text-field-view .sc-hint {
16
- color: #aaa ;
17
- font-size: 12px;
18
- }
19
-
20
5
 
@@ -0,0 +1,18 @@
1
+ # ==========================================================================
2
+ # Generator: DataSource
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 "_data_source", 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(/_data_source$/,'')
16
+ end
17
+
18
+ end
@@ -0,0 +1 @@
1
+ Your data source is ready to use! Fill in the missing methods in the new file.
@@ -0,0 +1,15 @@
1
+ data-source - Create a new DataSource class in your SproutCore app.
2
+
3
+ USAGE:
4
+
5
+ sc-gen data-source AppName.DataSourceName [--filename=FILENAME] [--target=TARGET_NAME]
6
+
7
+ DISCUSSION:
8
+
9
+ This generator will create a new SproutCore DataSource template file in your
10
+ app. You should pass as the first parameter your AppName.DataSourceName combination you want to create. For example:
11
+
12
+ sc-gen data-source Todos.TasksDataSource
13
+
14
+ defines a new class called Todos.TasksDataSource in the file apps/todos/data_sources/task.js.
15
+
@@ -0,0 +1,64 @@
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 Data Source Here)
10
+
11
+ @extends <%= base_class_name || 'SC.DataSource' %>
12
+ */
13
+ <%= namespace_class_name %> = <%= base_class_name || 'SC.DataSource' %>.create(
14
+ /** @scope <%= namespace_class_name %>.prototype */ {
15
+
16
+ // ..........................................................
17
+ // QUERY SUPPORT
18
+ //
19
+
20
+ fetch: function(store, query) {
21
+
22
+ // TODO: Add handlers to fetch data for specific queries.
23
+ // call store.dataSourceDidFetchQuery(query) when done.
24
+
25
+ return NO ; // return YES if you handled the query
26
+ },
27
+
28
+ // ..........................................................
29
+ // RECORD SUPPORT
30
+ //
31
+
32
+ retrieveRecord: function(store, storeKey) {
33
+
34
+ // TODO: Add handlers to retrieve an individual record's contents
35
+ // call store.dataSourceDidComplete(storeKey) when done.
36
+
37
+ return NO ; // return YES if you handled the storeKey
38
+ },
39
+
40
+ createRecord: function(store, storeKey) {
41
+
42
+ // TODO: Add handlers to submit new records to the data source.
43
+ // call store.dataSourceDidComplete(storeKey) when done.
44
+
45
+ return NO ; // return YES if you handled the storeKey
46
+ },
47
+
48
+ updateRecord: function(store, storeKey) {
49
+
50
+ // TODO: Add handlers to submit modified record to the data source
51
+ // call store.dataSourceDidComplete(storeKey) when done.
52
+
53
+ return NO ; // return YES if you handled the storeKey
54
+ },
55
+
56
+ destroyRecord: function(store, storeKey) {
57
+
58
+ // TODO: Add handlers to destroy records on the data source.
59
+ // call store.dataSourceDidDestroy(storeKey) when done
60
+
61
+ return NO ; // return YES if you handled the storeKey
62
+ }
63
+
64
+ }) ;
@@ -21,6 +21,21 @@ module SC
21
21
  lines = []
22
22
  entries = entry.ordered_entries || entry.source_entries
23
23
 
24
+ target_name = entry.target.target_name.to_s.sub(/^\//,'')
25
+ if entry.top_level_lazy_instantiation && entry.combined
26
+ lines << ";
27
+ if ((typeof SC !== 'undefined') && SC && !SC.LAZY_INSTANTIATION) {
28
+ SC.LAZY_INSTANTIATION = {};
29
+ }
30
+ if(!SC.LAZY_INSTANTIATION['#{target_name}']) {
31
+ SC.LAZY_INSTANTIATION['#{target_name}'] = [];
32
+ }
33
+ SC.LAZY_INSTANTIATION['#{target_name}'].push(
34
+ (
35
+ function() {
36
+ "
37
+ end
38
+
24
39
  entries.each do |entry|
25
40
  src_path = entry.stage!.staging_path
26
41
  next unless File.exist?(src_path)
@@ -29,6 +44,14 @@ module SC
29
44
  lines += readlines(src_path)
30
45
  lines << "\n"
31
46
  end
47
+
48
+ if entry.top_level_lazy_instantiation && entry.combined
49
+ lines << "
50
+ }
51
+ )
52
+ );
53
+ "
54
+ end
32
55
  writelines dst_path, lines
33
56
  end
34
57
 
@@ -17,13 +17,38 @@ module SC
17
17
  class Builder::JavaScript < Builder::Base
18
18
 
19
19
  def build(dst_path)
20
- lines = readlines(entry.source_path).map { |l| rewrite_inline_code(l) }
20
+ lines = []
21
+ target_name = entry.target.target_name.to_s.sub(/^\//,'')
22
+
23
+ if entry.lazy_instantiation && entry.notify_onload
24
+ lines << ";
25
+ if ((typeof SC !== 'undefined') && SC && !SC.LAZY_INSTANTIATION) {
26
+ SC.LAZY_INSTANTIATION = {};
27
+ }
28
+ if(!SC.LAZY_INSTANTIATION['#{target_name}']) {
29
+ SC.LAZY_INSTANTIATION['#{target_name}'] = [];
30
+ }
31
+ SC.LAZY_INSTANTIATION['#{target_name}'].push(
32
+ (
33
+ function() {
34
+ "
35
+ end
36
+
37
+ lines << readlines(entry.source_path).map { |l| rewrite_inline_code(l) }
21
38
 
22
39
  # Try to load dependencies if we're not combining javascript.
23
40
  if entry.notify_onload
24
- lines << "; if ((typeof SC !== 'undefined') && SC && SC.scriptDidLoad) SC.scriptDidLoad('#{entry.target.target_name.to_s.sub(/^\//,'')}');"
41
+ lines << "; if ((typeof SC !== 'undefined') && SC && SC.scriptDidLoad) SC.scriptDidLoad('#{target_name}');"
25
42
  end
26
43
 
44
+ if entry.lazy_instantiation && entry.notify_onload
45
+ lines << "
46
+ }
47
+ )
48
+ );
49
+ "
50
+ end
51
+
27
52
  writelines dst_path, lines
28
53
  end
29
54
 
@@ -69,7 +69,7 @@ module SC
69
69
  app = application if app.nil?
70
70
  sibling = self.class.new(name, app)
71
71
  self.instance_variables.each do |key|
72
- next if IGNORE.include?(key)
72
+ next if IGNORE.include?(key.to_s) # instance_variables is an array of symbols in Ruby 1.9
73
73
  sibling.instance_variable_set(key, self.instance_variable_get(key))
74
74
  end
75
75
  sibling.taint if tainted?
@@ -52,10 +52,10 @@ module SC
52
52
  b = (b.filename || '').to_s.downcase
53
53
 
54
54
  # lproj/foo_page.js and main.js are loaded last
55
- a_kind = (a =~ /lproj\/.+_page\.js$/) ? 1 : -1
55
+ a_kind = (a =~ /(lproj|resources)\/.+_page\.js$/) ? 1 : -1
56
56
  a_kind = 2 if a =~ /main.js$/
57
57
 
58
- b_kind = (b =~ /lproj\/.+_page\.js$/) ? 1 : -1
58
+ b_kind = (b =~ /(lproj|resources)\/.+_page\.js$/) ? 1 : -1
59
59
  b_kind = 2 if b =~ /main.js$/
60
60
 
61
61
  if a_kind != b_kind
@@ -115,6 +115,85 @@ module SC
115
115
  urls.join("\n")
116
116
  end
117
117
 
118
+ # Detects and includes any bootstrap code
119
+ #
120
+ def bootstrap
121
+
122
+ ret = []
123
+
124
+ # Reference any external bootstrap scripts
125
+ if (resources_names = target.config.bootstrap)
126
+ Array(resources_names).each do |resource_name|
127
+ ret << %(<script src="#{sc_static(resource_name)}" type="text/javascript" ></script>)
128
+ end
129
+ end
130
+
131
+ # Reference any inlined bootstrap scripts
132
+ if (resources_names = target.config.bootstrap_inline)
133
+ Array(resources_names).each do |resource_name|
134
+ ret << inline_javascript(resource_name)
135
+ end
136
+ end
137
+
138
+ return ret * "\n"
139
+ end
140
+
141
+ # Attempts to include the named javascript entry inline to the file
142
+ #
143
+ # === Options
144
+ # language:: the language to use. defaults to current
145
+ #
146
+ def inline_javascript(resource_name, opts ={})
147
+
148
+ resource_name = resource_name.to_s
149
+
150
+ # determine which manifest to search. if a language is explicitly
151
+ # specified, lookup manifest for that language. otherwise use
152
+ # current manifest.
153
+ m = self.manifest
154
+ if opts[:language]
155
+ m = target.manifest_for(:language => opts[:language]).build!
156
+ end
157
+
158
+ entry = m.find_entry(resource_name, :entry_type => :javascript)
159
+ if entry.nil?
160
+ entry = m.find_entry(resource_name, :hidden => true, :entry_type => :javascript)
161
+ end
162
+
163
+ return '' if entry.nil?
164
+
165
+ ret = File.readlines(entry.build!.build_path)*''
166
+ return %(<script type="text/javascript">\n#{ret}\n</script>)
167
+ end
168
+
169
+ # Attempts to include the named javascript entry inline to the file
170
+ #
171
+ # === Options
172
+ # language:: the language to use. defaults to current
173
+ #
174
+ def inline_stylesheet(resource_name, opts ={})
175
+
176
+ resource_name = resource_name.to_s
177
+
178
+ # determine which manifest to search. if a language is explicitly
179
+ # specified, lookup manifest for that language. otherwise use
180
+ # current manifest.
181
+ m = self.manifest
182
+ if opts[:language]
183
+ m = target.manifest_for(:language => opts[:language]).build!
184
+ end
185
+
186
+ entry = m.find_entry(resource_name, :entry_type => :stylesheet)
187
+ if entry.nil?
188
+ entry = m.find_entry(resource_name, :hidden => true, :entry_type => :stylesheet)
189
+ end
190
+
191
+ return '' if entry.nil?
192
+
193
+ ret = File.readlines(entry.build!.build_path)
194
+ return %(<style>\n#{ret*"\n"}\n</style>)
195
+ end
196
+
118
197
  # Attempts to render the named entry as a partial
119
198
  #
120
199
  # === Options
@@ -350,7 +350,7 @@ module SC
350
350
  def unique_staging_path(path)
351
351
  paths = entries(:hidden => true).map { |e| e.staging_path }
352
352
  while paths.include?(path)
353
- path = path.sub(/(__\$[0-9]+)?(\.\w+)?$/,"__$#{next_staging_uuid}\\2")
353
+ path = path.sub(/(__\$[0-9]+)?(\.\w+)?$/,"__#{next_staging_uuid}\\2")
354
354
  end
355
355
  return path
356
356
  end
@@ -360,7 +360,7 @@ module SC
360
360
  def unique_cache_path(path)
361
361
  paths = entries(:hidden => true).map { |e| e.cache_path }
362
362
  while paths.include?(path)
363
- path = path.sub(/(__\$[0-9]+)?(\.\w+)?$/,"__$#{next_staging_uuid}\\2")
363
+ path = path.sub(/(__\$[0-9]+)?(\.\w+)?$/,"__#{next_staging_uuid}\\2")
364
364
  end
365
365
  return path
366
366
  end
@@ -315,7 +315,7 @@ module SC
315
315
 
316
316
  # Otherwise, actually compute a build number.
317
317
  if build_number.nil?
318
- require 'digest/md5'
318
+ require 'digest/sha1'
319
319
 
320
320
  # Computes the build number based on the contents of the
321
321
  # files. It is not as fast as using an mtime, but it will remain
@@ -12,7 +12,7 @@ module SC
12
12
 
13
13
  desc "build [TARGET..]", "Builds one or more targets"
14
14
  method_options(
15
- MANIFEST_OPTIONS.merge(:entries => :optional, :clean => false))
15
+ MANIFEST_OPTIONS.merge(:entries => :string, :clean => false))
16
16
 
17
17
  def build(*targets)
18
18
 
@@ -12,10 +12,10 @@ module SC
12
12
  class Tools
13
13
 
14
14
  desc "sc-docs [TARGET..]", "Generates JSDoc's for specified targets."
15
- method_options(:entries => :optional,
15
+ method_options(:entries => :string,
16
16
  :clean => true,
17
- :language => :optional,
18
- :template => :optional,
17
+ :language => :string,
18
+ :template => :string,
19
19
  ['--include-required', '-r'] => false)
20
20
  def docs(*targets)
21
21
 
@@ -28,30 +28,32 @@ module SC
28
28
  #
29
29
  class Tools
30
30
 
31
- def show_help(generator_name=nil, generator=nil)
32
- if generator_name
33
- if generator.nil?
34
- warn("There is no #{generator_name} generator")
31
+ no_tasks do
32
+ def show_help(generator_name=nil, generator=nil)
33
+ if generator_name
34
+ if generator.nil?
35
+ warn("There is no #{generator_name} generator")
36
+ else
37
+ generator.log_usage
38
+ end
35
39
  else
36
- generator.log_usage
40
+ SC.logger << "Available generators:\n"
41
+ SC::Generator.installed_generators_for(project).each do |name|
42
+ SC.logger << " #{name}\n"
43
+ end
44
+ SC.logger << "Type sc-gen GENERATOR --help for specific usage\n\n"
37
45
  end
38
- else
39
- SC.logger << "Available generators:\n"
40
- SC::Generator.installed_generators_for(project).each do |name|
41
- SC.logger << " #{name}\n"
42
- end
43
- SC.logger << "Type sc-gen GENERATOR --help for specific usage\n\n"
46
+ return 0
44
47
  end
45
- return 0
46
48
  end
47
49
 
48
50
  desc "sc-gen generator Namespace[.ClassName] [--target=TARGET_NAME] [--filename=FILE_NAME]",
49
51
  "Generates SproutCore components"
50
52
 
51
53
  method_options(
52
- MANIFEST_OPTIONS.merge(:help => :optional,
53
- :filename => :optional,
54
- :target => :optional,
54
+ MANIFEST_OPTIONS.merge(:help => :string,
55
+ :filename => :string,
56
+ :target => :string,
55
57
  '--dry-run' => false,
56
58
  :force => false))
57
59
 
@@ -9,21 +9,21 @@ module SC
9
9
  class Tools
10
10
 
11
11
  # Standard manifest options. Used by build tool as well.
12
- MANIFEST_OPTIONS = { :languages => :optional,
12
+ MANIFEST_OPTIONS = { :languages => :string,
13
13
  :symlink => false,
14
- :buildroot => :optional,
15
- :stageroot => :optional,
16
- :format => :optional,
17
- :output => :output,
14
+ :buildroot => :string,
15
+ :stageroot => :string,
16
+ :format => :string,
17
+ :output => :string,
18
18
  :all => false,
19
- ['--build-numbers', '-B'] => :optional,
19
+ ['--build-numbers', '-B'] => :string,
20
20
  ['--include-required', '-r'] => false }
21
21
 
22
22
  desc "manifest [TARGET..]", "Generates a manifest for the specified targets"
23
23
  method_options(MANIFEST_OPTIONS.merge(
24
- :format => :optional,
25
- :only => :optional,
26
- :except => :optional,
24
+ :format => :string,
25
+ :only => :string,
26
+ :except => :string,
27
27
  :hidden => false ))
28
28
  def manifest(*targets)
29
29
 
@@ -11,9 +11,9 @@ module SC
11
11
 
12
12
  desc "server", "Starts the development server"
13
13
  method_options :daemonize => false,
14
- :pid => :optional,
15
- :port => :optional,
16
- :host => :optional,
14
+ :pid => :string,
15
+ :port => :string,
16
+ :host => :string,
17
17
  :irb => false,
18
18
  :filesystem => false
19
19
  def server