railties 3.0.5 → 3.0.6.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +15 -0
- data/guides/source/active_support_core_extensions.textile +9 -1
- data/guides/source/routing.textile +6 -0
- data/lib/rails/application.rb +3 -2
- data/lib/rails/generators/actions.rb +4 -3
- data/lib/rails/rack/logger.rb +1 -1
- data/lib/rails/version.rb +2 -2
- metadata +24 -16
data/CHANGELOG
CHANGED
@@ -2810,6 +2810,8 @@ h5. +Date.current+
|
|
2810
2810
|
|
2811
2811
|
Active Support defines +Date.current+ to be today in the current time zone. That's like +Date.today+, except that it honors the user time zone, if defined. It also defines +Date.yesterday+ and +Date.tomorrow+, and the instance predicates +past?+, +today?+, and +future?+, all of them relative to +Date.current+.
|
2812
2812
|
|
2813
|
+
When making Date comparisons using methods which honor the user time zone, make sure to use +Date.current+ and not +Date.today+. There are cases where the user time zone might be in the future compared to the system time zone, which +Date.today+ uses by default. This means +Date.today+ may equal +Date.yesterday+.
|
2814
|
+
|
2813
2815
|
h5. Named dates
|
2814
2816
|
|
2815
2817
|
h6. +prev_year+, +next_year+
|
@@ -3105,7 +3107,7 @@ h5. Named Datetimes
|
|
3105
3107
|
|
3106
3108
|
h6. +DateTime.current+
|
3107
3109
|
|
3108
|
-
Active Support defines +DateTime.current+ to be like +Time.now.to_datetime+, except that it honors the user time zone, if defined. It also defines instance predicates +past?+, and +future?+ relative to +DateTime.current+.
|
3110
|
+
Active Support defines +DateTime.current+ to be like +Time.now.to_datetime+, except that it honors the user time zone, if defined. It also defines +DateTime.yesterday+ and +DateTime.tomorrow+, and the instance predicates +past?+, and +future?+ relative to +DateTime.current+.
|
3109
3111
|
|
3110
3112
|
h5. Other Extensions
|
3111
3113
|
|
@@ -3280,6 +3282,12 @@ t.advance(:seconds => 1)
|
|
3280
3282
|
|
3281
3283
|
* If +since+ or +ago+ jump to a time that can't be expressed with +Time+ a +DateTime+ object is returned instead.
|
3282
3284
|
|
3285
|
+
h5. +Time.current+
|
3286
|
+
|
3287
|
+
Active Support defines +Time.current+ to be today in the current time zone. That's like +Time.now+, except that it honors the user time zone, if defined. It also defines +Time.yesterday+ and +Time.tomorrow+, and the instance predicates +past?+, +today?+, and +future?+, all of them relative to +Time.current+.
|
3288
|
+
|
3289
|
+
When making Time comparisons using methods which honor the user time zone, make sure to use +Time.current+ and not +Time.now+. There are cases where the user time zone might be in the future compared to the system time zone, which +Time.today+ uses by default. This means +Time.now+ may equal +Time.yesterday+.
|
3290
|
+
|
3283
3291
|
h4. Time Constructors
|
3284
3292
|
|
3285
3293
|
Active Support defines +Time.current+ to be +Time.zone.now+ if there's a user time zone defined, with fallback to +Time.now+:
|
@@ -554,6 +554,12 @@ match '*a/foo/*b' => 'test#index'
|
|
554
554
|
|
555
555
|
would match +zoo/woo/foo/bar/baz+ with +params[:a]+ equals +"zoo/woo"+, and +params[:b]+ equals +"bar/baz"+.
|
556
556
|
|
557
|
+
NOTE: If the wildcard segment is the last segment of the route, the format segment will not be added to the path unless you explicitly specify it as a constraint.
|
558
|
+
|
559
|
+
<ruby>
|
560
|
+
match '/:path(.:format)', :to => 'pages#show', :constraints => { :path => /.+?/ }
|
561
|
+
</ruby>
|
562
|
+
|
557
563
|
h4. Redirection
|
558
564
|
|
559
565
|
You can redirect any path to another path using the +redirect+ helper in your router:
|
data/lib/rails/application.rb
CHANGED
@@ -171,7 +171,8 @@ module Rails
|
|
171
171
|
def env_defaults
|
172
172
|
@env_defaults ||= {
|
173
173
|
"action_dispatch.parameter_filter" => config.filter_parameters,
|
174
|
-
"action_dispatch.secret_token" => config.secret_token
|
174
|
+
"action_dispatch.secret_token" => config.secret_token,
|
175
|
+
"action_dispatch.show_exceptions" => config.action_dispatch.show_exceptions
|
175
176
|
}
|
176
177
|
end
|
177
178
|
|
@@ -191,7 +192,7 @@ module Rails
|
|
191
192
|
middleware.use ::Rack::Lock if !config.allow_concurrency
|
192
193
|
middleware.use ::Rack::Runtime
|
193
194
|
middleware.use ::Rails::Rack::Logger
|
194
|
-
middleware.use ::ActionDispatch::ShowExceptions, config.consider_all_requests_local
|
195
|
+
middleware.use ::ActionDispatch::ShowExceptions, config.consider_all_requests_local
|
195
196
|
middleware.use ::ActionDispatch::RemoteIp, config.action_dispatch.ip_spoofing_check, config.action_dispatch.trusted_proxies
|
196
197
|
middleware.use ::Rack::Sendfile, config.action_dispatch.x_sendfile_header
|
197
198
|
middleware.use ::ActionDispatch::Callbacks, !config.cache_classes
|
@@ -289,17 +289,18 @@ module Rails
|
|
289
289
|
# readme "README"
|
290
290
|
#
|
291
291
|
def readme(path)
|
292
|
-
|
292
|
+
log File.read(find_in_source_paths(path))
|
293
293
|
end
|
294
294
|
|
295
295
|
protected
|
296
296
|
|
297
297
|
# Define log for backwards compatibility. If just one argument is sent,
|
298
|
-
# invoke say, otherwise invoke say_status.
|
298
|
+
# invoke say, otherwise invoke say_status. Differently from say and
|
299
|
+
# similarly to say_status, this method respects the quiet? option given.
|
299
300
|
#
|
300
301
|
def log(*args)
|
301
302
|
if args.size == 1
|
302
|
-
say args.first.to_s
|
303
|
+
say args.first.to_s unless options.quiet?
|
303
304
|
else
|
304
305
|
args << (self.behavior == :invoke ? :green : :red)
|
305
306
|
say_status *args
|
data/lib/rails/rack/logger.rb
CHANGED
@@ -19,7 +19,7 @@ module Rails
|
|
19
19
|
|
20
20
|
def before_dispatch(env)
|
21
21
|
request = ActionDispatch::Request.new(env)
|
22
|
-
path = request.
|
22
|
+
path = request.filtered_path
|
23
23
|
|
24
24
|
info "\n\nStarted #{request.request_method} \"#{path}\" " \
|
25
25
|
"for #{request.ip} at #{Time.now.to_default_s}"
|
data/lib/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: railties
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 15424071
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
|
9
|
+
- 6
|
10
|
+
- rc
|
11
|
+
- 1
|
12
|
+
version: 3.0.6.rc1
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- David Heinemeier Hansson
|
@@ -15,7 +17,7 @@ autorequire:
|
|
15
17
|
bindir: bin
|
16
18
|
cert_chain: []
|
17
19
|
|
18
|
-
date: 2011-
|
20
|
+
date: 2011-03-29 00:00:00 -07:00
|
19
21
|
default_executable:
|
20
22
|
dependencies:
|
21
23
|
- !ruby/object:Gem::Dependency
|
@@ -58,12 +60,14 @@ dependencies:
|
|
58
60
|
requirements:
|
59
61
|
- - "="
|
60
62
|
- !ruby/object:Gem::Version
|
61
|
-
hash:
|
63
|
+
hash: 15424071
|
62
64
|
segments:
|
63
65
|
- 3
|
64
66
|
- 0
|
65
|
-
-
|
66
|
-
|
67
|
+
- 6
|
68
|
+
- rc
|
69
|
+
- 1
|
70
|
+
version: 3.0.6.rc1
|
67
71
|
type: :runtime
|
68
72
|
version_requirements: *id003
|
69
73
|
- !ruby/object:Gem::Dependency
|
@@ -74,12 +78,14 @@ dependencies:
|
|
74
78
|
requirements:
|
75
79
|
- - "="
|
76
80
|
- !ruby/object:Gem::Version
|
77
|
-
hash:
|
81
|
+
hash: 15424071
|
78
82
|
segments:
|
79
83
|
- 3
|
80
84
|
- 0
|
81
|
-
-
|
82
|
-
|
85
|
+
- 6
|
86
|
+
- rc
|
87
|
+
- 1
|
88
|
+
version: 3.0.6.rc1
|
83
89
|
type: :runtime
|
84
90
|
version_requirements: *id004
|
85
91
|
description: "Rails internals: application bootup, plugins, generators, and rake tasks."
|
@@ -481,16 +487,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
481
487
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
482
488
|
none: false
|
483
489
|
requirements:
|
484
|
-
- - "
|
490
|
+
- - ">"
|
485
491
|
- !ruby/object:Gem::Version
|
486
|
-
hash:
|
492
|
+
hash: 25
|
487
493
|
segments:
|
488
|
-
-
|
489
|
-
|
494
|
+
- 1
|
495
|
+
- 3
|
496
|
+
- 1
|
497
|
+
version: 1.3.1
|
490
498
|
requirements: []
|
491
499
|
|
492
500
|
rubyforge_project: rails
|
493
|
-
rubygems_version: 1.
|
501
|
+
rubygems_version: 1.6.1
|
494
502
|
signing_key:
|
495
503
|
specification_version: 3
|
496
504
|
summary: Tools for creating, working with, and running Rails applications.
|