Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
da8d0c94
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,发现更多精彩内容 >>
提交
da8d0c94
编写于
2月 22, 2018
作者:
A
Andrew White
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add cop for preferring 'Foo.method' over 'Foo::method'
上级
af4f1a01
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
18 addition
and
14 deletion
+18
-14
.rubocop.yml
.rubocop.yml
+4
-0
actionpack/test/controller/http_digest_authentication_test.rb
...onpack/test/controller/http_digest_authentication_test.rb
+2
-2
actionpack/test/controller/routing_test.rb
actionpack/test/controller/routing_test.rb
+1
-1
actionview/lib/action_view/helpers/debug_helper.rb
actionview/lib/action_view/helpers/debug_helper.rb
+1
-1
activerecord/lib/active_record/railties/databases.rake
activerecord/lib/active_record/railties/databases.rake
+1
-1
activerecord/test/cases/fixtures_test.rb
activerecord/test/cases/fixtures_test.rb
+1
-1
activesupport/lib/active_support/xml_mini.rb
activesupport/lib/active_support/xml_mini.rb
+1
-1
guides/rails_guides/kindle.rb
guides/rails_guides/kindle.rb
+2
-2
railties/test/generators/api_app_generator_test.rb
railties/test/generators/api_app_generator_test.rb
+1
-1
railties/test/generators/shared_generator_tests.rb
railties/test/generators/shared_generator_tests.rb
+1
-1
railties/test/minitest/rails_plugin_test.rb
railties/test/minitest/rails_plugin_test.rb
+3
-3
未找到文件。
.rubocop.yml
浏览文件 @
da8d0c94
...
...
@@ -156,3 +156,7 @@ Style/RedundantReturn:
Style/Semicolon
:
Enabled
:
true
AllowAsExpressionSeparator
:
true
# Prefer Foo.method over Foo::method
Style/ColonMethodCall
:
Enabled
:
true
actionpack/test/controller/http_digest_authentication_test.rb
浏览文件 @
da8d0c94
...
...
@@ -9,7 +9,7 @@ class DummyDigestController < ActionController::Base
before_action
:authenticate_with_request
,
only: :display
USERS
=
{
"lifo"
=>
"world"
,
"pretty"
=>
"please"
,
"dhh"
=>
::
Digest
::
MD5
::
hexdigest
([
"dhh"
,
"SuperSecret"
,
"secret"
].
join
(
":"
))
}
"dhh"
=>
::
Digest
::
MD5
.
hexdigest
([
"dhh"
,
"SuperSecret"
,
"secret"
].
join
(
":"
))
}
def
index
render
plain:
"Hello Secret"
...
...
@@ -182,7 +182,7 @@ def authenticate_with_request
test
"authentication request with password stored as ha1 digest hash"
do
@request
.
env
[
"HTTP_AUTHORIZATION"
]
=
encode_credentials
(
username:
"dhh"
,
password:
::
Digest
::
MD5
::
hexdigest
([
"dhh"
,
"SuperSecret"
,
"secret"
].
join
(
":"
)),
password:
::
Digest
::
MD5
.
hexdigest
([
"dhh"
,
"SuperSecret"
,
"secret"
].
join
(
":"
)),
password_is_ha1:
true
)
get
:display
...
...
actionpack/test/controller/routing_test.rb
浏览文件 @
da8d0c94
...
...
@@ -676,7 +676,7 @@ def test_route_with_text_default
token
=
"
\321\202\320\265\320\272\321\201\321\202
"
.
dup
# 'text' in Russian
token
.
force_encoding
(
Encoding
::
BINARY
)
escaped_token
=
CGI
::
escape
(
token
)
escaped_token
=
CGI
.
escape
(
token
)
assert_equal
"/page/"
+
escaped_token
,
url_for
(
rs
,
controller:
"content"
,
action:
"show_page"
,
id:
token
)
assert_equal
({
controller:
"content"
,
action:
"show_page"
,
id:
token
},
rs
.
recognize_path
(
"/page/
#{
escaped_token
}
"
))
...
...
actionview/lib/action_view/helpers/debug_helper.rb
浏览文件 @
da8d0c94
...
...
@@ -24,7 +24,7 @@ module DebugHelper
# created_at:
# </pre>
def
debug
(
object
)
Marshal
::
dump
(
object
)
Marshal
.
dump
(
object
)
object
=
ERB
::
Util
.
html_escape
(
object
.
to_yaml
)
content_tag
(
:pre
,
object
,
class:
"debug_dump"
)
rescue
# errors from Marshal or YAML
...
...
activerecord/lib/active_record/railties/databases.rake
浏览文件 @
da8d0c94
...
...
@@ -229,7 +229,7 @@ db_namespace = namespace :db do
base_dir
=
ActiveRecord
::
Tasks
::
DatabaseTasks
.
fixtures_path
Dir
[
"
#{
base_dir
}
/**/*.yml"
].
each
do
|
file
|
if
data
=
YAML
::
load
(
ERB
.
new
(
IO
.
read
(
file
)).
result
)
if
data
=
YAML
.
load
(
ERB
.
new
(
IO
.
read
(
file
)).
result
)
data
.
each_key
do
|
key
|
key_id
=
ActiveRecord
::
FixtureSet
.
identify
(
key
)
...
...
activerecord/test/cases/fixtures_test.rb
浏览文件 @
da8d0c94
...
...
@@ -1186,7 +1186,7 @@ def test_named_accessor_for_randomly_named_namespaced_fixture_and_class
end
def
test_table_name_is_defined_in_the_model
assert_equal
"randomly_named_table2"
,
ActiveRecord
::
FixtureSet
::
all_loaded_fixtures
[
"admin/randomly_named_a9"
].
table_name
assert_equal
"randomly_named_table2"
,
ActiveRecord
::
FixtureSet
.
all_loaded_fixtures
[
"admin/randomly_named_a9"
].
table_name
assert_equal
"randomly_named_table2"
,
Admin
::
ClassNameThatDoesNotFollowCONVENTIONS1
.
table_name
end
end
...
...
activesupport/lib/active_support/xml_mini.rb
浏览文件 @
da8d0c94
...
...
@@ -83,7 +83,7 @@ def content_type
end
,
"boolean"
=>
Proc
.
new
{
|
boolean
|
%w(1 true)
.
include?
(
boolean
.
to_s
.
strip
)
},
"string"
=>
Proc
.
new
{
|
string
|
string
.
to_s
},
"yaml"
=>
Proc
.
new
{
|
yaml
|
YAML
::
load
(
yaml
)
rescue
yaml
},
"yaml"
=>
Proc
.
new
{
|
yaml
|
YAML
.
load
(
yaml
)
rescue
yaml
},
"base64Binary"
=>
Proc
.
new
{
|
bin
|
::
Base64
.
decode64
(
bin
)
},
"binary"
=>
Proc
.
new
{
|
bin
,
entity
|
_parse_binary
(
bin
,
entity
)
},
"file"
=>
Proc
.
new
{
|
file
,
entity
|
_parse_file
(
file
,
entity
)
}
...
...
guides/rails_guides/kindle.rb
浏览文件 @
da8d0c94
...
...
@@ -58,9 +58,9 @@ def generate_front_matter(html_pages)
end
def
generate_sections
(
html_pages
)
FileUtils
::
rm_rf
(
"sections/"
)
FileUtils
.
rm_rf
(
"sections/"
)
html_pages
.
each_with_index
do
|
page
,
section_idx
|
FileUtils
::
mkdir_p
(
"sections/%03d"
%
section_idx
)
FileUtils
.
mkdir_p
(
"sections/%03d"
%
section_idx
)
doc
=
Nokogiri
::
HTML
(
File
.
open
(
page
))
title
=
doc
.
at
(
"title"
).
inner_text
.
gsub
(
"Ruby on Rails Guides: "
,
""
)
title
=
page
.
capitalize
.
gsub
(
".html"
,
""
)
if
title
.
strip
==
""
...
...
railties/test/generators/api_app_generator_test.rb
浏览文件 @
da8d0c94
...
...
@@ -13,7 +13,7 @@ def setup
Rails
.
application
=
TestApp
::
Application
super
Kernel
::
silence_warnings
do
Kernel
.
silence_warnings
do
Thor
::
Base
.
shell
.
send
(
:attr_accessor
,
:always_force
)
@shell
=
Thor
::
Base
.
shell
.
new
@shell
.
send
(
:always_force
=
,
true
)
...
...
railties/test/generators/shared_generator_tests.rb
浏览文件 @
da8d0c94
...
...
@@ -9,7 +9,7 @@ def setup
super
Rails
::
Generators
::
AppGenerator
.
instance_variable_set
(
"@desc"
,
nil
)
Kernel
::
silence_warnings
do
Kernel
.
silence_warnings
do
Thor
::
Base
.
shell
.
send
(
:attr_accessor
,
:always_force
)
@shell
=
Thor
::
Base
.
shell
.
new
@shell
.
send
(
:always_force
=
,
true
)
...
...
railties/test/minitest/rails_plugin_test.rb
浏览文件 @
da8d0c94
...
...
@@ -14,7 +14,7 @@ class Minitest::RailsPluginTest < ActiveSupport::TestCase
reporter
<<
Minitest
::
ProgressReporter
.
new
(
@output
,
@options
)
reporter
<<
Minitest
::
Reporter
.
new
(
@output
,
@options
)
Minitest
::
plugin_rails_replace_reporters
(
reporter
,
{})
Minitest
.
plugin_rails_replace_reporters
(
reporter
,
{})
assert_equal
3
,
reporter
.
reporters
.
count
assert
reporter
.
reporters
.
any?
{
|
candidate
|
candidate
.
kind_of?
(
Minitest
::
SuppressedSummaryReporter
)
}
...
...
@@ -25,7 +25,7 @@ class Minitest::RailsPluginTest < ActiveSupport::TestCase
test
"no custom reporters are added if nothing to replace"
do
reporter
=
Minitest
::
CompositeReporter
.
new
Minitest
::
plugin_rails_replace_reporters
(
reporter
,
{})
Minitest
.
plugin_rails_replace_reporters
(
reporter
,
{})
assert_equal
0
,
reporter
.
reporters
.
count
end
...
...
@@ -33,6 +33,6 @@ class Minitest::RailsPluginTest < ActiveSupport::TestCase
test
"handle the case when reporter is not CompositeReporter"
do
reporter
=
Minitest
::
Reporter
.
new
Minitest
::
plugin_rails_replace_reporters
(
reporter
,
{})
Minitest
.
plugin_rails_replace_reporters
(
reporter
,
{})
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录