Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
c07dff72
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,体验更适合开发者的 AI 搜索 >>
提交
c07dff72
编写于
6月 05, 2020
作者:
R
Ryuta Kamizono
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Auto-correct for `delete_prefix`/`delete_suffix`
Follow up to #39409.
上级
c2dc793e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
9 addition
and
9 deletion
+9
-9
Gemfile.lock
Gemfile.lock
+1
-1
activerecord/lib/active_record/connection_adapters/postgresql/column.rb
...ib/active_record/connection_adapters/postgresql/column.rb
+1
-1
activesupport/lib/active_support/dependencies.rb
activesupport/lib/active_support/dependencies.rb
+3
-3
activesupport/lib/active_support/evented_file_update_checker.rb
...support/lib/active_support/evented_file_update_checker.rb
+1
-1
activesupport/lib/active_support/inflector/methods.rb
activesupport/lib/active_support/inflector/methods.rb
+1
-1
guides/rails_guides/generator.rb
guides/rails_guides/generator.rb
+1
-1
railties/lib/rails/code_statistics_calculator.rb
railties/lib/rails/code_statistics_calculator.rb
+1
-1
未找到文件。
Gemfile.lock
浏览文件 @
c07dff72
...
...
@@ -415,7 +415,7 @@ GEM
rexml
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-performance (1.6.
0
)
rubocop-performance (1.6.
1
)
rubocop (>= 0.71.0)
rubocop-rails (2.5.2)
activesupport
...
...
activerecord/lib/active_record/connection_adapters/postgresql/column.rb
浏览文件 @
c07dff72
...
...
@@ -21,7 +21,7 @@ def array
alias
:array?
:array
def
sql_type
super
.
sub
(
/\[\]\z/
,
"
"
)
super
.
delete_suffix
(
"[]
"
)
end
def
init_with
(
coder
)
...
...
activesupport/lib/active_support/dependencies.rb
浏览文件 @
c07dff72
...
...
@@ -544,7 +544,7 @@ def load_missing_constant(from_mod, const_name)
if
file_path
expanded
=
File
.
expand_path
(
file_path
)
expanded
.
sub!
(
/\.rb\z/
,
"
"
)
expanded
.
delete_suffix!
(
".rb
"
)
if
loading
.
include?
(
expanded
)
raise
"Circular dependency detected while autoloading constant
#{
qualified_name
}
"
...
...
@@ -733,7 +733,7 @@ def to_constant_name(desc) #:nodoc:
def
remove_constant
(
const
)
#:nodoc:
# Normalize ::Foo, ::Object::Foo, Object::Foo, Object::Object::Foo, etc. as Foo.
normalized
=
const
.
to_s
.
sub
(
/\A::/
,
"
"
)
normalized
=
const
.
to_s
.
delete_prefix
(
"::
"
)
normalized
.
sub!
(
/\A(Object::)+/
,
""
)
constants
=
normalized
.
split
(
"::"
)
...
...
@@ -743,7 +743,7 @@ def remove_constant(const) #:nodoc:
file_path
=
search_for_file
(
const
.
underscore
)
if
file_path
expanded
=
File
.
expand_path
(
file_path
)
expanded
.
sub!
(
/\.rb\z/
,
"
"
)
expanded
.
delete_suffix!
(
".rb
"
)
loaded
.
delete
(
expanded
)
end
...
...
activesupport/lib/active_support/evented_file_update_checker.rb
浏览文件 @
c07dff72
...
...
@@ -160,7 +160,7 @@ def xpath(path)
end
def
normalize_extension
(
ext
)
ext
.
to_s
.
sub
(
/\A\./
,
"
"
)
ext
.
to_s
.
delete_prefix
(
".
"
)
end
# Given a collection of Pathname objects returns the longest subpath
...
...
activesupport/lib/active_support/inflector/methods.rb
浏览文件 @
c07dff72
...
...
@@ -133,7 +133,7 @@ def humanize(lower_case_and_underscored_word, capitalize: true, keep_id_suffix:
result
.
sub!
(
/\A_+/
,
""
)
unless
keep_id_suffix
result
.
sub!
(
/_id\z/
,
"
"
)
result
.
delete_suffix!
(
"_id
"
)
end
result
.
tr!
(
"_"
,
" "
)
...
...
guides/rails_guides/generator.rb
浏览文件 @
c07dff72
...
...
@@ -129,7 +129,7 @@ def output_file_for(guide)
if
guide
.
end_with?
(
".md"
)
guide
.
sub
(
/md\z/
,
"html"
)
else
guide
.
sub
(
/\.erb\z/
,
"
"
)
guide
.
delete_suffix
(
".erb
"
)
end
end
...
...
railties/lib/rails/code_statistics_calculator.rb
浏览文件 @
c07dff72
...
...
@@ -82,7 +82,7 @@ def file_type(file_path)
if
file_path
.
end_with?
"_test.rb"
:minitest
else
File
.
extname
(
file_path
).
sub
(
/\A\./
,
"
"
).
downcase
.
to_sym
File
.
extname
(
file_path
).
delete_prefix
(
".
"
).
downcase
.
to_sym
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录