Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
3265bbb6
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 搜索 >>
提交
3265bbb6
编写于
2月 22, 2011
作者:
J
José Valim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix tests on 1.8.
上级
839d06f5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
27 deletion
+8
-27
activesupport/test/buffered_logger_test.rb
activesupport/test/buffered_logger_test.rb
+1
-3
activesupport/test/file_watcher_test.rb
activesupport/test/file_watcher_test.rb
+7
-24
未找到文件。
activesupport/test/buffered_logger_test.rb
浏览文件 @
3265bbb6
...
...
@@ -115,11 +115,9 @@ def test_should_auto_flush_every_n_messages
def
test_should_create_the_log_directory_if_it_doesnt_exist
tmp_directory
=
File
.
join
(
File
.
dirname
(
__FILE__
),
"tmp"
)
log_file
=
File
.
join
(
tmp_directory
,
"development.log"
)
assert
!
File
.
exist?
(
tmp_directory
)
FileUtils
.
rm_rf
(
tmp_directory
)
@logger
=
Logger
.
new
(
log_file
)
assert
File
.
exist?
(
tmp_directory
)
ensure
FileUtils
.
rm_rf
(
tmp_directory
)
end
def
test_logger_should_maintain_separate_buffers_for_each_thread
...
...
activesupport/test/file_watcher_test.rb
浏览文件 @
3265bbb6
...
...
@@ -80,27 +80,10 @@ def test_overlapping_watchers
module
FSSM::Backends
class
Polling
def
initialize
(
options
=
{})
@handlers
=
[]
@latency
=
options
[
:latency
]
||
0.1
end
def
add_handler
(
handler
,
preload
=
true
)
handler
.
refresh
(
nil
,
true
)
if
preload
@handlers
<<
handler
end
def
run
begin
loop
do
start
=
Time
.
now
.
to_f
@handlers
.
each
{
|
handler
|
handler
.
refresh
}
nap_time
=
@latency
-
(
Time
.
now
.
to_f
-
start
)
sleep
nap_time
if
nap_time
>
0
end
rescue
Interrupt
end
def
initialize_with_low_latency
(
options
=
{})
initialize_without_low_latency
(
options
.
merge
(
:latency
=>
0.1
))
end
alias_method_chain
:initialize
,
:low_latency
end
end
...
...
@@ -110,10 +93,10 @@ def initialize(path, watcher)
super
monitor
=
FSSM
::
Monitor
.
new
monitor
.
path
(
path
,
'**/*'
)
do
|
monitor
|
monitor
.
update
{
|
base
,
relative
|
trigger
relative
=>
:changed
}
monitor
.
delete
{
|
base
,
relative
|
trigger
relative
=>
:deleted
}
monitor
.
create
{
|
base
,
relative
|
trigger
relative
=>
:created
}
monitor
.
path
(
path
,
'**/*'
)
do
|
p
|
p
.
update
{
|
base
,
relative
|
trigger
relative
=>
:changed
}
p
.
delete
{
|
base
,
relative
|
trigger
relative
=>
:deleted
}
p
.
create
{
|
base
,
relative
|
trigger
relative
=>
:created
}
end
@thread
=
Thread
.
new
do
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录