public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/josh/rails.git
Tagged Rails 2.0.2

git-svn-id: http://svn-commit.rubyonrails.org/rails/tags/rel_2-0-2@8430 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
dhh (author)
Sun Dec 16 17:22:11 -0800 2007
commit  e454cf721ea2deca1b1b991339a5d30161dcfb9c
tree    61bc174fe871cfccf8d8af39e664959918896b12
parent  7af985f74fdaead950986038570f4d00befe7fc0
...
11
12
13
14
 
15
16
17
...
11
12
13
 
14
15
16
17
0
@@ -11,7 +11,7 @@ end
0
 desc 'Run all tests by default'
0
 task :default => :test
0
 
0
-%w(test docs package pgem release).each do |task_name|
0
+%w(test rdoc package pgem release).each do |task_name|
0
   desc "Run #{task_name} task for all projects"
0
   task task_name do
0
     PROJECTS.each do |project|
...
 
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
8
0
@@ -1,3 +1,8 @@
0
+*2.0.2* (December 16th, 2007)
0
+
0
+* Included in Rails 2.0.2
0
+
0
+
0
 *2.0.1* (December 7th, 2007)
0
 
0
 * Update ActionMailer so it treats ActionView the same way that ActionController does. Closes #10244 [rick]
...
55
56
57
58
 
59
60
61
...
55
56
57
 
58
59
60
61
0
@@ -55,7 +55,7 @@ spec = Gem::Specification.new do |s|
0
   s.rubyforge_project = "actionmailer"
0
   s.homepage = "http://www.rubyonrails.org"
0
 
0
- s.add_dependency('actionpack', '= 2.0.1' + PKG_BUILD)
0
+ s.add_dependency('actionpack', '= 2.0.2' + PKG_BUILD)
0
 
0
   s.has_rdoc = true
0
   s.requirements << 'none'
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@ module ActionMailer
0
   module VERSION #:nodoc:
0
     MAJOR = 2
0
     MINOR = 0
0
- TINY = 1
0
+ TINY = 2
0
 
0
     STRING = [MAJOR, MINOR, TINY].join('.')
0
   end
...
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
3
4
...
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
0
@@ -1,4 +1,20 @@
0
-*SVN*
0
+*2.0.2* (December 16th, 2007)
0
+
0
+* Added delete_via_redirect and put_via_redirect to integration testing #10497 [philodespotos]
0
+
0
+* Allow headers['Accept'] to be set by hand when calling xml_http_request #10461 [BMorearty]
0
+
0
+* Added OPTIONS to list of default accepted HTTP methods #10449 [holoway]
0
+
0
+* Added option to pass proc to ActionController::Base.asset_host for maximum configurability #10521 [chuyeow]. Example:
0
+
0
+ ActionController::Base.asset_host = Proc.new { |source|
0
+ if source.starts_with?('/images')
0
+ "http://images.example.com"
0
+ else
0
+ "http://assets.example.com"
0
+ end
0
+ }
0
 
0
 * Fixed that ActionView#file_exists? would be incorrect if @first_render is set #10569 [dbussink]
0
 
...
76
77
78
79
 
80
81
82
...
76
77
78
 
79
80
81
82
0
@@ -76,7 +76,7 @@ spec = Gem::Specification.new do |s|
0
   s.has_rdoc = true
0
   s.requirements << 'none'
0
 
0
- s.add_dependency('activesupport', '= 2.0.1' + PKG_BUILD)
0
+ s.add_dependency('activesupport', '= 2.0.2' + PKG_BUILD)
0
 
0
   s.require_path = 'lib'
0
   s.autorequire = 'action_controller'
...
121
122
123
124
125
126
127
128
129
 
 
 
 
 
 
130
131
132
133
134
135
136
137
138
139
140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
142
143
...
187
188
189
190
 
191
192
193
...
121
122
123
 
 
 
 
 
 
124
125
126
127
128
129
130
131
132
133
 
 
 
 
 
 
 
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
...
202
203
204
 
205
206
207
208
0
@@ -121,23 +121,38 @@ module ActionController
0
         status
0
       end
0
 
0
- # Performs a GET request, following any subsequent redirect. Note that
0
- # the redirects are followed until the response is not a redirect--this
0
- # means you may run into an infinite loop if your redirect loops back to
0
- # itself. Headers are treated in the same way as #get.
0
- def get_via_redirect(path, args={}, headers = {})
0
- get path, args, headers
0
+ # Performs a request using the specified method, following any subsequent
0
+ # redirect. Note that the redirects are followed until the response is
0
+ # not a redirect--this means you may run into an infinite loop if your
0
+ # redirect loops back to itself.
0
+ def request_via_redirect(http_method, path, parameters = nil, headers = nil)
0
+ send(http_method, path, parameters, headers)
0
         follow_redirect! while redirect?
0
         status
0
       end
0
 
0
- # Performs a POST request, following any subsequent redirect. This is
0
- # vulnerable to infinite loops, the same as #get_via_redirect. Headers are
0
- # treated in the same way as #get.
0
- def post_via_redirect(path, args={}, headers = {})
0
- post path, args, headers
0
- follow_redirect! while redirect?
0
- status
0
+ # Performs a GET request, following any subsequent redirect.
0
+ # See #request_via_redirect() for more information.
0
+ def get_via_redirect(path, parameters = nil, headers = nil)
0
+ request_via_redirect(:get, path, parameters, headers)
0
+ end
0
+
0
+ # Performs a POST request, following any subsequent redirect.
0
+ # See #request_via_redirect() for more information.
0
+ def post_via_redirect(path, parameters = nil, headers = nil)
0
+ request_via_redirect(:post, path, parameters, headers)
0
+ end
0
+
0
+ # Performs a PUT request, following any subsequent redirect.
0
+ # See #request_via_redirect() for more information.
0
+ def put_via_redirect(path, parameters = nil, headers = nil)
0
+ request_via_redirect(:put, path, parameters, headers)
0
+ end
0
+
0
+ # Performs a DELETE request, following any subsequent redirect.
0
+ # See #request_via_redirect() for more information.
0
+ def delete_via_redirect(path, parameters = nil, headers = nil)
0
+ request_via_redirect(:delete, path, parameters, headers)
0
       end
0
 
0
       # Returns +true+ if the last response was a redirect.
0
@@ -187,7 +202,7 @@ module ActionController
0
       def xml_http_request(request_method, path, parameters = nil, headers = nil)
0
         headers ||= {}
0
         headers['X-Requested-With'] = 'XMLHttpRequest'
0
- headers['Accept'] = 'text/javascript, text/html, application/xml, text/xml, */*'
0
+ headers['Accept'] ||= 'text/javascript, text/html, application/xml, text/xml, */*'
0
 
0
         process(request_method, path, parameters, headers)
0
       end
...
4
5
6
7
 
8
9
10
...
4
5
6
 
7
8
9
10
0
@@ -4,7 +4,7 @@ require 'strscan'
0
 
0
 module ActionController
0
   # HTTP methods which are accepted by default.
0
- ACCEPTED_HTTP_METHODS = Set.new(%w( get head put post delete ))
0
+ ACCEPTED_HTTP_METHODS = Set.new(%w( get head put post delete options ))
0
 
0
   # CgiRequest and TestRequest provide concrete implementations.
0
   class AbstractRequest
...
35
36
37
38
 
39
40
41
...
35
36
37
 
38
39
40
41
0
@@ -35,7 +35,7 @@ require 'openssl' # to generate the HMAC message digest
0
 # such as 'MD5', 'RIPEMD160', 'SHA256', etc.
0
 #
0
 # To generate a secret key for an existing application, run
0
-# `rake generate:secret` and set the key in config/environment.rb
0
+# `rake secret` and set the key in config/environment.rb
0
 #
0
 # Note that changing digest or secret invalidates all existing sessions!
0
 class CGI::Session::CookieStore
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@ module ActionPack #:nodoc:
0
   module VERSION #:nodoc:
0
     MAJOR = 2
0
     MINOR = 0
0
- TINY = 1
0
+ TINY = 2
0
 
0
     STRING = [MAJOR, MINOR, TINY].join('.')
0
   end
...
31
32
33
34
 
35
36
37
...
39
40
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
43
44
...
385
386
387
388
389
 
390
391
392
393
394
395
396
 
397
398
399
400
 
401
402
403
...
430
431
432
433
434
 
 
 
435
436
437
 
 
 
 
 
438
439
440
...
31
32
33
 
34
35
36
37
...
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
...
411
412
413
 
 
414
415
416
417
418
419
420
 
421
422
423
424
 
425
426
427
428
...
455
456
457
 
 
458
459
460
461
462
 
463
464
465
466
467
468
469
470
0
@@ -31,7 +31,7 @@ module ActionView
0
     # stylesheet_include_tag("application")
0
     # => <link href="http://assets3.example.com/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
0
     #
0
- # To do this, you can either setup four actual hosts, or you can use wildcard DNS to CNAME
0
+ # To do this, you can either setup 4 actual hosts, or you can use wildcard DNS to CNAME
0
     # the wildcard to a single asset host. You can read more about setting up your DNS CNAME records from
0
     # your ISP.
0
     #
0
@@ -39,6 +39,32 @@ module ActionView
0
     # for server load balancing. See http://www.die.net/musings/page_load_time/
0
     # for background.
0
     #
0
+ # Alternatively, you can exert more control over the asset host by setting <tt>asset_host</tt> to a proc
0
+ # that takes a single source argument. This is useful if you are unable to setup 4 actual hosts or have
0
+ # fewer/more than 4 hosts. The example proc below generates http://assets1.example.com and
0
+ # http://assets2.example.com randomly.
0
+ #
0
+ # ActionController::Base.asset_host = Proc.new { |source| "http://assets#{rand(2) + 1}.example.com" }
0
+ # image_tag("rails.png")
0
+ # => <img src="http://assets2.example.com/images/rails.png" alt="Rails" />
0
+ # stylesheet_include_tag("application")
0
+ # => <link href="http://assets1.example.com/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
0
+ #
0
+ # The proc takes a single <tt>source</tt> parameter which is the path of the source asset. This can be used to
0
+ # generate a particular asset host depending on the asset path.
0
+ #
0
+ # ActionController::Base.asset_host = Proc.new { |source|
0
+ # if source.starts_with?('/images')
0
+ # "http://images.example.com"
0
+ # else
0
+ # "http://assets.example.com"
0
+ # end
0
+ # }
0
+ # image_tag("rails.png")
0
+ # => <img src="http://images.example.com/images/rails.png" alt="Rails" />
0
+ # stylesheet_include_tag("application")
0
+ # => <link href="http://assets.example.com/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
0
+ #
0
     # === Using asset timestamps
0
     #
0
     # By default, Rails will append all asset paths with that asset's timestamp. This allows you to set a cache-expiration date for the
0
@@ -385,19 +411,18 @@ module ActionView
0
         # Add the .ext if not present. Return full URLs otherwise untouched.
0
         # Prefix with /dir/ if lacking a leading /. Account for relative URL
0
         # roots. Rewrite the asset path for cache-busting asset ids. Include
0
- # a single or wildcarded asset host, if configured, with the correct
0
- # request protocol.
0
+ # asset host, if configured, with the correct request protocol.
0
         def compute_public_path(source, dir, ext = nil, include_host = true)
0
           has_request = @controller.respond_to?(:request)
0
 
0
           cache_key =
0
             if has_request
0
               [ @controller.request.protocol,
0
- ActionController::Base.asset_host,
0
+ ActionController::Base.asset_host.to_s,
0
                 @controller.request.relative_url_root,
0
                 dir, source, ext, include_host ].join
0
             else
0
- [ ActionController::Base.asset_host,
0
+ [ ActionController::Base.asset_host.to_s,
0
                 dir, source, ext, include_host ].join
0
             end
0
 
0
@@ -430,11 +455,16 @@ module ActionView
0
         end
0
 
0
         # Pick an asset host for this source. Returns nil if no host is set,
0
- # the host if no wildcard is set, or the host interpolated with the
0
- # numbers 0-3 if it contains %d. The number is the source hash mod 4.
0
+ # the host if no wildcard is set, the host interpolated with the
0
+ # numbers 0-3 if it contains %d (the number is the source hash mod 4),
0
+ # or the value returned from invoking the proc if it's a proc.
0
         def compute_asset_host(source)
0
           if host = ActionController::Base.asset_host
0
- host % (source.hash % 4)
0
+ if host.is_a?(Proc)
0
+ host.call(source)
0
+ else
0
+ host % (source.hash % 4)
0
+ end
0
           end
0
         end
0
 
...
287
288
289
290
291
 
 
292
293
294
...
287
288
289
 
 
290
291
292
293
294
0
@@ -287,8 +287,8 @@ module ActionView
0
       #
0
       # ==== Examples
0
       # auto_link("Go to http://www.rubyonrails.org and say hello to david@loudthinking.com")
0
- # # => "Go to <a href="http://www.rubyonrails.org">http://www.rubyonrails.org</a> and
0
- # # say hello to <a href="mailto:david@loudthinking.com">david@loudthinking.com</a>"
0
+ # # => "Go to <a href=\"http://www.rubyonrails.org\">http://www.rubyonrails.org</a> and
0
+ # # say hello to <a href=\"mailto:david@loudthinking.com\">david@loudthinking.com</a>"
0
       #
0
       # auto_link("Visit http://www.loudthinking.com/ or e-mail david@loudthinking.com", :urls)
0
       # # => "Visit <a href=\"http://www.loudthinking.com/\">http://www.loudthinking.com/</a>
...
5
6
7
8
 
9
10
11
...
5
6
7
 
8
9
10
11
0
@@ -5,7 +5,7 @@ class ERB
0
     HTML_ESCAPE = { '&' => '&amp;', '"' => '&quot;', '>' => '&gt;', '<' => '&lt;' }
0
 
0
     def html_escape(s)
0
- s.to_s.gsub(/[&\"><]/) { |special| HTML_ESCAPE[special] }
0
+ s.to_s.gsub(/[&"><]/) { |special| HTML_ESCAPE[special] }
0
     end
0
   end
0
 end
...
49
50
51
52
53
54
55
 
 
 
 
 
 
56
 
 
57
58
 
 
59
 
 
 
60
61
 
62
63
64
 
65
 
 
 
66
67
 
 
 
 
 
68
69
70
 
 
 
 
 
71
72
73
 
 
 
 
74
75
76
...
179
180
181
 
 
 
 
 
 
 
 
 
182
183
184
...
49
50
51
 
 
 
 
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 
70
71
72
 
73
74
75
76
77
78
 
79
80
81
82
83
84
 
 
85
86
87
88
89
90
 
 
91
92
93
94
95
96
97
...
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
0
@@ -49,28 +49,49 @@ class SessionTest < Test::Unit::TestCase
0
     assert_equal 200, @session.follow_redirect!
0
   end
0
 
0
- def test_get_via_redirect
0
- path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue" }
0
-
0
- @session.expects(:get).with(path,args,headers)
0
+ def test_request_via_redirect_uses_given_method
0
+ path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue"}
0
+ @session.expects(:put).with(path, args, headers)
0
+ @session.stubs(:redirect?).returns(false)
0
+ @session.request_via_redirect(:put, path, args, headers)
0
+ end
0
 
0
+ def test_request_via_redirect_follows_redirects
0
+ path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue"}
0
     @session.stubs(:redirect?).returns(true, true, false)
0
     @session.expects(:follow_redirect!).times(2)
0
+ @session.request_via_redirect(:get, path, args, headers)
0
+ end
0
 
0
+ def test_request_via_redirect_returns_status
0
+ path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue"}
0
+ @session.stubs(:redirect?).returns(false)
0
     @session.stubs(:status).returns(200)
0
- assert_equal 200, @session.get_via_redirect(path, args, headers)
0
+ assert_equal 200, @session.request_via_redirect(:get, path, args, headers)
0
   end
0
 
0
- def test_post_via_redirect
0
+ def test_get_via_redirect
0
     path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue" }
0
+ @session.expects(:request_via_redirect).with(:get, path, args, headers)
0
+ @session.get_via_redirect(path, args, headers)
0
+ end
0
 
0
- @session.expects(:post).with(path,args,headers)
0
+ def test_post_via_redirect
0
+ path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue" }
0
+ @session.expects(:request_via_redirect).with(:post, path, args, headers)
0
+ @session.post_via_redirect(path, args, headers)
0
+ end
0
 
0
- @session.stubs(:redirect?).returns(true, true, false)
0
- @session.expects(:follow_redirect!).times(2)
0
+ def test_put_via_redirect
0
+ path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue" }
0
+ @session.expects(:request_via_redirect).with(:put, path, args, headers)
0
+ @session.put_via_redirect(path, args, headers)
0
+ end
0
 
0
- @session.stubs(:status).returns(200)
0
- assert_equal 200, @session.post_via_redirect(path, args, headers)
0
+ def test_delete_via_redirect
0
+ path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue" }
0
+ @session.expects(:request_via_redirect).with(:delete, path, args, headers)
0
+ @session.delete_via_redirect(path, args, headers)
0
   end
0
 
0
   def test_url_for_with_controller
0
@@ -179,6 +200,15 @@ class SessionTest < Test::Unit::TestCase
0
     @session.expects(:process).with(:head,path,params,headers_after_xhr)
0
     @session.xml_http_request(:head,path,params,headers)
0
   end
0
+
0
+ def test_xml_http_request_override_accept
0
+ path = "/index"; params = "blah"; headers = {:location => 'blah', "Accept" => "application/xml"}
0
+ headers_after_xhr = headers.merge(
0
+ "X-Requested-With" => "XMLHttpRequest"
0
+ )
0
+ @session.expects(:process).with(:post,path,params,headers_after_xhr)
0
+ @session.xml_http_request(:post,path,params,headers)
0
+ end
0
 end
0
 
0
 class IntegrationTestTest < Test::Unit::TestCase
...
316
317
318
319
 
320
321
322
...
316
317
318
 
319
320
321
322
0
@@ -316,7 +316,7 @@ class RequestTest < Test::Unit::TestCase
0
 
0
   def test_allow_method_hacking_on_post
0
     set_request_method_to :post
0
- [:get, :head, :put, :post, :delete].each do |method|
0
+ [:get, :head, :options, :put, :post, :delete].each do |method|
0
       @request.instance_eval { @parameters = { :_method => method } ; @request_method = nil }
0
       assert_equal(method == :head ? :get : method, @request.method)
0
     end
...
223
224
225
226
227
228
229
...
247
248
249
250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
252
253
...
304
305
306
307
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
309
310
...
223
224
225
 
226
227
228
...
246
247
248
 
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
...
320
321
322
 
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
0
@@ -223,7 +223,6 @@ class AssetTagHelperTest < Test::Unit::TestCase
0
     assert_equal copy, source
0
   end
0
 
0
-
0
   def test_caching_javascript_include_tag_when_caching_on
0
     ENV["RAILS_ASSET_ID"] = ""
0
     ActionController::Base.asset_host = 'http://a%d.example.com'
0
@@ -247,7 +246,24 @@ class AssetTagHelperTest < Test::Unit::TestCase
0
     File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js'))
0
     File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))
0
   end
0
-
0
+
0
+ def test_caching_javascript_include_tag_when_caching_on_with_proc_asset_host
0
+ ENV["RAILS_ASSET_ID"] = ""
0
+ ActionController::Base.asset_host = Proc.new { |source| "http://a#{source.length}.example.com" }
0
+ ActionController::Base.perform_caching = true
0
+
0
+ assert_equal '/javascripts/scripts.js'.length, 23
0
+ assert_dom_equal(
0
+ %(<script src="http://a23.example.com/javascripts/scripts.js" type="text/javascript"></script>),
0
+ javascript_include_tag(:all, :cache => 'scripts')
0
+ )
0
+
0
+ assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'scripts.js'))
0
+
0
+ ensure
0
+ File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'scripts.js'))
0
+ end
0
+
0
   def test_caching_javascript_include_tag_when_caching_on_and_using_subdirectory
0
     ENV["RAILS_ASSET_ID"] = ""
0
     ActionController::Base.asset_host = 'http://a%d.example.com'
0
@@ -304,7 +320,24 @@ class AssetTagHelperTest < Test::Unit::TestCase
0
     File.delete(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
0
     File.delete(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
0
   end
0
-
0
+
0
+ def test_caching_stylesheet_link_tag_when_caching_on_with_proc_asset_host
0
+ ENV["RAILS_ASSET_ID"] = ""
0
+ ActionController::Base.asset_host = Proc.new { |source| "http://a#{source.length}.example.com" }
0
+ ActionController::Base.perform_caching = true
0
+
0
+ assert_equal '/stylesheets/styles.css'.length, 23
0
+ assert_dom_equal(
0
+ %(<link href="http://a23.example.com/stylesheets/styles.css" media="screen" rel="stylesheet" type="text/css" />),
0
+ stylesheet_link_tag(:all, :cache => 'styles')
0
+ )
0
+
0
+ assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'styles.css'))
0
+
0
+ ensure
0
+ File.delete(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'styles.css'))
0
+ end
0
+
0
   def test_caching_stylesheet_include_tag_when_caching_off
0
     ENV["RAILS_ASSET_ID"] = ""
0
     ActionController::Base.perform_caching = false
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-*SVN*
0
+*2.0.2* (December 16th, 2007)
0
 
0
 * Ensure optimistic locking handles nil #lock_version values properly. Closes #10510 [rick]
0
 
...
172
173
174
175
 
176
177
178
...
172
173
174
 
175
176
177
178
0
@@ -172,7 +172,7 @@ spec = Gem::Specification.new do |s|
0
     s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
0
   end
0
 
0
- s.add_dependency('activesupport', '= 2.0.1' + PKG_BUILD)
0
+ s.add_dependency('activesupport', '= 2.0.2' + PKG_BUILD)
0
 
0
   s.files.delete "test/fixtures/fixture_database.sqlite"
0
   s.files.delete "test/fixtures/fixture_database_2.sqlite"
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@ module ActiveRecord
0
   module VERSION #:nodoc:
0
     MAJOR = 2
0
     MINOR = 0
0
- TINY = 1
0
+ TINY = 2
0
 
0
     STRING = [MAJOR, MINOR, TINY].join('.')
0
   end
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-*SVN*
0
+*2.0.2* (December 16th, 2007)
0
 
0
 * Added more specific exceptions for 400, 401, and 403 (all descending from ClientError so existing rescues will work) #10326 [trek]
0
 
...
62
63
64
65
 
66
67
68
...
62
63
64
 
65
66
67
68
0
@@ -62,7 +62,7 @@ spec = Gem::Specification.new do |s|
0
     s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
0
   end
0
   
0
- s.add_dependency('activesupport', '= 2.0.1' + PKG_BUILD)
0
+ s.add_dependency('activesupport', '= 2.0.2' + PKG_BUILD)
0
 
0
   s.require_path = 'lib'
0
   s.autorequire = 'active_resource'
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@ module ActiveResource
0
   module VERSION #:nodoc:
0
     MAJOR = 2
0
     MINOR = 0
0
- TINY = 1
0
+ TINY = 2
0
 
0
     STRING = [MAJOR, MINOR, TINY].join('.')
0
   end
...
15
16
17
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
20
21
...
49
50
51
 
52
53
54
...
15
16
17
 
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
...
64
65
66
67
68
69
70
0
@@ -15,7 +15,22 @@ module ActiveSupport #:nodoc:
0
             remove_method :to_time if base.instance_methods.include?(:to_time)
0
           end
0
         end
0
-
0
+
0
+ # Convert to a formatted string - see DATE_FORMATS for predefined formats.
0
+ # You can also add your own formats to the DATE_FORMATS constant and use them with this method.
0
+ #
0
+ # This method is also aliased as <tt>to_s</tt>.
0
+ #
0
+ # === Examples:
0
+ # datetime = DateTime.civil(2007, 12, 4, 0, 0, 0, 0) # => Tue, 04 Dec 2007 00:00:00 +0000
0
+ #
0
+ # datetime.to_formatted_s(:db) # => "2007-12-04 00:00:00"
0
+ # datetime.to_s(:db) # => "2007-12-04 00:00:00"
0
+ # datetime.to_s(:number) # => "20071204000000"
0
+ # datetime.to_formatted_s(:short) # => "04 Dec 00:00"
0
+ # datetime.to_formatted_s(:long) # => "December 04, 2007 00:00"
0
+ # datetime.to_formatted_s(:long_ordinal) # => "December 4th, 2007 00:00"
0
+ # datetime.to_formatted_s(:rfc822) # => "Tue, 04 Dec 2007 00:00:00 +0000"
0
         def to_formatted_s(format = :default)
0
           if formatter =