Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
692fab26
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,发现更多精彩内容 >>
提交
692fab26
编写于
8月 15, 2017
作者:
R
Rafael França
提交者:
GitHub
8月 15, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #30238 from bogdanvlviv/add-skip_yarn-for-plugin_generator
Add `--skip-yarn` option to the plugin generator
上级
d8bf5d73
1a1f319c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
43 addition
and
28 deletion
+43
-28
railties/CHANGELOG.md
railties/CHANGELOG.md
+4
-0
railties/lib/rails/generators/rails/app/templates/gitignore
railties/lib/rails/generators/rails/app/templates/gitignore
+0
-1
railties/lib/rails/generators/rails/plugin/plugin_generator.rb
...ies/lib/rails/generators/rails/plugin/plugin_generator.rb
+1
-1
railties/lib/rails/generators/rails/plugin/templates/gitignore
...ies/lib/rails/generators/rails/plugin/templates/gitignore
+4
-0
railties/test/generators/app_generator_test.rb
railties/test/generators/app_generator_test.rb
+0
-26
railties/test/generators/plugin_generator_test.rb
railties/test/generators/plugin_generator_test.rb
+4
-0
railties/test/generators/shared_generator_tests.rb
railties/test/generators/shared_generator_tests.rb
+30
-0
未找到文件。
railties/CHANGELOG.md
浏览文件 @
692fab26
*
Add
`--skip-yarn`
option to the plugin generator.
*bogdanvlviv*
*
Optimize routes indentation.
*Yoshiyuki Hirano*
...
...
railties/lib/rails/generators/rails/app/templates/gitignore
浏览文件 @
692fab26
...
...
@@ -27,7 +27,6 @@
<% unless options.skip_yarn? -%>
/node_modules
/yarn-error.log
<% end -%>
<% unless options.api? -%>
...
...
railties/lib/rails/generators/rails/plugin/plugin_generator.rb
浏览文件 @
692fab26
...
...
@@ -89,7 +89,7 @@ def test
PASSTHROUGH_OPTIONS
=
[
:skip_active_record
,
:skip_action_mailer
,
:skip_javascript
,
:skip_action_cable
,
:skip_sprockets
,
:database
,
:javascript
,
:api
,
:quiet
,
:pretend
,
:skip
:javascript
,
:
skip_yarn
,
:
api
,
:quiet
,
:pretend
,
:skip
]
def
generate_test_dummy
(
force
=
false
)
...
...
railties/lib/rails/generators/rails/plugin/templates/gitignore
浏览文件 @
692fab26
...
...
@@ -5,5 +5,9 @@ pkg/
<%= dummy_path %>/db/*.sqlite3
<%= dummy_path %>/db/*.sqlite3-journal
<%= dummy_path %>/log/*.log
<% unless options[:skip_yarn] -%>
<%= dummy_path %>/node_modules/
<%= dummy_path %>/yarn-error.log
<% end -%>
<%= dummy_path %>/tmp/
<% end -%>
railties/test/generators/app_generator_test.rb
浏览文件 @
692fab26
...
...
@@ -584,32 +584,6 @@ def test_coffeescript_is_skipped_if_required
end
end
def
test_generator_for_yarn
run_generator
([
destination_root
])
assert_file
"package.json"
,
/dependencies/
assert_file
"config/initializers/assets.rb"
,
/node_modules/
assert_file
".gitignore"
do
|
content
|
assert_match
(
/node_modules/
,
content
)
assert_match
(
/yarn-error\.log/
,
content
)
end
end
def
test_generator_for_yarn_skipped
run_generator
([
destination_root
,
"--skip-yarn"
])
assert_no_file
"package.json"
assert_no_file
"bin/yarn"
assert_file
"config/initializers/assets.rb"
do
|
content
|
assert_no_match
(
/node_modules/
,
content
)
end
assert_file
".gitignore"
do
|
content
|
assert_no_match
(
/node_modules/
,
content
)
assert_no_match
(
/yarn-error\.log/
,
content
)
end
end
def
test_inclusion_of_jbuilder
run_generator
assert_gem
"jbuilder"
...
...
railties/test/generators/plugin_generator_test.rb
浏览文件 @
692fab26
...
...
@@ -26,6 +26,10 @@ class PluginGeneratorTest < Rails::Generators::TestCase
destination
File
.
join
(
Rails
.
root
,
"tmp/bukkits"
)
arguments
[
destination_root
]
def
application_path
"
#{
destination_root
}
/test/dummy"
end
# brings setup, teardown, and some tests
include
SharedGeneratorTests
...
...
railties/test/generators/shared_generator_tests.rb
浏览文件 @
692fab26
...
...
@@ -22,6 +22,10 @@ def teardown
Rails
.
application
=
TestApp
::
Application
.
instance
end
def
application_path
destination_root
end
def
test_skeleton_is_created
run_generator
...
...
@@ -123,4 +127,30 @@ def test_skip_keeps
assert_no_file
(
"app/models/concerns/.keep"
)
end
def
test_generator_for_yarn
run_generator
assert_file
"
#{
application_path
}
/package.json"
,
/dependencies/
assert_file
"
#{
application_path
}
/config/initializers/assets.rb"
,
/node_modules/
assert_file
".gitignore"
do
|
content
|
assert_match
(
/node_modules/
,
content
)
assert_match
(
/yarn-error\.log/
,
content
)
end
end
def
test_generator_for_yarn_skipped
run_generator
([
destination_root
,
"--skip-yarn"
])
assert_no_file
"
#{
application_path
}
/package.json"
assert_no_file
"
#{
application_path
}
/bin/yarn"
assert_file
"
#{
application_path
}
/config/initializers/assets.rb"
do
|
content
|
assert_no_match
(
/node_modules/
,
content
)
end
assert_file
".gitignore"
do
|
content
|
assert_no_match
(
/node_modules/
,
content
)
assert_no_match
(
/yarn-error\.log/
,
content
)
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录