Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
20cdaddf
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,发现更多精彩内容 >>
提交
20cdaddf
编写于
11月 08, 2009
作者:
J
Jeremy Kemper
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Ruby 1.9.2: work around changes to flatten and nil.to_str
上级
7ad461b4
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
23 addition
and
17 deletion
+23
-17
activesupport/lib/active_support/cache.rb
activesupport/lib/active_support/cache.rb
+2
-1
activesupport/lib/active_support/core_ext/hash/conversions.rb
...vesupport/lib/active_support/core_ext/hash/conversions.rb
+2
-1
activesupport/lib/active_support/dependencies.rb
activesupport/lib/active_support/dependencies.rb
+1
-1
activesupport/lib/active_support/deprecated_callbacks.rb
activesupport/lib/active_support/deprecated_callbacks.rb
+3
-2
activesupport/lib/active_support/json/backends/jsongem.rb
activesupport/lib/active_support/json/backends/jsongem.rb
+12
-9
activesupport/test/multibyte_chars_test.rb
activesupport/test/multibyte_chars_test.rb
+3
-3
未找到文件。
activesupport/lib/active_support/cache.rb
浏览文件 @
20cdaddf
...
...
@@ -43,7 +43,8 @@ module Strategy
# ActiveSupport::Cache.lookup_store(MyOwnCacheStore.new)
# # => returns MyOwnCacheStore.new
def
self
.
lookup_store
(
*
store_option
)
store
,
*
parameters
=
*
([
store_option
].
flatten
)
store
=
store_option
.
shift
parameters
=
store_option
case
store
when
Symbol
...
...
activesupport/lib/active_support/core_ext/hash/conversions.rb
浏览文件 @
20cdaddf
require
'active_support/time'
require
'active_support/core_ext/array/wrap'
require
'active_support/core_ext/hash/reverse_merge'
class
Hash
...
...
@@ -138,7 +139,7 @@ def typecast_xml_value(value)
case
value
.
class
.
to_s
when
'Hash'
if
value
[
'type'
]
==
'array'
child_key
,
entries
=
value
.
detect
{
|
k
,
v
|
k
!=
'type'
}
# child_key is throwaway
child_key
,
entries
=
Array
.
wrap
(
value
.
detect
{
|
k
,
v
|
k
!=
'type'
})
# child_key is throwaway
if
entries
.
nil?
||
(
c
=
value
[
'__content__'
]
&&
c
.
blank?
)
[]
else
...
...
activesupport/lib/active_support/dependencies.rb
浏览文件 @
20cdaddf
...
...
@@ -339,7 +339,7 @@ def loadable_constants_for_path(path, bases = load_paths)
next
end
[
nesting_camel
]
end
.
flatten
.
compact
.
uniq
end
.
compact
.
flatten
.
compact
.
uniq
end
# Search for a file in load_paths matching the provided suffix.
...
...
activesupport/lib/active_support/deprecated_callbacks.rb
浏览文件 @
20cdaddf
require
'active_support/core_ext/array/extract_options'
require
'active_support/core_ext/array/wrap'
module
ActiveSupport
# Callbacks are hooks into the lifecycle of an object that allow you to trigger logic
...
...
@@ -194,8 +195,8 @@ def evaluate_method(method, *args, &block)
end
def
should_run_callback?
(
*
args
)
[
options
[
:if
]]
.
flatten
.
compact
.
all?
{
|
a
|
evaluate_method
(
a
,
*
args
)
}
&&
!
[
options
[
:unless
]]
.
flatten
.
compact
.
any?
{
|
a
|
evaluate_method
(
a
,
*
args
)
}
Array
.
wrap
(
options
[
:if
])
.
flatten
.
compact
.
all?
{
|
a
|
evaluate_method
(
a
,
*
args
)
}
&&
!
Array
.
wrap
(
options
[
:unless
])
.
flatten
.
compact
.
any?
{
|
a
|
evaluate_method
(
a
,
*
args
)
}
end
end
...
...
activesupport/lib/active_support/json/backends/jsongem.rb
浏览文件 @
20cdaddf
...
...
@@ -23,6 +23,8 @@ def decode(json)
private
def
convert_dates_from
(
data
)
case
data
when
nil
nil
when
DATE_REGEX
DateTime
.
parse
(
data
)
when
Array
...
...
@@ -31,7 +33,8 @@ def convert_dates_from(data)
data
.
each
do
|
key
,
value
|
data
[
key
]
=
convert_dates_from
(
value
)
end
else
data
else
data
end
end
end
...
...
activesupport/test/multibyte_chars_test.rb
浏览文件 @
20cdaddf
...
...
@@ -228,8 +228,8 @@ def test_should_know_if_one_includes_the_other
assert
!
@chars
.
include?
(
'a'
)
end
def
test_include_raises_
type_error_
when_nil_is_passed
assert_raise
(
TypeError
)
do
def
test_include_raises_when_nil_is_passed
assert_raise
(
RUBY_VERSION
>=
'1.9.2'
?
NoMethodError
:
TypeError
)
do
@chars
.
include?
(
nil
)
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录