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
@@ -5,7 +5,7 @@
5
5
  # and contributors
6
6
  # ===========================================================================
7
7
 
8
- require File.expand_path(File.join(SC::LIBPATH, 'thor', 'lib', 'thor'))
8
+ require 'thor'
9
9
 
10
10
  module SC
11
11
 
@@ -25,314 +25,323 @@ module SC
25
25
  #
26
26
  class Tools < ::Thor
27
27
 
28
- ################################################
29
- ## EXCEPTIONS
30
- ##
31
-
32
- # Raise this type of exception when a fatal error occurs because the
33
- # user did not pass the correct options. This will be caught and
34
- # displayed at the top level before exiting. Note that if you raise
35
- # an exception of some other type, then a backtrace may be displayed as
36
- # well (Which is not preferred)
37
- class FatalException < Exception
38
- end
39
-
40
- # Helper method. Call this when an acception occurs that is fatal due to
41
- # a problem with the user.
42
- def fatal!(description)
43
- raise FatalException, description
44
- end
45
-
46
- # Helper method. Call this when you want to log an info message. Logs to
47
- # the standard logger.
48
- def info(description)
49
- SC.logger.info(description)
28
+ def self.invoke(task_name)
29
+ start([task_name.to_s] + ARGV)
50
30
  end
51
-
52
- # Helper method. Call this when you want to log a debug message.
53
- def debug(description)
54
- SC.logger.debug(description)
55
- end
56
-
57
- # Log this when you need to issue a warning.
58
- def warn(description)
59
- SC.logger.warn(description)
60
- end
61
-
62
-
63
- ################################################
64
- ## GLOBAL OPTIONS
65
- ##
31
+
66
32
 
67
33
  # All sproutcore tools can take some standard options. These are
68
34
  # processed automatically when the tool is loaded
69
- method_options({ '--project' => :optional,
70
- '--library' => :optional, # deprecated
71
- '--mode' => :optional,
72
- '--environment' => :optional, # deprecated
73
- '--logfile' => :optional,
74
- '--build' => :optional,
35
+ method_options({ '--project' => :string,
36
+ '--library' => :string, # deprecated
37
+ '--mode' => :string,
38
+ '--environment' => :string, # deprecated
39
+ '--logfile' => :string,
40
+ '--build' => :string,
75
41
  ['--verbose', '-v'] => false,
76
42
  ['--very-verbose', '-V'] => false })
77
43
  def initialize(options, *args)
78
44
  super
79
45
  end
46
+
47
+ no_tasks do
48
+
49
+ ################################################
50
+ ## EXCEPTIONS
51
+ ##
80
52
 
81
- # This is the core entry method used to run every tool. Extend this
82
- # method with any standard preprocessing you want all tools to do before
83
- # they do their specific thing.
84
- def invoke(*args)
85
- prepare_logger!
86
- prepare_mode!
87
- prepare_build_numbers!
88
- super
89
- end
53
+ # Raise this type of exception when a fatal error occurs because the
54
+ # user did not pass the correct options. This will be caught and
55
+ # displayed at the top level before exiting. Note that if you raise
56
+ # an exception of some other type, then a backtrace may be displayed as
57
+ # well (Which is not preferred)
58
+ class FatalException < Exception
59
+ end
60
+
61
+ # Helper method. Call this when an acception occurs that is fatal due
62
+ # to a problem with the user.
63
+ def fatal!(description)
64
+ raise FatalException, description
65
+ end
66
+
67
+ # Helper method. Call this when you want to log an info message. Logs
68
+ # to the standard logger.
69
+ def info(description)
70
+ SC.logger.info(description)
71
+ end
72
+
73
+ # Helper method. Call this when you want to log a debug message.
74
+ def debug(description)
75
+ SC.logger.debug(description)
76
+ end
77
+
78
+ # Log this when you need to issue a warning.
79
+ def warn(description)
80
+ SC.logger.warn(description)
81
+ end
82
+
83
+ ################################################
84
+ ## GLOBAL OPTIONS
85
+ ##
86
+
87
+ # This is the core entry method used to run every tool. Extend this
88
+ # method with any standard preprocessing you want all tools to do before
89
+ # they do their specific thing.
90
+ def invoke(*args)
91
+ prepare_logger!
92
+ prepare_mode!
93
+ prepare_build_numbers!
94
+ super
95
+ end
90
96
 
91
- # Make the options hash a HashStruct so that we can access each variable
92
- # as a method
93
- def options; @tool_options ||= HashStruct.new(super); end
97
+ # Make the options hash a HashStruct so that we can access each variable
98
+ # as a method
99
+ def options; @tool_options ||= HashStruct.new(super); end
94
100
 
95
- # Configure the expected log level and log target. Handles the --verbose,
96
- # --very-verbose and --logfile options
97
- def prepare_logger!
98
- SC.env.log_level = options['very-verbose'] ? :debug : (options.verbose ? :info : :warn)
99
- SC.env.logfile = File.expand_path(options.logfile) if options.logfile
100
- end
101
+ # Configure the expected log level and log target. Handles the
102
+ # --verbose, --very-verbose and --logfile options
103
+ def prepare_logger!
104
+ SC.env.log_level = options['very-verbose'] ? :debug : (options.verbose ? :info : :warn)
105
+ SC.env.logfile = File.expand_path(options.logfile) if options.logfile
106
+ end
101
107
 
102
- # Configure the current build mode. Handles the --mode and --environment
103
- # options. (--environment is provided for backwards compatibility)
104
- def prepare_mode!(preferred_mode = 'production')
105
- build_mode = (options.mode || options.environment || preferred_mode).to_s.downcase.to_sym
106
- SC.build_mode = build_mode
107
- end
108
+ # Configure the current build mode. Handles the --mode and
109
+ # --environment options. (--environment is provided for backwards
110
+ # compatibility)
111
+ def prepare_mode!(preferred_mode = 'production')
112
+ build_mode = (options.mode || options.environment || preferred_mode).to_s.downcase.to_sym
113
+ SC.build_mode = build_mode
114
+ end
108
115
 
109
- # Configure the current build numbers. Handles the --build option.
110
- def prepare_build_numbers!
111
- return if (numbers = options.build).nil?
112
- numbers = numbers.split(',').map { |n| n.split(':') }
113
- if numbers.size==1 && numbers.first.size==1
114
- SC.env.build_number = numbers.first.first
115
- else
116
- hash = {}
117
- numbers.each do |pair|
118
- key = pair[0]
119
- key = "/#{key}" if !(key =~ /^\//)
120
- hash[key.to_sym] = pair[1]
116
+ # Configure the current build numbers. Handles the --build option.
117
+ def prepare_build_numbers!
118
+ return unless (numbers = options.build)
119
+ numbers = numbers.split(',').map { |n| n.split(':') }
120
+ if numbers.size==1 && numbers.first.size==1
121
+ SC.env.build_number = numbers.first.first
122
+ else
123
+ hash = {}
124
+ numbers.each do |pair|
125
+ key = pair[0]
126
+ key = "/#{key}" if !(key =~ /^\//)
127
+ hash[key.to_sym] = pair[1]
128
+ end
121
129
  end
122
130
  end
123
- end
124
131
 
125
- ################################################
126
- ## HELPER METHODS
127
- ##
132
+ ################################################
133
+ ## HELPER METHODS
134
+ ##
128
135
 
129
- # Set the current project. This is used mostly for unit testing.
130
- def project=(a_project)
131
- @project = a_project
132
- end
136
+ # Set the current project. This is used mostly for unit testing.
137
+ def project=(a_project)
138
+ @project = a_project
139
+ end
133
140
 
134
- # The current project. This is discovered based on the passed --project
135
- # option or based on the current working directory. If no project can be
136
- # found, this method will always return null.
137
- def project
138
- return @project if @discovered_project # cache - @project may be nil
139
- @discovered_project = true
141
+ # The current project. This is discovered based on the passed --project
142
+ # option or based on the current working directory. If no project can
143
+ # be found, this method will always return null.
144
+ def project
145
+ return @project if @discovered_project # cache - @project may be nil
146
+ @discovered_project = true
140
147
 
141
- ret = nil
142
- project_path = options.project || options.library
148
+ ret = nil
149
+ project_path = options.project || options.library
143
150
 
144
- # if no project_path is named explicitly, attempt to autodiscover from
145
- # working dir. If none is found, just set project to nil
146
- if project_path.nil?
147
- debug "No project path specified. Searching for projects in #{Dir.pwd}"
148
- ret = SC::Project.load_nearest_project Dir.pwd, :parent => SC.builtin_project
151
+ # if no project_path is named explicitly, attempt to autodiscover from
152
+ # working dir. If none is found, just set project to nil
153
+ unless project_path
154
+ debug "No project path specified. Searching for projects in #{Dir.pwd}"
155
+ ret = SC::Project.load_nearest_project Dir.pwd, :parent => SC.builtin_project
149
156
 
150
- # if project path is specified, look there. If no project is found
151
- # die with a fatal exception.
152
- else
153
- debug "Project path specified at #{project_path}"
154
- ret = SC::Project.load File.expand_path(project_path), :parent => SC.builtin_project
155
- if ret.nil?
156
- fatal! "Could not load project at #{project_path}"
157
+ # if project path is specified, look there. If no project is found
158
+ # die with a fatal exception.
159
+ else
160
+ debug "Project path specified at #{project_path}"
161
+ ret = SC::Project.load File.expand_path(project_path), :parent => SC.builtin_project
162
+ if ret.nil?
163
+ fatal! "Could not load project at #{project_path}"
164
+ end
157
165
  end
158
- end
159
166
 
160
- info "Loaded project at: #{ret.project_root}" unless ret.nil?
161
- @project = ret
162
- end
167
+ info "Loaded project at: #{ret.project_root}" unless ret.nil?
168
+ @project = ret
169
+ end
163
170
 
164
- # Attempts to discover the current project. If no project can be found
165
- # throws a fatal exception. Use this method at the top of your tool
166
- # method if you require a project to run.
167
- def requires_project!
168
- ret = project
169
- if ret.nil?
170
- fatal!("You do not appear to be inside of a project. Try changing to your project directory or make sure your project as a Buildfile or sc-config")
171
+ # Attempts to discover the current project. If no project can be found
172
+ # throws a fatal exception. Use this method at the top of your tool
173
+ # method if you require a project to run.
174
+ def requires_project!
175
+ ret = project
176
+ if ret.nil?
177
+ fatal!("You do not appear to be inside of a project. Try changing to your project directory or make sure your project as a Buildfile or sc-config")
178
+ end
179
+ return ret
171
180
  end
172
- return ret
173
- end
174
181
 
175
- # Find one or more targets with the passed target names in the current
176
- # project. Requires a project to function.
177
- def find_targets(*targets)
182
+ # Find one or more targets with the passed target names in the current
183
+ # project. Requires a project to function.
184
+ def find_targets(*targets)
178
185
 
179
- debug "finding targets with names: '#{targets * "','"}'"
180
- requires_project!
186
+ debug "finding targets with names: '#{targets * "','"}'"
187
+ requires_project!
181
188
 
182
- # Filter out any empty target names. Sometimes this happens when
183
- # processing arguments.
184
- targets.reject! { |x| x.nil? || x.size == 0 }
189
+ # Filter out any empty target names. Sometimes this happens when
190
+ # processing arguments.
191
+ targets.reject! { |x| x.nil? || x.size == 0 }
185
192
 
186
- # If targets are specified, find the targets project or parents...
187
- if targets.size > 0
188
- targets = targets.map do |target_name|
189
- begin
190
- ret = project.target_for(target_name)
191
- rescue Exception => e
192
- SC.logger.fatal("Exception when searching for target #{target_name}. Perhaps your Buildfile is configured wrong?")
193
- raise e
194
- end
193
+ # If targets are specified, find the targets project or parents...
194
+ if targets.size > 0
195
+ targets = targets.map do |target_name|
196
+ begin
197
+ ret = project.target_for(target_name)
198
+ rescue Exception => e
199
+ SC.logger.fatal("Exception when searching for target #{target_name}. Perhaps your Buildfile is configured wrong?")
200
+ raise e
201
+ end
195
202
 
196
- if ret.nil?
197
- fatal! "No target named #{target_name} could be found in PROJECT:#{project.project_root}"
198
- else
199
- debug "Found target '#{target_name}' at PROJECT:#{ret.source_root.sub(/^#{project.project_root}\//,'')}"
203
+ if ret.nil?
204
+ fatal! "No target named #{target_name} could be found in PROJECT:#{project.project_root}"
205
+ else
206
+ debug "Found target '#{target_name}' at PROJECT:#{ret.source_root.sub(/^#{project.project_root}\//,'')}"
207
+ end
208
+ ret
200
209
  end
201
- ret
202
- end
203
210
 
204
- # IF no targets are specified, then just get all targets in project.
205
- # If --all option was specified, include those that do not autobuild
206
- else
207
- targets = project.targets.values
208
- unless options.all?
209
- targets.reject! { |t| !t.config.autobuild? }
210
- end
211
- end
211
+ # IF no targets are specified, then just get all targets in project.
212
+ # If --all option was specified, include those that do not autobuild
213
+ else
214
+ targets = project.targets.values
215
+ unless options.all?
216
+ targets.reject! { |t| !t.config.autobuild? }
217
+ end
218
+ end
212
219
 
213
- # If include required was specified, merge in all required bundles as
214
- # well.
215
- if options['include-required']
216
- targets.each do |target|
217
- targets += target.expand_required_targets :theme => true,
218
- :debug => target.config.load_debug,
219
- :tests => target.config.load_tests
220
- end
220
+ # If include required was specified, merge in all required bundles as
221
+ # well.
222
+ if options['include-required']
223
+ targets.each do |target|
224
+ targets += target.expand_required_targets :theme => true,
225
+ :debug => target.config.load_debug,
226
+ :tests => target.config.load_tests
227
+ end
221
228
 
222
- targets = targets.flatten.uniq.compact
223
- end
229
+ targets = targets.flatten.uniq.compact
230
+ end
224
231
 
225
- return targets
226
- end
227
-
228
- # Wraps around find_targets but raises an exception if no target is
229
- # specified.
230
- def requires_targets!(*target_names)
231
- if target_names.size == 0
232
- fatal! "You must specify a target with this command"
232
+ return targets
233
233
  end
234
234
 
235
- targets = find_targets(*target_names)
236
- if targets.size == 0
237
- fatal! "No targets matching #{target_names * ","} were found."
238
- end
235
+ # Wraps around find_targets but raises an exception if no target is
236
+ # specified.
237
+ def requires_targets!(*target_names)
238
+ if target_names.size == 0
239
+ fatal! "You must specify a target with this command"
240
+ end
241
+
242
+ targets = find_targets(*target_names)
243
+ if targets.size == 0
244
+ fatal! "No targets matching #{target_names * ","} were found."
245
+ end
239
246
 
240
- targets
241
- end
247
+ targets
248
+ end
242
249
 
243
- # Requires exactly one target.
244
- def requires_target!(*targets)
245
- requires_targets!(*targets).first
246
- end
250
+ # Requires exactly one target.
251
+ def requires_target!(*targets)
252
+ requires_targets!(*targets).first
253
+ end
247
254
 
248
- # Discovers the languages requested by the user for a build. Uses the
249
- # --languages command line option or disovers in targets.
250
- def find_languages(*targets)
251
- # Use passed languages. If none are specified, merge installed
252
- # languages for all app targets.
253
- if (languages = options.languages).nil?
254
- languages = targets.map { |t| t.installed_languages }
255
- else
256
- languages = languages.split(',').map { |l| l.to_sym }
255
+ # Discovers the languages requested by the user for a build. Uses the
256
+ # --languages command line option or disovers in targets.
257
+ def find_languages(*targets)
258
+ # Use passed languages. If none are specified, merge installed
259
+ # languages for all app targets.
260
+ unless (languages = options.languages)
261
+ languages = targets.map { |t| t.installed_languages }
262
+ else
263
+ languages = languages.split(',').map { |l| l.to_sym }
264
+ end
265
+ languages.flatten.uniq.compact
257
266
  end
258
- languages.flatten.uniq.compact
259
- end
260
267
 
261
- # Discovers build numbers requested for the build and sets them in the
262
- # in the env if needed.
263
- def find_build_numbers(*targets)
264
- if options['build-numbers']
265
- numbers = {}
266
- options['build-numbers'].split(',').each do |pair|
267
- pair = pair.split(':')
268
- if pair.length < 2
269
- fatal! "Could not parse build numbers! #{options['build-numbers']}"
268
+ # Discovers build numbers requested for the build and sets them in the
269
+ # in the env if needed.
270
+ def find_build_numbers(*targets)
271
+ if options['build-numbers']
272
+ numbers = {}
273
+ options['build-numbers'].split(',').each do |pair|
274
+ pair = pair.split(':')
275
+ if pair.length < 2
276
+ fatal! "Could not parse build numbers! #{options['build-numbers']}"
277
+ end
278
+ numbers["/#{pair[0]}"] = pair[1]
270
279
  end
271
- numbers["/#{pair[0]}"] = pair[1]
280
+ SC.env.build_numbers = numbers
281
+ SC.logger.info "Using build numbers: #{numbers.map { |k,v| "#{k}: #{v}" }.join(',')}"
272
282
  end
273
- SC.env.build_numbers = numbers
274
- SC.logger.info "Using build numbers: #{numbers.map { |k,v| "#{k}: #{v}" }.join(',')}"
275
283
  end
276
- end
277
284
 
278
- # Core method to process command line options and then build a manifest.
279
- # Shared by sc-manifest, sc-build and sc-docs commands.
280
- def build_manifests(*targets)
285
+ # Core method to process command line options and then build a manifest.
286
+ # Shared by sc-manifest, sc-build and sc-docs commands.
287
+ def build_manifests(*targets)
281
288
 
282
- # setup build numbers
283
- find_build_numbers(*targets)
289
+ # setup build numbers
290
+ find_build_numbers(*targets)
284
291
 
285
- requires_project! # get project
286
- targets = find_targets(*targets) # get targets
287
- languages = find_languages(*targets) # get languages
292
+ requires_project! # get project
293
+ targets = find_targets(*targets) # get targets
294
+ languages = find_languages(*targets) # get languages
288
295
 
289
- # log output
290
- SC.logger.info "Building targets: #{targets.map { |t| t.target_name } * ","}"
291
- SC.logger.info "Building languages: #{ languages * "," }"
296
+ # log output
297
+ SC.logger.info "Building targets: #{targets.map { |t| t.target_name } * ","}"
298
+ SC.logger.info "Building languages: #{ languages * "," }"
292
299
 
293
- # Now fetch the manifests to build. One per target/language
294
- manifests = targets.map do |target|
295
- languages.map { |l| target.manifest_for :language => l }
296
- end
297
- manifests.flatten!
300
+ # Now fetch the manifests to build. One per target/language
301
+ manifests = targets.map do |target|
302
+ languages.map { |l| target.manifest_for :language => l }
303
+ end
304
+ manifests.flatten!
298
305
 
299
- # Build'em
300
- manifests.each do |manifest|
301
- SC.logger.info "Building manifest for: #{manifest.target.target_name}:#{manifest.language}"
302
- manifest.build!
303
- end
306
+ # Build'em
307
+ manifests.each do |manifest|
308
+ SC.logger.info "Building manifest for: #{manifest.target.target_name}:#{manifest.language}"
309
+ manifest.build!
310
+ end
304
311
 
305
- return manifests
306
- end
312
+ return manifests
313
+ end
307
314
 
308
- # Logs the contents of the passed file path to the logger
309
- def log_file(path)
310
- if !File.exists?(path)
311
- warn "Could not display #{File.basename(path)} at #{File.dirname(path)} because it does not exist."
315
+ # Logs the contents of the passed file path to the logger
316
+ def log_file(path)
317
+ if !File.exists?(path)
318
+ warn "Could not display #{File.basename(path)} at #{File.dirname(path)} because it does not exist."
319
+ end
320
+ file_text = File.read(path)
321
+ SC.logger << file_text
322
+ SC.logger << "\n"
312
323
  end
313
- file_text = File.read(path)
314
- SC.logger << file_text
315
- SC.logger << "\n"
316
- end
317
324
 
318
- ################################################
319
- ## MAIN ENTRYPOINT
320
- ##
325
+ ################################################
326
+ ## MAIN ENTRYPOINT
327
+ ##
321
328
 
322
- # Fix start so that it treats command-name like command_name
323
- def self.start(args = ARGV)
324
- # manually check for verbose in case we don't get far enough in regular
325
- # processing to actually set the verbose mode.
326
- is_verbose = %w(-v -V --verbose --very-verbose).any? { |x| args.include?(x) }
327
- begin
328
- super(args)
329
- rescue Exception => e
330
- SC.logger.fatal(e)
331
- if is_verbose && !e.kind_of?(FatalException)
332
- SC.logger.fatal("BACKTRACE:\n#{e.backtrace.join("\n")}\n")
329
+ # Fix start so that it treats command-name like command_name
330
+ def self.start(args = ARGV)
331
+ # manually check for verbose in case we don't get far enough in
332
+ # regular processing to actually set the verbose mode.
333
+ is_verbose = %w(-v -V --verbose --very-verbose).any? { |x| args.include?(x) }
334
+ begin
335
+ super(args)
336
+ rescue Exception => e
337
+ SC.logger.fatal(e)
338
+ if is_verbose && !e.kind_of?(FatalException)
339
+ SC.logger.fatal("BACKTRACE:\n#{e.backtrace.join("\n")}\n")
340
+ end
333
341
  end
334
342
  end
335
- end
343
+
344
+ end # no_tasks
336
345
 
337
346
  end
338
347
 
data/lib/sproutcore.rb CHANGED
@@ -9,17 +9,25 @@ require 'logger'
9
9
  require 'extlib'
10
10
  require 'yaml'
11
11
 
12
+ # Ruby 1.8 Compatibility
12
13
  if (RUBY_VERSION.match(/1\.8/))
13
14
  $KCODE = 'u'
14
15
  require 'jcode'
15
16
  class String ; def valid_encoding? ; true ; end ; end
16
17
  end
17
18
 
19
+ # Ruby 1.9 Compatibility
20
+ if (RUBY_VERSION.match(/1\.9/))
21
+ # Fix for Rack Ruby 1.9 incompatibility. This makes 404s render again.
22
+ class String
23
+ alias each each_line unless ''.respond_to?(:each)
24
+ end
25
+ end
26
+
18
27
  # Makes code more readable
19
28
  YES = true
20
29
  NO = false
21
30
 
22
-
23
31
  module SproutCore
24
32
 
25
33
  # :stopdoc:
@@ -180,7 +180,7 @@ describe "manifest:prepare_build_tasks:combine" do
180
180
  @project = fixture_project :ordered_entries
181
181
  end
182
182
 
183
- it "orders entries as lproj/strings -> core -> utils -> others alphabetically without requires" do
183
+ it "orders entries as lproj/strings -> core -> utils -> others alphabetically without requires -> resources/*_page.js -> main.js}" do
184
184
 
185
185
  @target = @project.target_for :no_requires
186
186
  @buildfile = @target.buildfile
@@ -193,7 +193,7 @@ describe "manifest:prepare_build_tasks:combine" do
193
193
 
194
194
  # get the expected set of ordered entries...based on contents of
195
195
  # project...
196
- expected = %w(bundle_info.js source/lproj/strings.js source/core.js source/utils.js source/1.js source/a.js source/a/a.js source/a/b.js source/B.js source/b/a.js source/c.js)
196
+ expected = %w(bundle_info.js source/lproj/strings.js source/core.js source/utils.js source/1.js source/a.js source/a/a.js source/a/b.js source/B.js source/b/a.js source/c.js source/t.js source/resources/main_page.js source/main.js)
197
197
 
198
198
  entry.ordered_entries.should_not be_nil
199
199
  filenames = entry.ordered_entries.map { |e| e.filename }