Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
861e7d43
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,发现更多精彩内容 >>
提交
861e7d43
编写于
2月 28, 2016
作者:
Y
yuuji.yaginuma
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
convert cable.coffee to cable.js
In order to eliminate the dependecy of CoffeeScript.
上级
65b2cfad
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
17 addition
and
13 deletion
+17
-13
actioncable/lib/rails/generators/channel/USAGE
actioncable/lib/rails/generators/channel/USAGE
+1
-1
railties/lib/rails/generators/rails/app/app_generator.rb
railties/lib/rails/generators/rails/app/app_generator.rb
+1
-1
railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee
...s/rails/app/templates/app/assets/javascripts/cable.coffee
+0
-9
railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.js
...ators/rails/app/templates/app/assets/javascripts/cable.js
+13
-0
railties/test/application/rake_test.rb
railties/test/application/rake_test.rb
+1
-1
railties/test/generators/app_generator_test.rb
railties/test/generators/app_generator_test.rb
+1
-1
未找到文件。
actioncable/lib/rails/generators/channel/USAGE
浏览文件 @
861e7d43
...
@@ -3,7 +3,7 @@ Description:
...
@@ -3,7 +3,7 @@ Description:
Stubs out a new cable channel for the server (in Ruby) and client (in CoffeeScript).
Stubs out a new cable channel for the server (in Ruby) and client (in CoffeeScript).
Pass the channel name, either CamelCased or under_scored, and an optional list of channel actions as arguments.
Pass the channel name, either CamelCased or under_scored, and an optional list of channel actions as arguments.
Note: Turn on the cable connection in app/assets/javascript/cable.
coffee
after generating any channels.
Note: Turn on the cable connection in app/assets/javascript/cable.
js
after generating any channels.
Example:
Example:
========
========
...
...
railties/lib/rails/generators/rails/app/app_generator.rb
浏览文件 @
861e7d43
...
@@ -332,7 +332,7 @@ def delete_active_record_initializers_skipping_active_record
...
@@ -332,7 +332,7 @@ def delete_active_record_initializers_skipping_active_record
def
delete_action_cable_files_skipping_action_cable
def
delete_action_cable_files_skipping_action_cable
if
options
[
:skip_action_cable
]
if
options
[
:skip_action_cable
]
remove_file
'config/cable.yml'
remove_file
'config/cable.yml'
remove_file
'app/assets/javascripts/cable.
coffee
'
remove_file
'app/assets/javascripts/cable.
js
'
remove_dir
'app/channels'
remove_dir
'app/channels'
end
end
end
end
...
...
railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee
已删除
100644 → 0
浏览文件 @
65b2cfad
# Action Cable provides the framework to deal with WebSockets in Rails.
# You can generate new channels where WebSocket features live using the rails generate channel command.
#
#= require action_cable
#= require_self
#= require_tree ./channels
@
App
||=
{}
App
.
cable
=
ActionCable
.
createConsumer
()
railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.js
0 → 100644
浏览文件 @
861e7d43
// Action Cable provides the framework to deal with WebSockets in Rails.
// You can generate new channels where WebSocket features live using the rails generate channel command.
//
//= require action_cable
//= require_self
//= require_tree ./channels
(
function
()
{
this
.
App
||
(
this
.
App
=
{});
App
.
cable
=
ActionCable
.
createConsumer
();
}).
call
(
this
);
railties/test/application/rake_test.rb
浏览文件 @
861e7d43
...
@@ -118,7 +118,7 @@ def test_should_not_eager_load_model_for_rake
...
@@ -118,7 +118,7 @@ def test_should_not_eager_load_model_for_rake
end
end
def
test_code_statistics_sanity
def
test_code_statistics_sanity
assert_match
"Code LOC: 1
6
Test LOC: 0 Code to Test Ratio: 1:0.0"
,
assert_match
"Code LOC: 1
8
Test LOC: 0 Code to Test Ratio: 1:0.0"
,
Dir
.
chdir
(
app_path
){
`bin/rails stats`
}
Dir
.
chdir
(
app_path
){
`bin/rails stats`
}
end
end
...
...
railties/test/generators/app_generator_test.rb
浏览文件 @
861e7d43
...
@@ -463,7 +463,7 @@ def test_generator_if_skip_action_cable_is_given
...
@@ -463,7 +463,7 @@ def test_generator_if_skip_action_cable_is_given
run_generator
[
destination_root
,
"--skip-action-cable"
]
run_generator
[
destination_root
,
"--skip-action-cable"
]
assert_file
"config/application.rb"
,
/#\s+require\s+["']action_cable\/engine["']/
assert_file
"config/application.rb"
,
/#\s+require\s+["']action_cable\/engine["']/
assert_no_file
"config/cable.yml"
assert_no_file
"config/cable.yml"
assert_no_file
"app/assets/javascripts/cable.
coffee
"
assert_no_file
"app/assets/javascripts/cable.
js
"
assert_no_file
"app/channels"
assert_no_file
"app/channels"
assert_file
"Gemfile"
do
|
content
|
assert_file
"Gemfile"
do
|
content
|
assert_no_match
(
/redis/
,
content
)
assert_no_match
(
/redis/
,
content
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录