Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
a9398a7d
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,发现更多精彩内容 >>
提交
a9398a7d
编写于
4月 04, 2012
作者:
S
Santiago Pastorino
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5716 from jurriaan/tr-gsub-cleanup
Updated/changed unneeded tr/gsubs
上级
c6bd8a9d
2d8396fc
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
20 addition
and
20 deletion
+20
-20
actionmailer/lib/action_mailer/base.rb
actionmailer/lib/action_mailer/base.rb
+1
-1
actionmailer/lib/rails/generators/mailer/templates/mailer.rb
actionmailer/lib/rails/generators/mailer/templates/mailer.rb
+1
-1
actionpack/lib/action_controller/metal/data_streaming.rb
actionpack/lib/action_controller/metal/data_streaming.rb
+1
-1
actionpack/lib/action_controller/metal/http_authentication.rb
...onpack/lib/action_controller/metal/http_authentication.rb
+1
-1
actionpack/lib/action_controller/metal/redirecting.rb
actionpack/lib/action_controller/metal/redirecting.rb
+1
-1
actionpack/lib/action_dispatch/routing/mapper.rb
actionpack/lib/action_dispatch/routing/mapper.rb
+2
-2
actionpack/lib/action_dispatch/testing/assertions/response.rb
...onpack/lib/action_dispatch/testing/assertions/response.rb
+1
-1
actionpack/lib/action_view/helpers/number_helper.rb
actionpack/lib/action_view/helpers/number_helper.rb
+2
-2
activemodel/lib/active_model/errors.rb
activemodel/lib/active_model/errors.rb
+1
-1
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
..._record/connection_adapters/abstract/schema_statements.rb
+1
-1
activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
...d/lib/active_record/connection_adapters/sqlite_adapter.rb
+2
-2
activesupport/lib/active_support/inflector/methods.rb
activesupport/lib/active_support/inflector/methods.rb
+1
-1
guides/w3c_validator.rb
guides/w3c_validator.rb
+1
-1
railties/lib/rails/generators/named_base.rb
railties/lib/rails/generators/named_base.rb
+1
-1
railties/lib/rails/generators/resource_helpers.rb
railties/lib/rails/generators/resource_helpers.rb
+1
-1
railties/lib/rails/railtie.rb
railties/lib/rails/railtie.rb
+1
-1
railties/test/rails_info_test.rb
railties/test/rails_info_test.rb
+1
-1
未找到文件。
actionmailer/lib/action_mailer/base.rb
浏览文件 @
a9398a7d
...
...
@@ -696,7 +696,7 @@ def set_content_type(m, user_content_type, class_default)
# If it does not find a translation for the +subject+ under the specified scope it will default to a
# humanized version of the <tt>action_name</tt>.
def
default_i18n_subject
#:nodoc:
mailer_scope
=
self
.
class
.
mailer_name
.
gsub
(
'/'
,
'.'
)
mailer_scope
=
self
.
class
.
mailer_name
.
tr
(
'/'
,
'.'
)
I18n
.
t
(
:subject
,
:scope
=>
[
mailer_scope
,
action_name
],
:default
=>
action_name
.
humanize
)
end
...
...
actionmailer/lib/rails/generators/mailer/templates/mailer.rb
浏览文件 @
a9398a7d
...
...
@@ -6,7 +6,7 @@ class <%= class_name %> < ActionMailer::Base
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.<%= file_path.
gsub
("/",".") %>
.
<
%=
action
%>.subject
# en.<%= file_path.
tr
("/",".") %>
.
<
%=
action
%>.subject
#
def <%= action %>
@greeting
=
"Hi"
...
...
actionpack/lib/action_controller/metal/data_streaming.rb
浏览文件 @
a9398a7d
...
...
@@ -132,7 +132,7 @@ def send_file_headers!(options)
else
if
!
type_provided
&&
options
[
:filename
]
# If type wasn't provided, try guessing from file extension.
content_type
=
Mime
::
Type
.
lookup_by_extension
(
File
.
extname
(
options
[
:filename
]).
downcase
.
tr
(
'.'
,
'
'
))
||
content_type
content_type
=
Mime
::
Type
.
lookup_by_extension
(
File
.
extname
(
options
[
:filename
]).
downcase
.
delete
(
'.
'
))
||
content_type
end
self
.
content_type
=
content_type
end
...
...
actionpack/lib/action_controller/metal/http_authentication.rb
浏览文件 @
a9398a7d
...
...
@@ -229,7 +229,7 @@ def decode_credentials_header(request)
def
decode_credentials
(
header
)
Hash
[
header
.
to_s
.
gsub
(
/^Digest\s+/
,
''
).
split
(
','
).
map
do
|
pair
|
key
,
value
=
pair
.
split
(
'='
,
2
)
[
key
.
strip
.
to_sym
,
value
.
to_s
.
gsub
(
/^"|"$/
,
''
).
gsub
(
/'/
,
''
)]
[
key
.
strip
.
to_sym
,
value
.
to_s
.
gsub
(
/^"|"$/
,
''
).
delete
(
'\
''
)]
end
]
end
...
...
actionpack/lib/action_controller/metal/redirecting.rb
浏览文件 @
a9398a7d
...
...
@@ -93,7 +93,7 @@ def _compute_redirect_to_location(options)
_compute_redirect_to_location
options
.
call
else
url_for
(
options
)
end
.
gsub
(
/[\0\r\n]/
,
''
)
end
.
delete
(
"
\0\r\n
"
)
end
end
end
actionpack/lib/action_dispatch/routing/mapper.rb
浏览文件 @
a9398a7d
...
...
@@ -244,7 +244,7 @@ def self.normalize_path(path)
end
def
self
.
normalize_name
(
name
)
normalize_path
(
name
)[
1
..-
1
].
gsub
(
"/"
,
"_"
)
normalize_path
(
name
)[
1
..-
1
].
tr
(
"/"
,
"_"
)
end
module
Base
...
...
@@ -441,7 +441,7 @@ def app_name(app)
app
.
railtie_name
else
class_name
=
app
.
class
.
is_a?
(
Class
)
?
app
.
name
:
app
.
class
.
name
ActiveSupport
::
Inflector
.
underscore
(
class_name
).
gsub
(
"/"
,
"_"
)
ActiveSupport
::
Inflector
.
underscore
(
class_name
).
tr
(
"/"
,
"_"
)
end
end
...
...
actionpack/lib/action_dispatch/testing/assertions/response.rb
浏览文件 @
a9398a7d
...
...
@@ -81,7 +81,7 @@ def normalize_argument_to_redirection(fragment)
refer
else
@controller
.
url_for
(
fragment
)
end
.
gsub
(
/[\0\r\n]/
,
''
)
end
.
delete
(
"
\0\r\n
"
)
end
end
end
...
...
actionpack/lib/action_view/helpers/number_helper.rb
浏览文件 @
a9398a7d
...
...
@@ -137,12 +137,12 @@ def number_to_currency(number, options = {})
begin
value
=
number_with_precision
(
number
,
options
.
merge
(
:raise
=>
true
))
format
.
gsub
(
/%n/
,
value
).
gsub
(
/%u/
,
unit
).
html_safe
format
.
gsub
(
'%n'
,
value
).
gsub
(
'%u'
,
unit
).
html_safe
rescue
InvalidNumberError
=>
e
if
options
[
:raise
]
raise
else
formatted_number
=
format
.
gsub
(
/%n/
,
e
.
number
).
gsub
(
/%u/
,
unit
)
formatted_number
=
format
.
gsub
(
'%n'
,
e
.
number
).
gsub
(
'%u'
,
unit
)
e
.
number
.
to_s
.
html_safe?
?
formatted_number
.
html_safe
:
formatted_number
end
end
...
...
activemodel/lib/active_model/errors.rb
浏览文件 @
a9398a7d
...
...
@@ -286,7 +286,7 @@ def full_messages
# "Name is invalid"
def
full_message
(
attribute
,
message
)
return
message
if
attribute
==
:base
attr_name
=
attribute
.
to_s
.
gsub
(
'.'
,
'_'
).
humanize
attr_name
=
attribute
.
to_s
.
tr
(
'.'
,
'_'
).
humanize
attr_name
=
@base
.
class
.
human_attribute_name
(
attribute
,
:default
=>
attr_name
)
I18n
.
t
(
:"errors.format"
,
{
:default
=>
"%{attribute} %{message}"
,
...
...
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
浏览文件 @
a9398a7d
...
...
@@ -16,7 +16,7 @@ def native_database_types
# Truncates a table alias according to the limits of the current adapter.
def
table_alias_for
(
table_name
)
table_name
[
0
...
table_alias_length
].
gsub
(
/\./
,
'_'
)
table_name
[
0
...
table_alias_length
].
tr
(
'.'
,
'_'
)
end
# Checks to see if the table +table_name+ exists on the database.
...
...
activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
浏览文件 @
a9398a7d
...
...
@@ -339,9 +339,9 @@ def columns(table_name) #:nodoc:
when
/^null$/i
field
[
"dflt_value"
]
=
nil
when
/^'(.*)'$/
field
[
"dflt_value"
]
=
$1
.
gsub
(
/''/
,
"'"
)
field
[
"dflt_value"
]
=
$1
.
gsub
(
"''"
,
"'"
)
when
/^"(.*)"$/
field
[
"dflt_value"
]
=
$1
.
gsub
(
/""/
,
'"'
)
field
[
"dflt_value"
]
=
$1
.
gsub
(
'""'
,
'"'
)
end
SQLiteColumn
.
new
(
field
[
'name'
],
field
[
'dflt_value'
],
field
[
'type'
],
field
[
'notnull'
].
to_i
==
0
)
...
...
activesupport/lib/active_support/inflector/methods.rb
浏览文件 @
a9398a7d
...
...
@@ -77,7 +77,7 @@ def camelize(term, uppercase_first_letter = true)
# "SSLError".underscore.camelize # => "SslError"
def
underscore
(
camel_cased_word
)
word
=
camel_cased_word
.
to_s
.
dup
word
.
gsub!
(
/::/
,
'/'
)
word
.
gsub!
(
'::'
,
'/'
)
word
.
gsub!
(
/(?:([A-Za-z\d])|^)(
#{
inflections
.
acronym_regex
}
)(?=\b|[^a-z])/
)
{
"
#{
$1
}#{
$1
&&
'_'
}#{
$2
.
downcase
}
"
}
word
.
gsub!
(
/([A-Z\d]+)([A-Z][a-z])/
,
'\1_\2'
)
word
.
gsub!
(
/([a-z\d])([A-Z])/
,
'\1_\2'
)
...
...
guides/w3c_validator.rb
浏览文件 @
a9398a7d
...
...
@@ -76,7 +76,7 @@ def show_results(error_list)
error_summary
+=
"
\n
#{
name
}
"
error_detail
+=
"
\n\n
#{
name
}
has
#{
errors
.
size
}
validation error(s):
\n
"
errors
.
each
do
|
error
|
error_detail
+=
"
\n
"
+
error
.
to_s
.
gsub
(
"
\n
"
,
"
"
)
error_detail
+=
"
\n
"
+
error
.
to_s
.
delete
(
"
\n
"
)
end
end
...
...
railties/lib/rails/generators/named_base.rb
浏览文件 @
a9398a7d
...
...
@@ -99,7 +99,7 @@ def plural_name
end
def
i18n_scope
@i18n_scope
||=
file_path
.
gsub
(
'/'
,
'.'
)
@i18n_scope
||=
file_path
.
tr
(
'/'
,
'.'
)
end
def
table_name
...
...
railties/lib/rails/generators/resource_helpers.rb
浏览文件 @
a9398a7d
...
...
@@ -50,7 +50,7 @@ def controller_class_name
end
def
controller_i18n_scope
@controller_i18n_scope
||=
controller_file_path
.
gsub
(
'/'
,
'.'
)
@controller_i18n_scope
||=
controller_file_path
.
tr
(
'/'
,
'.'
)
end
# Loads the ORM::Generators::ActiveModel class. This class is responsible
...
...
railties/lib/rails/railtie.rb
浏览文件 @
a9398a7d
...
...
@@ -162,7 +162,7 @@ def railtie_name(name = nil)
protected
def
generate_railtie_name
(
class_or_module
)
ActiveSupport
::
Inflector
.
underscore
(
class_or_module
).
gsub
(
"/"
,
"_"
)
ActiveSupport
::
Inflector
.
underscore
(
class_or_module
).
tr
(
"/"
,
"_"
)
end
end
...
...
railties/test/rails_info_test.rb
浏览文件 @
a9398a7d
...
...
@@ -43,7 +43,7 @@ def test_framework_version
def
test_frameworks_exist
Rails
::
Info
.
frameworks
.
each
do
|
framework
|
dir
=
File
.
dirname
(
__FILE__
)
+
"/../../"
+
framework
.
gsub
(
'_'
,
'
'
)
dir
=
File
.
dirname
(
__FILE__
)
+
"/../../"
+
framework
.
delete
(
'_
'
)
assert
File
.
directory?
(
dir
),
"
#{
framework
.
classify
}
does not exist"
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录