Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
f68e7a39
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,发现更多精彩内容 >>
提交
f68e7a39
编写于
7月 13, 2009
作者:
J
José Valim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove generator environment until we have a gem manifest.
上级
21019304
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
24 addition
and
32 deletion
+24
-32
railties/lib/commands/destroy.rb
railties/lib/commands/destroy.rb
+1
-1
railties/lib/commands/generate.rb
railties/lib/commands/generate.rb
+1
-1
railties/lib/commands/update.rb
railties/lib/commands/update.rb
+1
-1
railties/lib/generators/rails/app/templates/config/environment.rb
.../lib/generators/rails/app/templates/config/environment.rb
+19
-0
railties/lib/generators/rails/app/templates/config/environments/generators.rb
...ors/rails/app/templates/config/environments/generators.rb
+0
-18
railties/lib/initializer.rb
railties/lib/initializer.rb
+2
-3
railties/test/initializer_test.rb
railties/test/initializer_test.rb
+0
-8
未找到文件。
railties/lib/commands/destroy.rb
浏览文件 @
f68e7a39
RAILS_ENV
.
replace
"generators"
require
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'generators'
))
require
"
#{
RAILS_ROOT
}
/config/environment"
if
ARGV
.
size
==
0
...
...
railties/lib/commands/generate.rb
浏览文件 @
f68e7a39
RAILS_ENV
.
replace
"generators"
require
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'generators'
))
require
"
#{
RAILS_ROOT
}
/config/environment"
if
ARGV
.
size
==
0
...
...
railties/lib/commands/update.rb
浏览文件 @
f68e7a39
RAILS_ENV
.
replace
"generators"
require
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'generators'
))
require
"
#{
RAILS_ROOT
}
/config/environment"
if
ARGV
.
size
==
0
...
...
railties/lib/generators/rails/app/templates/config/environment.rb
浏览文件 @
f68e7a39
...
...
@@ -42,4 +42,23 @@
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
# config.i18n.default_locale = :de
# Configure generators default options.
config.generators do |g|
# Scaffold configuration
g.helper = true
g.layout = true
g.stylesheets = true
# ORM configuration
g.orm = :active_record
g.timestamps = true
# Template engine configuration
g.template_engine = :erb
# Test framework configuration
g.test_framework = :test_unit
g.fixtures = true
end
end
railties/lib/generators/rails/app/templates/config/environments/generators.rb
已删除
100644 → 0
浏览文件 @
21019304
# Settings specified here will take precedence over those in config/environment.rb
# No need to reload in generators environment, so do cache classes.
config
.
cache_classes
=
true
# Log error messages when you accidentally call methods on nil.
config
.
whiny_nils
=
true
# Configure generators options (below are default values, delete them if you want).
config
.
generators
do
|
g
|
g
.
helper
=
true
g
.
layout
=
true
g
.
orm
=
:active_record
g
.
stylesheets
=
true
g
.
template_engine
=
:erb
g
.
test_framework
=
:test_unit
g
.
timestamps
=
true
end
railties/lib/initializer.rb
浏览文件 @
f68e7a39
...
...
@@ -569,10 +569,9 @@ def self.run(initializer = nil, config = nil)
end
end
#
Load generators if RAILS_ENV == "generators"
#
Configure generators if they were already loaded
Initializer
.
default
.
add
:initialize_generators
do
if
RAILS_ENV
==
"generators"
require
"generators"
if
defined?
(
Rails
::
Generators
)
Rails
::
Generators
.
no_color!
unless
config
.
generators
.
colorize_logging
Rails
::
Generators
.
aliases
.
merge!
config
.
generators
.
aliases
Rails
::
Generators
.
options
.
merge!
config
.
generators
.
options
...
...
railties/test/initializer_test.rb
浏览文件 @
f68e7a39
...
...
@@ -293,7 +293,6 @@ def load_plugins!
class
InitializerGeneratorsTests
<
Test
::
Unit
::
TestCase
def
setup
@old_env_value
=
RAILS_ENV
.
dup
@configuration
=
Rails
::
Configuration
.
new
@initializer
=
Rails
::
Initializer
.
default
@initializer
.
config
=
@configuration
...
...
@@ -349,16 +348,9 @@ def test_generators_raise_no_method_error_non_setters
end
end
def
test_generators_are_not_invoked_with_other_environments
@configuration
.
generators
.
test_framework
=
:rspec
@initializer
.
run
(
:initialize_generators
)
assert_equal
:test_unit
,
Rails
::
Generators
.
options
[
:test_framework
]
end
protected
def
teardown
RAILS_ENV
.
replace
@old_env_value
Rails
::
Generators
.
clear_aliases!
Rails
::
Generators
.
clear_options!
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录