Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
48bb3b39
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
48bb3b39
编写于
3月 04, 2010
作者:
C
Carlhuda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move stuff from compatibility.rb to deprecated.rb
上级
5e3e5ac1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
125 addition
and
127 deletion
+125
-127
actionpack/lib/action_controller/base.rb
actionpack/lib/action_controller/base.rb
+2
-0
actionpack/lib/action_controller/deprecated/base.rb
actionpack/lib/action_controller/deprecated/base.rb
+118
-0
actionpack/lib/action_controller/metal/compatibility.rb
actionpack/lib/action_controller/metal/compatibility.rb
+5
-126
actionpack/test/template/asset_tag_helper_test.rb
actionpack/test/template/asset_tag_helper_test.rb
+0
-1
未找到文件。
actionpack/lib/action_controller/base.rb
浏览文件 @
48bb3b39
...
...
@@ -60,3 +60,5 @@ def self.filter_parameter_logging(*args, &block)
end
end
require
"action_controller/deprecated/base"
actionpack/lib/action_controller/deprecated/base.rb
0 → 100644
浏览文件 @
48bb3b39
module
ActionController
class
Base
class
<<
self
def
deprecated_config_accessor
(
option
,
message
=
nil
)
deprecated_config_reader
(
option
,
message
)
deprecated_config_writer
(
option
,
message
)
end
def
deprecated_config_reader
(
option
,
message
=
nil
)
message
||=
"Reading
#{
option
}
directly from ActionController::Base is deprecated. "
\
"Please read it from config.
#{
option
}
"
self
.
class_eval
<<-
RUBY
,
__FILE__
,
__LINE__
+
1
def
#{
option
}
ActiveSupport::Deprecation.warn
#{
message
.
inspect
}
, caller
config.
#{
option
}
end
RUBY
end
def
deprecated_config_writer
(
option
,
message
=
nil
)
message
||=
"Setting
#{
option
}
directly on ActionController::Base is deprecated. "
\
"Please set it on config.action_controller.
#{
option
}
"
self
.
class_eval
<<-
RUBY
,
__FILE__
,
__LINE__
+
1
def
#{
option
}
=(val)
ActiveSupport::Deprecation.warn
#{
message
.
inspect
}
, caller
config.
#{
option
}
= val
end
RUBY
end
def
consider_all_requests_local
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.consider_all_requests_local is deprecated, "
<<
"use Rails.application.config.consider_all_requests_local instead"
,
caller
Rails
.
application
.
config
.
consider_all_requests_local
end
def
consider_all_requests_local
=
(
value
)
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.consider_all_requests_local= is deprecated. "
<<
"Please configure it on your application with config.consider_all_requests_local="
,
caller
Rails
.
application
.
config
.
consider_all_requests_local
=
value
end
def
allow_concurrency
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.allow_concurrency is deprecated, "
<<
"use Rails.application.config.allow_concurrency instead"
,
caller
Rails
.
application
.
config
.
allow_concurrency
end
def
allow_concurrency
=
(
value
)
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.allow_concurrency= is deprecated. "
<<
"Please configure it on your application with config.allow_concurrency="
,
caller
Rails
.
application
.
config
.
allow_concurrency
=
value
end
def
ip_spoofing_check
=
(
value
)
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.ip_spoofing_check= is deprecated. "
<<
"Please configure it on your application with config.action_dispatch.ip_spoofing_check="
,
caller
Rails
.
application
.
config
.
action_disaptch
.
ip_spoofing_check
=
value
end
def
ip_spoofing_check
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.ip_spoofing_check is deprecated. "
<<
"Configuring ip_spoofing_check on the application configures a middleware."
,
caller
Rails
.
application
.
config
.
action_disaptch
.
ip_spoofing_check
end
def
trusted_proxies
=
(
value
)
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.trusted_proxies= is deprecated. "
<<
"Please configure it on your application with config.action_dispatch.trusted_proxies="
,
caller
Rails
.
application
.
config
.
action_dispatch
.
ip_spoofing_check
=
value
end
def
trusted_proxies
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.trusted_proxies is deprecated. "
<<
"Configuring trusted_proxies on the application configures a middleware."
,
caller
Rails
.
application
.
config
.
action_dispatch
.
ip_spoofing_check
=
value
end
def
session
=
(
value
)
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.session= is deprecated. "
<<
"Please configure it on your application with config.action_dispatch.session="
,
caller
Rails
.
application
.
config
.
action_dispatch
.
session
=
value
.
delete
(
:disabled
)
?
nil
:
value
end
# Controls the resource action separator
def
resource_action_separator
@resource_action_separator
||=
"/"
end
def
resource_action_separator
=
(
val
)
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.resource_action_separator is deprecated and only "
\
"works with the deprecated router DSL."
@resource_action_separator
=
val
end
def
use_accept_header
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.use_accept_header doesn't do anything anymore. "
\
"The accept header is always taken into account."
end
def
use_accept_header
=
(
val
)
use_accept_header
end
end
deprecated_config_writer
:session_store
deprecated_config_writer
:session_options
deprecated_config_accessor
:relative_url_root
,
"relative_url_root is ineffective. Please stop using it"
deprecated_config_accessor
:assets_dir
deprecated_config_accessor
:javascripts_dir
deprecated_config_accessor
:stylesheets_dir
delegate
:consider_all_requests_local
,
:consider_all_requests_local
=
,
:allow_concurrency
,
:allow_concurrency
=
,
:to
=>
:"self.class"
end
end
\ No newline at end of file
actionpack/lib/action_controller/metal/compatibility.rb
浏览文件 @
48bb3b39
...
...
@@ -31,75 +31,22 @@ class << self
@before_filter_chain_aborted @_headers @_params
@_response)
# Controls the resource action separator
def
self
.
resource_action_separator
@resource_action_separator
||=
"/"
end
def
self
.
resource_action_separator
=
(
val
)
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.resource_action_separator is deprecated and only "
\
"works with the deprecated router DSL."
@resource_action_separator
=
val
end
def
self
.
use_accept_header
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.use_accept_header doesn't do anything anymore. "
\
"The accept header is always taken into account."
def
rescue_action
(
env
)
raise
env
[
"action_dispatch.rescue.exception"
]
end
def
self
.
use_accept_header
=
(
val
)
use_accept_header
# Defines the storage option for cached fragments
def
cache_store
=
(
store_option
)
@@cache_store
=
ActiveSupport
::
Cache
.
lookup_store
(
store_option
)
end
self
.
page_cache_directory
=
defined?
(
Rails
.
public_path
)
?
Rails
.
public_path
:
""
# Prepends all the URL-generating helpers from AssetHelper. This makes it possible to easily move javascripts, stylesheets,
# and images to a dedicated asset server away from the main web server. Example:
# ActionController::Base.asset_host = "http://assets.example.com"
cattr_accessor
:asset_host
end
def
self
.
deprecated_config_accessor
(
option
,
message
=
nil
)
deprecated_config_reader
(
option
,
message
)
deprecated_config_writer
(
option
,
message
)
end
def
self
.
deprecated_config_reader
(
option
,
message
=
nil
)
message
||=
"Reading
#{
option
}
directly from ActionController::Base is deprecated. "
\
"Please read it from config.
#{
option
}
"
ClassMethods
.
class_eval
<<-
RUBY
,
__FILE__
,
__LINE__
+
1
def
#{
option
}
ActiveSupport::Deprecation.warn
#{
message
.
inspect
}
, caller
config.
#{
option
}
end
RUBY
end
def
self
.
deprecated_config_writer
(
option
,
message
=
nil
)
message
||=
"Setting
#{
option
}
directly on ActionController::Base is deprecated. "
\
"Please set it on config.action_controller.
#{
option
}
"
ClassMethods
.
class_eval
<<-
RUBY
,
__FILE__
,
__LINE__
+
1
def
#{
option
}
=(val)
ActiveSupport::Deprecation.warn
#{
message
.
inspect
}
, caller
config.
#{
option
}
= val
end
RUBY
end
deprecated_config_writer
:session_store
deprecated_config_writer
:session_options
deprecated_config_accessor
:relative_url_root
,
"relative_url_root is ineffective. Please stop using it"
deprecated_config_accessor
:assets_dir
deprecated_config_accessor
:javascripts_dir
deprecated_config_accessor
:stylesheets_dir
# For old tests
def
initialize_template_class
(
*
)
end
def
assign_shortcuts
(
*
)
end
# TODO: Remove this after we flip
def
template
@template
||=
view_context
end
...
...
@@ -109,74 +56,6 @@ def process_action(*)
super
end
module
ClassMethods
def
consider_all_requests_local
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.consider_all_requests_local is deprecated, "
<<
"use Rails.application.config.consider_all_requests_local instead"
,
caller
Rails
.
application
.
config
.
consider_all_requests_local
end
def
consider_all_requests_local
=
(
value
)
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.consider_all_requests_local= is deprecated. "
<<
"Please configure it on your application with config.consider_all_requests_local="
,
caller
Rails
.
application
.
config
.
consider_all_requests_local
=
value
end
def
allow_concurrency
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.allow_concurrency is deprecated, "
<<
"use Rails.application.config.allow_concurrency instead"
,
caller
Rails
.
application
.
config
.
allow_concurrency
end
def
allow_concurrency
=
(
value
)
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.allow_concurrency= is deprecated. "
<<
"Please configure it on your application with config.allow_concurrency="
,
caller
Rails
.
application
.
config
.
allow_concurrency
=
value
end
def
ip_spoofing_check
=
(
value
)
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.ip_spoofing_check= is deprecated. "
<<
"Please configure it on your application with config.action_dispatch.ip_spoofing_check="
,
caller
Rails
.
application
.
config
.
action_disaptch
.
ip_spoofing_check
=
value
end
def
ip_spoofing_check
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.ip_spoofing_check is deprecated. "
<<
"Configuring ip_spoofing_check on the application configures a middleware."
,
caller
Rails
.
application
.
config
.
action_disaptch
.
ip_spoofing_check
end
def
trusted_proxies
=
(
value
)
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.trusted_proxies= is deprecated. "
<<
"Please configure it on your application with config.action_dispatch.trusted_proxies="
,
caller
Rails
.
application
.
config
.
action_dispatch
.
ip_spoofing_check
=
value
end
def
trusted_proxies
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.trusted_proxies is deprecated. "
<<
"Configuring trusted_proxies on the application configures a middleware."
,
caller
Rails
.
application
.
config
.
action_dispatch
.
ip_spoofing_check
=
value
end
def
session
=
(
value
)
ActiveSupport
::
Deprecation
.
warn
"ActionController::Base.session= is deprecated. "
<<
"Please configure it on your application with config.action_dispatch.session="
,
caller
Rails
.
application
.
config
.
action_dispatch
.
session
=
value
.
delete
(
:disabled
)
?
nil
:
value
end
def
rescue_action
(
env
)
raise
env
[
"action_dispatch.rescue.exception"
]
end
# Defines the storage option for cached fragments
def
cache_store
=
(
store_option
)
@@cache_store
=
ActiveSupport
::
Cache
.
lookup_store
(
store_option
)
end
end
delegate
:consider_all_requests_local
,
:consider_all_requests_local
=
,
:allow_concurrency
,
:allow_concurrency
=
,
:to
=>
:"self.class"
def
render_to_body
(
options
)
if
options
.
is_a?
(
Hash
)
&&
options
.
key?
(
:template
)
options
[
:template
].
sub!
(
/^\//
,
''
)
...
...
actionpack/test/template/asset_tag_helper_test.rb
浏览文件 @
48bb3b39
...
...
@@ -51,7 +51,6 @@ def host_with_port() 'localhost' end
def
teardown
ActionController
::
Base
.
perform_caching
=
false
ActionController
::
Base
.
asset_host
=
nil
ENV
.
delete
(
'RAILS_ASSET_ID'
)
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录