sproutcore 1.10.2 → 1.10.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG +11 -0
  3. data/VERSION.yml +1 -1
  4. data/lib/frameworks/sproutcore/CHANGELOG.md +34 -0
  5. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/horizontal_stack_layout.js +3 -1
  6. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/vertical_stack_layout.js +3 -1
  7. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +79 -80
  8. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +115 -22
  9. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +54 -17
  10. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/statechart.js +76 -34
  11. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select/methods.js +18 -5
  12. data/lib/frameworks/sproutcore/frameworks/desktop/views/grid.js +14 -5
  13. data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +42 -18
  14. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/editable.js +41 -41
  15. data/lib/frameworks/sproutcore/frameworks/foundation/tests/transitions/view_transitions_test.js +235 -0
  16. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/bounce_transition.js +8 -4
  17. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/fade_transition.js +6 -2
  18. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/pop_transition.js +8 -4
  19. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/scale_transition.js +6 -2
  20. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/slide_transition.js +6 -2
  21. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/spring_transition.js +8 -4
  22. data/lib/frameworks/sproutcore/frameworks/foundation/views/inline_text_field.js +5 -4
  23. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +1 -1
  24. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +2 -2
  25. data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +124 -80
  26. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +134 -0
  27. data/lib/sproutcore.rb +1 -1
  28. data/lib/sproutcore/models/manifest.rb +12 -6
  29. data/lib/sproutcore/rack/builder.rb +20 -12
  30. data/lib/sproutcore/tools.rb +3 -3
  31. data/lib/sproutcore/tools/build.rb +22 -22
  32. data/sproutcore.gemspec +2 -5
  33. data/vendor/sproutcore/lib/yuicompressor-2.4.8.jar +0 -0
  34. metadata +10 -23
  35. data/vendor/sproutcore/lib/yuicompressor-2.4.6.jar +0 -0
@@ -459,6 +459,73 @@ test("toObject.value should be NO if either source is NO", function () {
459
459
  equals(toObject.get('boundLocalValue'), NO, 'Local bound value on NO/YES');
460
460
  });
461
461
 
462
+ test("remote paths work when binding is defined on a class", function() {
463
+ // This tests the solution to a bug which was hooking all instances of a class's `and` binding
464
+ // up through the same internal object, which would be destroyed the first time any instance
465
+ // was destroyed.
466
+
467
+ var ToObject = SC.Object.extend({
468
+ value: null,
469
+ valueBinding: SC.Binding.and('SC.testControllerA.value', 'SC.testControllerB.value')
470
+ });
471
+
472
+ var toObject1, toObject2;
473
+ SC.run(function() {
474
+ toObject1 = ToObject.create();
475
+ toObject2 = ToObject.create();
476
+ });
477
+
478
+ ok(!toObject1.get('value') && !toObject2.get('value'), "PRELIM: instances' initial values are correct.");
479
+
480
+ SC.run(function() {
481
+ SC.testControllerA.set('value', YES);
482
+ SC.testControllerB.set('value', YES);
483
+ });
484
+
485
+ ok(toObject1.get('value') && toObject2.get('value'), "PRELIM: instances' values update correctly.");
486
+
487
+ SC.run(function() {
488
+ toObject1.destroy();
489
+ SC.testControllerB.set('value', NO);
490
+ });
491
+
492
+ ok(!toObject2.get('value'), "Second instance updates correctly after first instance is destroyed.");
493
+
494
+ // Cleanup.
495
+ toObject2.destroy();
496
+
497
+ });
498
+
499
+ test("local paths work when binding is defined on a class", function() {
500
+ // This tests the solution to a bug which was hooking all instances of a class's `and` binding
501
+ // up through the same internal object, which would cause multiple instances to cross-polinate.
502
+
503
+ var ToObject = SC.Object.extend({
504
+ localValue1: NO,
505
+ localValue2: NO,
506
+ value: NO,
507
+ valueBinding: SC.Binding.and('.localValue1', '.localValue2')
508
+ });
509
+ var toObject1, toObject2;
510
+ SC.run(function() {
511
+ toObject1 = ToObject.create();
512
+ toObject2 = ToObject.create();
513
+ });
514
+
515
+ ok(!toObject1.get('value') && !toObject2.get('value'), "PRELIM: instances' initial values are correct.");
516
+
517
+ SC.run(function() {
518
+ toObject1.set('localValue1', YES).set('localValue2', YES);
519
+ });
520
+
521
+ ok(toObject1.get('value'), "First instance updates correctly when its own values are changed.");
522
+ ok(!toObject2.get('value'), "Second instance does not update when first instance's values are changed.");
523
+
524
+ // Cleanup.
525
+ toObject1.destroy();
526
+ toObject2.destroy();
527
+
528
+ });
462
529
 
463
530
  module("OR binding", {
464
531
 
@@ -523,6 +590,73 @@ test("toObject.value should be second value if first is falsy", function () {
523
590
 
524
591
  });
525
592
 
593
+ test("remote paths work when binding is defined on a class", function() {
594
+ // This tests the solution to a bug which was hooking all instances of a class's `or` binding
595
+ // up through the same internal object, which would be destroyed the first time any instance
596
+ // was destroyed.
597
+
598
+ var ToObject = SC.Object.extend({
599
+ value: null,
600
+ valueBinding: SC.Binding.or('SC.testControllerA.value', 'SC.testControllerB.value')
601
+ });
602
+
603
+ var toObject1, toObject2;
604
+ SC.run(function() {
605
+ toObject1 = ToObject.create();
606
+ toObject2 = ToObject.create();
607
+ });
608
+
609
+ ok(!toObject1.get('value') && !toObject2.get('value'), "PRELIM: instances' initial values are correct.");
610
+
611
+ SC.run(function() {
612
+ SC.testControllerB.set('value', YES);
613
+ });
614
+
615
+ ok(toObject1.get('value') && toObject2.get('value'), "PRELIM: instances' values update correctly.");
616
+
617
+ SC.run(function() {
618
+ toObject1.destroy();
619
+ SC.testControllerB.set('value', NO);
620
+ });
621
+
622
+ ok(!toObject2.get('value'), "Second instance updates correctly after first instance is destroyed.");
623
+
624
+ // Cleanup.
625
+ toObject2.destroy();
626
+
627
+ });
628
+
629
+ test("local paths work when binding is defined on a class", function() {
630
+ // This tests the solution to a bug which was hooking all instances of a class's `or` binding
631
+ // up through the same internal object, which would cause multiple instances to cross-polinate.
632
+
633
+ var ToObject = SC.Object.extend({
634
+ localValue1: NO,
635
+ localValue2: NO,
636
+ value: NO,
637
+ valueBinding: SC.Binding.or('.localValue1', '.localValue2')
638
+ });
639
+ var toObject1, toObject2;
640
+ SC.run(function() {
641
+ toObject1 = ToObject.create();
642
+ toObject2 = ToObject.create();
643
+ });
644
+
645
+ ok(!toObject1.get('value') && !toObject2.get('value'), "PRELIM: instances' initial values are correct.");
646
+
647
+ SC.run(function() {
648
+ toObject1.set('localValue1', YES);
649
+ });
650
+
651
+ ok(toObject1.get('value'), "First instance updates correctly when its own values are changed.");
652
+ ok(!toObject2.get('value'), "Second instance does not update when first instance's values are changed.");
653
+
654
+ // Cleanup.
655
+ toObject1.destroy();
656
+ toObject2.destroy();
657
+
658
+ });
659
+
526
660
  module("Binding with '[]'", {
527
661
  setup: function () {
528
662
  fromObject = SC.Object.create({ value: [] });
@@ -144,7 +144,7 @@ module SproutCore
144
144
  def self.js_jar
145
145
  @js_jar ||= begin
146
146
  yui_root = File.expand_path("../../vendor/sproutcore", __FILE__)
147
- File.join(yui_root, 'lib/yuicompressor-2.4.6.jar')
147
+ File.join(yui_root, 'lib/yuicompressor-2.4.8.jar')
148
148
  end
149
149
  end
150
150
 
@@ -88,12 +88,18 @@ module SC
88
88
  :config => self.target.config,
89
89
  :project => self.target.project
90
90
  end
91
+
92
+ # Information indicating where the built app can be found. This is useful
93
+ # when manually uploading builds, to ensure we have the newest build.
94
+ if target[:target_type] == :app
95
+ SC.logger.info "Built #{target[:target_name]} to #{target[:build_root]}/#{target[:build_number]}"
96
+ end
91
97
  end
92
98
  return self
93
99
  end
94
100
 
95
101
  def built?; @is_built; end
96
-
102
+
97
103
  #
98
104
  # Resets this manifest, and all same-variation manifests the target depends on.
99
105
  # This is useful when building: it clears the entries and frees up memory so
@@ -102,20 +108,20 @@ module SC
102
108
  def reset!
103
109
  return if @is_resetting
104
110
  @is_resetting = true
105
-
111
+
106
112
  targets = target.expand_required_targets({ :theme => true }) + [target]
107
113
  entries = targets.map do |t|
108
114
  t.manifest_for(variation).reset!
109
115
  end
110
-
116
+
111
117
  targets = target.modules({ :debug => false, :test => false, :theme => true }).each do |t|
112
118
  t.manifest_for(variation).reset!
113
119
  end
114
-
120
+
115
121
  reset_entries!
116
-
122
+
117
123
  @is_resetting = false
118
-
124
+
119
125
  return self
120
126
  end
121
127
 
@@ -182,7 +182,6 @@ module SC
182
182
  # Reloads the project if reloading is enabled. At maximum this will
183
183
  # reload the project every 5 seconds.
184
184
  def reload_project!
185
-
186
185
  monitor_project!
187
186
 
188
187
  # don't reload if no project or is disabled
@@ -205,21 +204,18 @@ module SC
205
204
  @should_monitor = true
206
205
  @project_root = @project.project_root
207
206
 
208
- # collect initial info on project
209
- files = Dir.glob(@project_root / '**' / '*')
210
- # follow 1-level of symlinks
211
- files += Dir.glob(@project_root / '**' / '*' / '**' / '*')
212
- tmp_path = /^#{Regexp.escape(@project_root / 'tmp')}/
213
- files.reject! { |f| f =~ tmp_path }
214
- files.reject! { |f| File.directory?(f) }
215
-
216
- @project_file_count = files.size
217
- @project_mtime = files.map { |x| File.mtime(x).to_i }.max
207
+ # Set to an array of regular expressions matching ignored paths.
208
+ # Listen already ignores several directories at the root of the project (including tmp).
209
+ # Ignore all .git directories. Listen only ignores the project root .git directory by default.
210
+ ignored_paths = [/.*\/.git\//]
218
211
 
219
212
  begin
220
213
  require 'listen'
221
- @listener = Listen.to(@project_root, ignore: tmp_path) do |modified, added, removed|
214
+ @listener = Listen.to(@project_root, ignore: ignored_paths) do |modified, added, removed|
222
215
  SC.logger.info "Detected project change. Will rebuild manifest."
216
+ SC.logger.debug " modified absolute path: #{modified}"
217
+ SC.logger.debug " added absolute path: #{added}"
218
+ SC.logger.debug " removed absolute path: #{removed}"
223
219
  @project_did_change = true
224
220
  end
225
221
  @listener.start
@@ -227,6 +223,18 @@ module SC
227
223
  puts $:.inspect
228
224
  puts e.message
229
225
  SC.logger.warn "The 'listen' gem was not found in your gem repository. Falling back to polling for filesystem changes, which is much more CPU intensive. You should run 'gem install listen' to fix this."
226
+
227
+ # collect initial info on project
228
+ files = Dir.glob(@project_root / '**' / '*')
229
+ # follow 1-level of symlinks
230
+ files += Dir.glob(@project_root / '**' / '*' / '**' / '*')
231
+
232
+ files.reject! { |f| f =~ tmp_path }
233
+ files.reject! { |f| File.directory?(f) }
234
+
235
+ @project_file_count = files.size
236
+ @project_mtime = files.map { |x| File.mtime(x).to_i }.max
237
+
230
238
  Thread.new do
231
239
  while @should_monitor
232
240
  check_for_updates
@@ -349,10 +349,10 @@ module SC
349
349
  targets = find_targets(*targets) # get targets
350
350
 
351
351
  # log output
352
- SC.logger.info "Building targets: #{targets.map { |t| t.target_name } * ","}"
352
+ SC.logger << "Building targets: #{targets.map { |t| t.target_name } * ","}\n"
353
353
 
354
354
  languages = find_languages(*targets) # get languages
355
- SC.logger.info "Building languages: #{ languages * "," }"
355
+ SC.logger << "Building languages: #{ languages * "," }\n"
356
356
 
357
357
  index = 1
358
358
  count = targets.length * languages.length
@@ -416,7 +416,7 @@ module SC
416
416
  end
417
417
 
418
418
  dst = Pathname.new(entry.build_path).relative_path_from(target_build_root)
419
- info " #{entry.filename} -> #{dst}"
419
+ debug " #{entry.filename} -> #{dst}"
420
420
  entry.build!
421
421
  end
422
422
  end
@@ -13,15 +13,15 @@ $to_html5_manifest_networks = []
13
13
 
14
14
  module SC
15
15
  class Tools
16
-
16
+
17
17
  desc "build [TARGET..]", "Builds one or more targets"
18
-
18
+
19
19
  # Standard manifest options. Used by build tool as well.
20
20
  method_option :languages, :type => :string,
21
21
  :desc => "The languages to build."
22
-
22
+
23
23
  method_option :symlink, :default => false
24
-
24
+
25
25
  method_option :buildroot, :type => :string,
26
26
  :desc => "The path to build to."
27
27
  method_option :stageroot, :type => :string,
@@ -34,8 +34,8 @@ module SC
34
34
  :desc => "The identifier(s) for the build."
35
35
  method_option :include_required, :default => false, :aliases => '-r',
36
36
  :desc => "Deprecated. All builds build dependencies."
37
-
38
-
37
+
38
+
39
39
  method_option :entries, :type => :string
40
40
  method_option :whitelist, :type => :string,
41
41
  :desc => "The whitelist to use when building. By default, Whitelist (if present)"
@@ -66,17 +66,17 @@ module SC
66
66
  if options[:entries]
67
67
  entry_filters = options[:entries].split(',')
68
68
  end
69
-
70
- # We want Chance to clear files like sprites immediately after they're asked for,
69
+
70
+ # We want Chance to clear files like sprites immediately after they're asked for,
71
71
  # because we'll only need them once during a build.
72
72
  Chance.clear_files_immediately
73
-
73
+
74
74
  # Get the manifests to build
75
75
  manifests = build_manifests(*targets) do |manifest|
76
76
  # This is our own logic to prevent processing a manifest twice
77
77
  next if manifest[:built_by_builder]
78
78
  manifest[:built_by_builder] = true
79
-
79
+
80
80
  # get entries. If "entries" option was specified, use to filter
81
81
  # filename. Must match end of filename.
82
82
  entries = manifest.entries
@@ -93,34 +93,34 @@ module SC
93
93
 
94
94
  # if there are entries to build, log and build
95
95
  build_entries_for_manifest manifest, options.allow_commented_js
96
-
96
+
97
97
  # Build dependencies
98
98
  target = manifest.target
99
99
  required = target.expand_required_targets :theme => true,
100
100
  :debug => target.config.load_debug,
101
101
  :tests => target.config.load_tests,
102
-
102
+
103
103
  # Modules are not 'required' technically, as they may be loaded
104
104
  # lazily. However, we want to know all targets that should be built,
105
105
  # so we'll include modules as well.
106
106
  :modules => true
107
107
 
108
-
109
- required.each {|t|
108
+
109
+ required.each {|t|
110
110
  m = t.manifest_for(manifest.variation)
111
-
112
-
111
+
112
+
113
113
  # And, yes, the same as above. We're just building entries for all required targets.
114
114
  # We're also going to mark them as fully-built so they don't get built again.
115
115
  next if m[:built_by_builder]
116
116
  m[:built_by_builder] = true
117
117
  m.build!
118
-
118
+
119
119
  build_entries_for_manifest m, options.allow_commented_js
120
-
121
-
120
+
121
+
122
122
  }
123
-
123
+
124
124
  # Clean up
125
125
  manifest.reset!
126
126
  Chance::ChanceFactory.clear_instances
@@ -142,9 +142,9 @@ module SC
142
142
  seconds = t2-t1
143
143
  minutes = seconds/60
144
144
  seconds = seconds%60
145
- puts 'Build time '+minutes.floor.to_s+ ' minutes '+seconds.floor.to_s+' secs'
145
+ puts 'Build time: '+minutes.floor.to_s+ ' minutes '+seconds.floor.to_s+' secs'
146
146
  end
147
-
147
+
148
148
  end
149
149
 
150
150
  end
@@ -26,17 +26,14 @@ Gem::Specification.new do |s|
26
26
  s.add_dependency 'compass', '~> 0.11'
27
27
  s.add_dependency 'chunky_png', '~> 1.2'
28
28
 
29
- # We need to add two eventmachine dependencies so that `thin` (eventmachine >= 0.12.6) and `em-http-request` (eventmachine ~> 1.0.0.beta.4) don't cause bundler to throw a dependency exception.
30
- s.add_dependency 'eventmachine', '>= 0.12.6'
31
29
  s.add_dependency 'eventmachine', '~> 1.0'
32
-
33
- s.add_dependency 'em-http-request', '~> 1.0'
30
+ s.add_dependency 'em-http-request', '= 1.1.1'
34
31
 
35
32
  if is_jruby
36
33
  s.add_dependency 'mongrel', '~> 1.1'
37
34
  else
38
35
  s.add_dependency 'thin', '~> 1.2'
39
- s.add_dependency 'listen', '~> 2.0'
36
+ s.add_dependency 'listen', '~> 2.7'
40
37
  end
41
38
 
42
39
  s.add_development_dependency 'gemcutter', "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sproutcore
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.2
4
+ version: 1.10.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Strobe, Inc., Apple Inc. and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-25 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -136,20 +136,6 @@ dependencies:
136
136
  - - ~>
137
137
  - !ruby/object:Gem::Version
138
138
  version: '1.2'
139
- - !ruby/object:Gem::Dependency
140
- name: eventmachine
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ! '>='
144
- - !ruby/object:Gem::Version
145
- version: 0.12.6
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ! '>='
151
- - !ruby/object:Gem::Version
152
- version: 0.12.6
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: eventmachine
155
141
  requirement: !ruby/object:Gem::Requirement
@@ -168,16 +154,16 @@ dependencies:
168
154
  name: em-http-request
169
155
  requirement: !ruby/object:Gem::Requirement
170
156
  requirements:
171
- - - ~>
157
+ - - '='
172
158
  - !ruby/object:Gem::Version
173
- version: '1.0'
159
+ version: 1.1.1
174
160
  type: :runtime
175
161
  prerelease: false
176
162
  version_requirements: !ruby/object:Gem::Requirement
177
163
  requirements:
178
- - - ~>
164
+ - - '='
179
165
  - !ruby/object:Gem::Version
180
- version: '1.0'
166
+ version: 1.1.1
181
167
  - !ruby/object:Gem::Dependency
182
168
  name: thin
183
169
  requirement: !ruby/object:Gem::Requirement
@@ -198,14 +184,14 @@ dependencies:
198
184
  requirements:
199
185
  - - ~>
200
186
  - !ruby/object:Gem::Version
201
- version: '2.0'
187
+ version: '2.7'
202
188
  type: :runtime
203
189
  prerelease: false
204
190
  version_requirements: !ruby/object:Gem::Requirement
205
191
  requirements:
206
192
  - - ~>
207
193
  - !ruby/object:Gem::Version
208
- version: '2.0'
194
+ version: '2.7'
209
195
  - !ruby/object:Gem::Dependency
210
196
  name: gemcutter
211
197
  requirement: !ruby/object:Gem::Requirement
@@ -856,7 +842,7 @@ files:
856
842
  - vendor/sproutcore/lib/args4j-2.0.12.jar
857
843
  - vendor/sproutcore/lib/htmlcompressor-0.9.3.jar
858
844
  - vendor/sproutcore/lib/yuicompressor-2.4.2.jar
859
- - vendor/sproutcore/lib/yuicompressor-2.4.6.jar
845
+ - vendor/sproutcore/lib/yuicompressor-2.4.8.jar
860
846
  - lib/frameworks/sproutcore/apps/greenhouse/beautify.js
861
847
  - lib/frameworks/sproutcore/apps/greenhouse/Buildfile
862
848
  - lib/frameworks/sproutcore/apps/greenhouse/controllers/design.js
@@ -1888,6 +1874,7 @@ files:
1888
1874
  - lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
1889
1875
  - lib/frameworks/sproutcore/frameworks/foundation/tests/system/utils/pointInElement.js
1890
1876
  - lib/frameworks/sproutcore/frameworks/foundation/tests/system/utils/range.js
1877
+ - lib/frameworks/sproutcore/frameworks/foundation/tests/transitions/view_transitions_test.js
1891
1878
  - lib/frameworks/sproutcore/frameworks/foundation/tests/validators/credit_card.js
1892
1879
  - lib/frameworks/sproutcore/frameworks/foundation/tests/validators/date.js
1893
1880
  - lib/frameworks/sproutcore/frameworks/foundation/tests/validators/not_empty.js