Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
1979e9c8
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,发现更多精彩内容 >>
提交
1979e9c8
编写于
11月 09, 2009
作者:
X
Xavier Noria
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Symbol#to_proc is not needed for Ruby >= 1.8.7
上级
d4513ac6
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
0 addition
and
31 deletion
+0
-31
actionpack/test/controller/filters_test.rb
actionpack/test/controller/filters_test.rb
+0
-1
activerecord/lib/active_record/base.rb
activerecord/lib/active_record/base.rb
+0
-1
activeresource/test/cases/base/load_test.rb
activeresource/test/cases/base/load_test.rb
+0
-1
activesupport/lib/active_support/core_ext/symbol.rb
activesupport/lib/active_support/core_ext/symbol.rb
+0
-1
activesupport/lib/active_support/core_ext/symbol/to_proc.rb
activesupport/lib/active_support/core_ext/symbol/to_proc.rb
+0
-14
activesupport/lib/active_support/ruby/shim.rb
activesupport/lib/active_support/ruby/shim.rb
+0
-2
activesupport/test/core_ext/enumerable_test.rb
activesupport/test/core_ext/enumerable_test.rb
+0
-1
activesupport/test/core_ext/symbol_test.rb
activesupport/test/core_ext/symbol_test.rb
+0
-9
activesupport/test/dependencies_test.rb
activesupport/test/dependencies_test.rb
+0
-1
未找到文件。
actionpack/test/controller/filters_test.rb
浏览文件 @
1979e9c8
require
'abstract_unit'
require
'active_support/core_ext/symbol'
class
ActionController::Base
class
<<
self
...
...
activerecord/lib/active_record/base.rb
浏览文件 @
1979e9c8
...
...
@@ -12,7 +12,6 @@
require
'active_support/core_ext/hash/indifferent_access'
require
'active_support/core_ext/hash/slice'
require
'active_support/core_ext/string/behavior'
require
'active_support/core_ext/symbol'
require
'active_support/core_ext/object/metaclass'
module
ActiveRecord
#:nodoc:
...
...
activeresource/test/cases/base/load_test.rb
浏览文件 @
1979e9c8
require
'abstract_unit'
require
"fixtures/person"
require
"fixtures/street_address"
require
'active_support/core_ext/symbol'
require
'active_support/core_ext/hash/conversions'
module
Highrise
...
...
activesupport/lib/active_support/core_ext/symbol.rb
已删除
100644 → 0
浏览文件 @
d4513ac6
require
'active_support/core_ext/symbol/to_proc'
activesupport/lib/active_support/core_ext/symbol/to_proc.rb
已删除
100644 → 0
浏览文件 @
d4513ac6
class
Symbol
# Turns the symbol into a simple proc, which is especially useful for enumerations. Examples:
#
# # The same as people.collect { |p| p.name }
# people.collect(&:name)
#
# # The same as people.select { |p| p.manager? }.collect { |p| p.salary }
# people.select(&:manager?).collect(&:salary)
#
# This is a builtin method in Ruby 1.8.7 and later.
def
to_proc
Proc
.
new
{
|*
args
|
args
.
shift
.
__send__
(
self
,
*
args
)
}
end
unless
:to_proc
.
respond_to?
(
:to_proc
)
end
activesupport/lib/active_support/ruby/shim.rb
浏览文件 @
1979e9c8
...
...
@@ -9,7 +9,6 @@
# Process Process.daemon
# REXML security fix
# String ord
# Symbol to_proc
# Time to_date, to_time, to_datetime
require
'active_support'
require
'active_support/core_ext/date/calculations'
...
...
@@ -20,5 +19,4 @@
require
'active_support/core_ext/process/daemon'
require
'active_support/core_ext/string/conversions'
require
'active_support/core_ext/rexml'
require
'active_support/core_ext/symbol/to_proc'
require
'active_support/core_ext/time/conversions'
activesupport/test/core_ext/enumerable_test.rb
浏览文件 @
1979e9c8
require
'abstract_unit'
require
'active_support/core_ext/array'
require
'active_support/core_ext/symbol'
require
'active_support/core_ext/enumerable'
Payment
=
Struct
.
new
(
:price
)
...
...
activesupport/test/core_ext/symbol_test.rb
已删除
100644 → 0
浏览文件 @
d4513ac6
require
'abstract_unit'
class
SymbolTests
<
Test
::
Unit
::
TestCase
def
test_to_proc
assert_equal
%w(one two three)
,
[
:one
,
:two
,
:three
].
map
(
&
:to_s
)
assert_equal
(
%w(one two three)
,
{
1
=>
"one"
,
2
=>
"two"
,
3
=>
"three"
}.
sort_by
(
&
:first
).
map
(
&
:last
))
end
end
activesupport/test/dependencies_test.rb
浏览文件 @
1979e9c8
...
...
@@ -3,7 +3,6 @@
require
'active_support/dependencies'
require
'active_support/core_ext/module/loading'
require
'active_support/core_ext/kernel/reporting'
require
'active_support/core_ext/symbol/to_proc'
module
ModuleWithMissing
mattr_accessor
:missing_count
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录