Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
6eb1d56a
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
6eb1d56a
编写于
1月 15, 2019
作者:
R
Rafael Mendonça França
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove deprecated `Module#reachable?` method
上级
0ce67d3c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
5 addition
and
58 deletion
+5
-58
activesupport/CHANGELOG.md
activesupport/CHANGELOG.md
+4
-0
activesupport/lib/active_support/core_ext/module.rb
activesupport/lib/active_support/core_ext/module.rb
+0
-1
activesupport/lib/active_support/core_ext/module/reachable.rb
...vesupport/lib/active_support/core_ext/module/reachable.rb
+1
-6
activesupport/test/core_ext/module/reachable_test.rb
activesupport/test/core_ext/module/reachable_test.rb
+0
-51
未找到文件。
activesupport/CHANGELOG.md
浏览文件 @
6eb1d56a
*
Remove deprecated
`Module#reachable?`
method.
*Rafael Mendonça França*
*
Remove deprecated
`#acronym_regex`
method from
`Inflections`
.
*
Remove deprecated
`#acronym_regex`
method from
`Inflections`
.
*Rafael Mendonça França*
*Rafael Mendonça França*
...
...
activesupport/lib/active_support/core_ext/module.rb
浏览文件 @
6eb1d56a
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
require
"active_support/core_ext/module/aliasing"
require
"active_support/core_ext/module/aliasing"
require
"active_support/core_ext/module/introspection"
require
"active_support/core_ext/module/introspection"
require
"active_support/core_ext/module/anonymous"
require
"active_support/core_ext/module/anonymous"
require
"active_support/core_ext/module/reachable"
require
"active_support/core_ext/module/attribute_accessors"
require
"active_support/core_ext/module/attribute_accessors"
require
"active_support/core_ext/module/attribute_accessors_per_thread"
require
"active_support/core_ext/module/attribute_accessors_per_thread"
require
"active_support/core_ext/module/attr_internal"
require
"active_support/core_ext/module/attr_internal"
...
...
activesupport/lib/active_support/core_ext/module/reachable.rb
浏览文件 @
6eb1d56a
...
@@ -3,9 +3,4 @@
...
@@ -3,9 +3,4 @@
require
"active_support/core_ext/module/anonymous"
require
"active_support/core_ext/module/anonymous"
require
"active_support/core_ext/string/inflections"
require
"active_support/core_ext/string/inflections"
class
Module
ActiveSupport
::
Deprecation
.
warn
(
"reachable is deprecated and will be removed from the framework."
)
def
reachable?
#:nodoc:
!
anonymous?
&&
name
.
safe_constantize
.
equal?
(
self
)
end
deprecate
:reachable?
end
activesupport/test/core_ext/module/reachable_test.rb
已删除
100644 → 0
浏览文件 @
0ce67d3c
# frozen_string_literal: true
require
"abstract_unit"
require
"active_support/core_ext/module/reachable"
class
AnonymousTest
<
ActiveSupport
::
TestCase
test
"an anonymous class or module is not reachable"
do
assert_deprecated
do
assert_not_predicate
Module
.
new
,
:reachable?
assert_not_predicate
Class
.
new
,
:reachable?
end
end
test
"ordinary named classes or modules are reachable"
do
assert_deprecated
do
assert_predicate
Kernel
,
:reachable?
assert_predicate
Object
,
:reachable?
end
end
test
"a named class or module whose constant has gone is not reachable"
do
c
=
eval
"class C; end; C"
m
=
eval
"module M; end; M"
self
.
class
.
send
(
:remove_const
,
:C
)
self
.
class
.
send
(
:remove_const
,
:M
)
assert_deprecated
do
assert_not_predicate
c
,
:reachable?
assert_not_predicate
m
,
:reachable?
end
end
test
"a named class or module whose constants store different objects are not reachable"
do
c
=
eval
"class C; end; C"
m
=
eval
"module M; end; M"
self
.
class
.
send
(
:remove_const
,
:C
)
self
.
class
.
send
(
:remove_const
,
:M
)
eval
"class C; end"
eval
"module M; end"
assert_deprecated
do
assert_predicate
C
,
:reachable?
assert_predicate
M
,
:reachable?
assert_not_predicate
c
,
:reachable?
assert_not_predicate
m
,
:reachable?
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录