sproutcore 1.4.2-java → 1.4.3-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. data/CHANGELOG +11 -0
  2. data/Rakefile +27 -436
  3. data/VERSION.yml +1 -1
  4. data/lib/frameworks/sproutcore/CHANGELOG +32 -2
  5. data/lib/frameworks/sproutcore/frameworks/animation/core.js +1 -1
  6. data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +8 -2
  7. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js +42 -2
  8. data/lib/frameworks/sproutcore/frameworks/debug/invoke_once_last_debugging.js +7 -12
  9. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/radio/ui.js +22 -1
  10. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +1 -1
  11. data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +6 -2
  12. data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +1 -1
  13. data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +38 -10
  14. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +8 -8
  15. data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +1 -1
  16. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +12 -5
  17. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/button.js +3 -3
  18. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +14 -9
  19. data/lib/frameworks/sproutcore/frameworks/foundation/system/datetime.js +3 -1
  20. data/lib/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +25 -17
  21. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +46 -36
  22. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/validatable/ui.js +1 -1
  23. data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/datetime.js +5 -0
  24. data/lib/frameworks/sproutcore/frameworks/foundation/tests/validators/not_empty.js +56 -0
  25. data/lib/frameworks/sproutcore/frameworks/foundation/validators/date_time.js +1 -1
  26. data/lib/frameworks/sproutcore/frameworks/foundation/validators/not_empty.js +7 -3
  27. data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +1 -1
  28. data/lib/frameworks/sproutcore/frameworks/media/views/audio.js +1 -1
  29. data/lib/frameworks/sproutcore/frameworks/media/views/controls.js +1 -1
  30. data/lib/frameworks/sproutcore/frameworks/media/views/media_slider.js +1 -1
  31. data/lib/frameworks/sproutcore/frameworks/media/views/mini_controls.js +1 -1
  32. data/lib/frameworks/sproutcore/frameworks/media/views/simple_controls.js +1 -1
  33. data/lib/frameworks/sproutcore/frameworks/media/views/video.js +1 -1
  34. data/lib/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +1 -1
  35. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +18 -23
  36. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +13 -0
  37. data/lib/sproutcore/builders/base.rb +4 -4
  38. data/lib/sproutcore/builders/javascript.rb +0 -7
  39. data/lib/sproutcore/builders/stylesheet.rb +0 -7
  40. data/lib/sproutcore/rack/proxy.rb +28 -13
  41. metadata +4 -4
  42. data/DISTRIBUTION.yml +0 -20
@@ -550,6 +550,19 @@ test("should register an observer for a property - Special case of chained prope
550
550
  equals('chainedPropertyObserved',ObjectC.normal2);
551
551
  });
552
552
 
553
+ test("passing a context", function() {
554
+ var target = {
555
+ callback: function(target, key, nullVariable, context, revision) {
556
+ target.context = context;
557
+ }
558
+ };
559
+
560
+ ObjectC.context = null;
561
+ ObjectC.addObserver('normal', target, 'callback', 'context');
562
+ ObjectC.set('normal','newValue');
563
+
564
+ equals(ObjectC.context, 'context');
565
+ });
553
566
 
554
567
  module("object.removeObserver()", {
555
568
  setup: function() {
@@ -48,15 +48,15 @@ module SC
48
48
  # joins the array of lines. this is where you can also do any final
49
49
  # post-processing on the build
50
50
  def joinlines(lines)
51
- lines * ""
51
+ lines.is_a?(Array) ? lines.join : lines
52
52
  end
53
53
 
54
54
  # writes the passed lines to the named file
55
55
  def writelines(dst_path, lines)
56
56
  FileUtils.mkdir_p(File.dirname(dst_path))
57
- f = File.open(dst_path, 'w')
58
- f.write joinlines(lines)
59
- f.close
57
+ File.open(dst_path, 'w') do |f|
58
+ f.write joinlines(lines)
59
+ end
60
60
  end
61
61
 
62
62
  # Handles occurances of sc_static() or static_url()
@@ -24,13 +24,6 @@ module SC
24
24
  end
25
25
  end
26
26
 
27
- def writelines(dst_path, lines)
28
- FileUtils.mkdir_p(File.dirname(dst_path))
29
- File.open(dst_path, 'w') do |f|
30
- f.write lines
31
- end
32
- end
33
-
34
27
  def build(dst_path)
35
28
  lines = ""
36
29
  target_name = entry.target[:target_name].to_s.sub(/^\//,'')
@@ -26,13 +26,6 @@ module SC
26
26
  end
27
27
  end
28
28
 
29
- def writelines(dst_path, lines)
30
- FileUtils.mkdir_p(File.dirname(dst_path))
31
- File.open(dst_path, 'w') do |f|
32
- f.write lines
33
- end
34
- end
35
-
36
29
  def build(dst_path)
37
30
  code = rewrite_inline_code(readlines(entry[:source_path]))
38
31
  writelines dst_path, code
@@ -5,7 +5,14 @@
5
5
  # and contributors
6
6
  # ===========================================================================
7
7
 
8
- require 'net/https'
8
+ begin
9
+ require 'net/https'
10
+ SC::HTTPS_ENABLED = true
11
+ rescue LoadError => e
12
+ require 'net/http'
13
+ SC::HTTPS_ENABLED = false
14
+ end
15
+
9
16
  module SC
10
17
  module Rack
11
18
 
@@ -30,6 +37,12 @@ module SC
30
37
  end
31
38
 
32
39
  def handle_proxy(proxy, proxy_url, env)
40
+ if proxy[:secure] && !SC::HTTPS_ENABLED
41
+ SC.logger << "~ WARNING: HTTPS is not supported on your system, using HTTP instead.\n"
42
+ SC.logger << " If you are using Ubuntu, you can run `apt-get install libopenssl-ruby`\n"
43
+ proxy[:secure] = false
44
+ end
45
+
33
46
  origin_host = env['SERVER_NAME'] # capture the origin host for cookies
34
47
  http_method = env['REQUEST_METHOD'].to_s.downcase
35
48
  url = env['PATH_INFO']
@@ -50,7 +63,7 @@ module SC
50
63
  headers['Content-Length'] = env['CONTENT_LENGTH'] if env['CONTENT_LENGTH']
51
64
 
52
65
  http_host, http_port = proxy[:to].split(':')
53
- http_port = '80' if http_port.nil?
66
+ http_port = proxy[:secure] ? '443' : '80' if http_port.nil?
54
67
 
55
68
  # added 4/23/09 per Charles Jolley, corrects problem
56
69
  # when making requests to virtual hosts
@@ -70,14 +83,16 @@ module SC
70
83
  done = false
71
84
  tries = 0
72
85
  until done
73
- ::Net::HTTP.start(http_host, http_port) do |http|
74
- if proxy[:secure]
75
- http.use_ssl = true
76
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
77
- end
86
+ http = ::Net::HTTP.new(http_host, http_port)
87
+
88
+ if proxy[:secure]
89
+ http.use_ssl = true
90
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
91
+ end
78
92
 
93
+ http.start do |web|
79
94
  if no_body_method.include?(http_method)
80
- response = http.send(http_method, http_path, headers)
95
+ response = web.send(http_method, http_path, headers)
81
96
  else
82
97
  http_body = env['rack.input']
83
98
  http_body.rewind
@@ -86,13 +101,14 @@ module SC
86
101
  true, true, http_path, headers
87
102
 
88
103
  some_request.body_stream = http_body
89
- response = http.request(some_request)
104
+ response = web.request(some_request)
90
105
  end
91
106
  end
92
107
 
93
108
  status = response.code # http status code
109
+ protocol = proxy[:secure] ? 'https' : 'http'
94
110
 
95
- SC.logger << "~ PROXY: #{http_method.upcase} #{status} #{url} -> http://#{http_host}:#{http_port}#{http_path}\n"
111
+ SC.logger << "~ PROXY: #{http_method.upcase} #{status} #{url} -> #{protocol}://#{http_host}:#{http_port}#{http_path}\n"
96
112
 
97
113
  # display and construct specific response headers
98
114
  response_headers = {}
@@ -120,15 +136,14 @@ module SC
120
136
  response_headers[key] = value
121
137
  end
122
138
 
123
- if [301, 307].include?(status.to_i)
124
- SC.logger << '~ REDIRECTING: '+response_headers['location']
139
+ if [301, 302, 303, 307].include?(status.to_i) && proxy[:redirect] != false
140
+ SC.logger << '~ REDIRECTING: '+response_headers['location']+"\n"
125
141
 
126
142
  uri = URI.parse(response_headers['location']);
127
143
  http_host = uri.host
128
144
  http_port = uri.port
129
145
  http_path = uri.path
130
146
  http_path += '?'+uri.query if uri.query
131
- headers = {}
132
147
 
133
148
  tries += 1
134
149
  if tries > 10
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 4
8
- - 2
9
- version: 1.4.2
8
+ - 3
9
+ version: 1.4.3
10
10
  platform: java
11
11
  authors:
12
12
  - Strobe, Inc., Sprout Systems, Inc. Apple Inc. and contributors
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-01 00:00:00 -04:00
17
+ date: 2010-10-19 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -215,7 +215,6 @@ extra_rdoc_files:
215
215
  - README.txt
216
216
  files:
217
217
  - CHANGELOG
218
- - DISTRIBUTION.yml
219
218
  - Gemfile
220
219
  - History.txt
221
220
  - README.txt
@@ -1537,6 +1536,7 @@ files:
1537
1536
  - lib/frameworks/sproutcore/frameworks/foundation/tests/system/utils/rect.js
1538
1537
  - lib/frameworks/sproutcore/frameworks/foundation/tests/validators/credit_card.js
1539
1538
  - lib/frameworks/sproutcore/frameworks/foundation/tests/validators/date.js
1539
+ - lib/frameworks/sproutcore/frameworks/foundation/tests/validators/not_empty.js
1540
1540
  - lib/frameworks/sproutcore/frameworks/foundation/tests/validators/number.js
1541
1541
  - lib/frameworks/sproutcore/frameworks/foundation/tests/validators/password.js
1542
1542
  - lib/frameworks/sproutcore/frameworks/foundation/tests/validators/validator.js
@@ -1,20 +0,0 @@
1
- # This file lists all subprojects that need to be installed in the directory
2
- # for release. The Rakefile will track Git hash codes for each project in
3
- # the VERSION.yml file
4
- #
5
- # Each entry should have the following format:
6
- #
7
- # path/to/item:
8
- # repo: GIT/SVN URL
9
- # scm: git|svn <- type of source control system. defaults to git
10
- #
11
- # Note that if you are maintaining private versions of any of these
12
- # frameworks you can also create a file called LOCAL.yml that can contain
13
- # any overrides to the distirbution info contained here.
14
- #
15
-
16
- frameworks/sproutcore:
17
- repo: "git://github.com/sproutit/sproutcore.git"
18
- branch: "master"
19
-
20
-