Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
51095be1
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,发现更多精彩内容 >>
提交
51095be1
编写于
12月 20, 2011
作者:
J
José Valim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Get rid of more 1.8.x dead code
上级
2d5f5c32
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
13 addition
and
55 deletion
+13
-55
railties/lib/rails.rb
railties/lib/rails.rb
+3
-12
railties/lib/rails/commands/plugin.rb
railties/lib/rails/commands/plugin.rb
+1
-1
railties/lib/rails/generators/app_base.rb
railties/lib/rails/generators/app_base.rb
+1
-5
railties/lib/rails/generators/named_base.rb
railties/lib/rails/generators/named_base.rb
+2
-7
railties/lib/rails/generators/rails/app/templates/Gemfile
railties/lib/rails/generators/rails/app/templates/Gemfile
+0
-1
railties/test/application/configuration_test.rb
railties/test/application/configuration_test.rb
+2
-6
railties/test/generators/app_generator_test.rb
railties/test/generators/app_generator_test.rb
+2
-9
railties/test/generators/mailer_generator_test.rb
railties/test/generators/mailer_generator_test.rb
+1
-5
railties/test/generators/namespaced_generators_test.rb
railties/test/generators/namespaced_generators_test.rb
+1
-5
railties/test/railties/generators_test.rb
railties/test/railties/generators_test.rb
+0
-4
未找到文件。
railties/lib/rails.rb
浏览文件 @
51095be1
...
...
@@ -12,19 +12,10 @@
require
'active_support/railtie'
require
'action_dispatch/railtie'
# For Ruby 1.8, this initialization sets $KCODE to 'u' to enable the
# multibyte safe operations. Plugin authors supporting other encodings
# should override this behavior and set the relevant +default_charset+
# on ActionController::Base.
#
# For Ruby 1.9, UTF-8 is the default internal and external encoding.
if
RUBY_VERSION
<
'1.9'
$KCODE
=
'u'
else
silence_warnings
do
Encoding
.
default_external
=
Encoding
::
UTF_8
Encoding
.
default_internal
=
Encoding
::
UTF_8
end
silence_warnings
do
Encoding
.
default_external
=
Encoding
::
UTF_8
Encoding
.
default_internal
=
Encoding
::
UTF_8
end
module
Rails
...
...
railties/lib/rails/commands/plugin.rb
浏览文件 @
51095be1
...
...
@@ -478,7 +478,7 @@ class RecursiveHTTPFetcher
def
initialize
(
urls_to_fetch
,
level
=
1
,
cwd
=
"."
)
@level
=
level
@cwd
=
cwd
@urls_to_fetch
=
RUBY_VERSION
>=
'1.9'
?
urls_to_fetch
.
lines
:
urls_to_fetch
.
to_a
@urls_to_fetch
=
urls_to_fetch
.
lines
@quiet
=
false
end
...
...
railties/lib/rails/generators/app_base.rb
浏览文件 @
51095be1
...
...
@@ -182,11 +182,7 @@ def convert_database_option_for_jruby
end
def
ruby_debugger_gemfile_entry
if
RUBY_VERSION
<
"1.9"
"gem 'ruby-debug'"
else
"gem 'ruby-debug19', :require => 'ruby-debug'"
end
"gem 'ruby-debug19', :require => 'ruby-debug'"
end
def
assets_gemfile_entry
...
...
railties/lib/rails/generators/named_base.rb
浏览文件 @
51095be1
...
...
@@ -182,14 +182,9 @@ def self.check_class_collision(options={})
end
end
# Returns Ruby 1.9 style key-value pair if current code is running on
# Ruby 1.9.x. Returns the old-style (with hash rocket) otherwise.
# Returns Ruby 1.9 style key-value pair.
def
key_value
(
key
,
value
)
if
options
[
:old_style_hash
]
||
RUBY_VERSION
<
'1.9'
":
#{
key
}
=>
#{
value
}
"
else
"
#{
key
}
:
#{
value
}
"
end
"
#{
key
}
:
#{
value
}
"
end
end
end
...
...
railties/lib/rails/generators/rails/app/templates/Gemfile
浏览文件 @
51095be1
...
...
@@ -5,7 +5,6 @@ source 'https://rubygems.org'
<%=
database_gemfile_entry
-
%>
<%= "gem 'jruby-openssl'\n" if defined?(JRUBY_VERSION) -%>
<
%= "gem 'json'\n" if RUBY_VERSION < "1.9.2" -%>
<
%= assets_gemfile_entry %>
<%=
javascript_gemfile_entry
%>
...
...
railties/test/application/configuration_test.rb
浏览文件 @
51095be1
...
...
@@ -189,12 +189,8 @@ def teardown
end
def
assert_utf8
if
RUBY_VERSION
<
'1.9'
assert_equal
"UTF8"
,
$KCODE
else
assert_equal
Encoding
::
UTF_8
,
Encoding
.
default_external
assert_equal
Encoding
::
UTF_8
,
Encoding
.
default_internal
end
assert_equal
Encoding
::
UTF_8
,
Encoding
.
default_external
assert_equal
Encoding
::
UTF_8
,
Encoding
.
default_internal
end
test
"skipping config.encoding still results in 'utf-8' as the default"
do
...
...
railties/test/generators/app_generator_test.rb
浏览文件 @
51095be1
...
...
@@ -285,17 +285,10 @@ def test_javascript_is_skipped_if_required
end
end
def
test_inclusion_of_ruby_debug
def
test_inclusion_of_ruby_debug
19
run_generator
assert_file
"Gemfile"
do
|
contents
|
assert_match
(
/gem 'ruby-debug'/
,
contents
)
if
RUBY_VERSION
<
'1.9'
end
end
def
test_inclusion_of_ruby_debug19_if_ruby19
run_generator
assert_file
"Gemfile"
do
|
contents
|
assert_match
(
/gem 'ruby-debug19', :require => 'ruby-debug'/
,
contents
)
unless
RUBY_VERSION
<
'1.9'
assert_match
(
/gem 'ruby-debug19', :require => 'ruby-debug'/
,
contents
)
end
end
...
...
railties/test/generators/mailer_generator_test.rb
浏览文件 @
51095be1
...
...
@@ -10,11 +10,7 @@ def test_mailer_skeleton_is_created
run_generator
assert_file
"app/mailers/notifier.rb"
do
|
mailer
|
assert_match
(
/class Notifier < ActionMailer::Base/
,
mailer
)
if
RUBY_VERSION
<
"1.9"
assert_match
(
/default :from => "from@example.com"/
,
mailer
)
else
assert_match
(
/default from: "from@example.com"/
,
mailer
)
end
assert_match
(
/default from: "from@example.com"/
,
mailer
)
end
end
...
...
railties/test/generators/namespaced_generators_test.rb
浏览文件 @
51095be1
...
...
@@ -155,11 +155,7 @@ def test_mailer_skeleton_is_created
assert_file
"app/mailers/test_app/notifier.rb"
do
|
mailer
|
assert_match
(
/module TestApp/
,
mailer
)
assert_match
(
/class Notifier < ActionMailer::Base/
,
mailer
)
if
RUBY_VERSION
<
"1.9"
assert_match
(
/default :from => "from@example.com"/
,
mailer
)
else
assert_match
(
/default from: "from@example.com"/
,
mailer
)
end
assert_match
(
/default from: "from@example.com"/
,
mailer
)
end
end
...
...
railties/test/railties/generators_test.rb
浏览文件 @
51095be1
...
...
@@ -46,10 +46,6 @@ def build_engine(is_mountable=false)
gem 'rails', :path => '
#{
RAILS_FRAMEWORK_ROOT
}
'
gem 'sqlite3'
if RUBY_VERSION < '1.9'
gem "ruby-debug", ">= 0.10.3"
end
GEMFILE
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录