Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
6dd19691
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,发现更多精彩内容 >>
提交
6dd19691
编写于
6月 20, 2009
作者:
J
José Valim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove class level conditions and ensure that RAILS_GEM_VERSION is commented when freeze.
上级
2c3ebc00
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
8 addition
and
8 deletion
+8
-8
railties/lib/generator/generators/app.rb
railties/lib/generator/generators/app.rb
+6
-7
railties/test/generator/app_test.rb
railties/test/generator/app_test.rb
+2
-1
未找到文件。
railties/lib/generator/generators/app.rb
浏览文件 @
6dd19691
...
...
@@ -79,8 +79,8 @@ def create_config_files
end
end
conditions
:skip_activerecord
=>
false
def
create_activerecord_files
return
if
options
[
:skip_activerecord
]
template
"config/databases/
#{
options
[
:database
]
}
.yml"
,
"config/database.yml"
end
...
...
@@ -112,8 +112,8 @@ def create_public_files
directory
"public"
,
"public"
,
false
# Non-recursive. Do small steps, so anyone can overwrite it.
end
conditions
:with_dispatchers
=>
true
def
create_dispatch_files
return
unless
options
[
:with_dispatchers
]
copy_file
"dispatchers/config.ru"
,
"config.ru"
template
"dispatchers/dispatch.rb"
,
"public/dispatch.rb"
...
...
@@ -134,8 +134,8 @@ def create_public_stylesheets_files
directory
"public/stylesheets"
end
conditions
:skip_prototype
=>
false
def
create_prototype_files
return
if
options
[
:skip_prototype
]
directory
"public/javascripts"
end
...
...
@@ -144,8 +144,8 @@ def create_script_files
chmod
"script"
,
0755
,
false
end
conditions
:skip_testunit
=>
false
def
create_test_files
return
if
options
[
:skip_testunit
]
directory
"test"
end
...
...
@@ -169,9 +169,8 @@ def apply_rails_template
raise
Error
,
"The template [
#{
options
[
:template
]
}
] could not be loaded. Error:
#{
e
}
"
end
conditions
:freeze
=>
true
def
vendorize_rails
freeze
!
def
freeze?
freeze
!
if
options
[
:freeze
]
end
protected
...
...
railties/test/generator/app_test.rb
浏览文件 @
6dd19691
...
...
@@ -98,9 +98,10 @@ def test_shebang_is_added_to_files
)
.
each
{
|
path
|
assert_file
"script/
#{
path
}
"
,
/#!foo\/bar\/baz/
}
end
def
test_rails_is_
vendorized_if_freeze_is_supplied
def
test_rails_is_
frozen
generator
(
:freeze
=>
true
,
:database
=>
"sqlite3"
).
expects
(
:run
).
with
(
"rake rails:freeze:edge"
,
false
)
silence
(
:stdout
){
generator
.
invoke
(
:all
)
}
assert_file
'config/environment.rb'
,
/# RAILS_GEM_VERSION/
end
def
test_template_raises_an_error_with_invalid_path
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录