Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
c81928cf
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c81928cf
编写于
7月 07, 2017
作者:
D
Douwe Maan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Include new URL helpers retroactively into includers of Gitlab::Routing
上级
1dab6403
变更
14
显示空白变更内容
内联
并排
Showing
14 changed file
with
36 addition
and
22 deletion
+36
-22
app/models/project_services/gitlab_issue_tracker_service.rb
app/models/project_services/gitlab_issue_tracker_service.rb
+1
-1
app/models/project_services/jira_service.rb
app/models/project_services/jira_service.rb
+1
-1
app/services/chat_names/authorize_user_service.rb
app/services/chat_names/authorize_user_service.rb
+1
-1
config/application.rb
config/application.rb
+4
-10
lib/gitlab/badge/metadata.rb
lib/gitlab/badge/metadata.rb
+1
-1
lib/gitlab/conflict/file.rb
lib/gitlab/conflict/file.rb
+1
-1
lib/gitlab/email/message/repository_push.rb
lib/gitlab/email/message/repository_push.rb
+1
-1
lib/gitlab/routing.rb
lib/gitlab/routing.rb
+20
-0
lib/gitlab/slash_commands/presenters/base.rb
lib/gitlab/slash_commands/presenters/base.rb
+1
-1
lib/gitlab/url_builder.rb
lib/gitlab/url_builder.rb
+1
-1
spec/lib/extracts_path_spec.rb
spec/lib/extracts_path_spec.rb
+1
-1
spec/models/project_services/jira_service_spec.rb
spec/models/project_services/jira_service_spec.rb
+1
-1
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+1
-1
spec/spec_helper.rb
spec/spec_helper.rb
+1
-1
未找到文件。
app/models/project_services/gitlab_issue_tracker_service.rb
浏览文件 @
c81928cf
class
GitlabIssueTrackerService
<
IssueTrackerService
include
Gitlab
::
Routing
.
url_helpers
include
Gitlab
::
Routing
validates
:project_url
,
:issues_url
,
:new_issue_url
,
presence:
true
,
url:
true
,
if: :activated?
...
...
app/models/project_services/jira_service.rb
浏览文件 @
c81928cf
class
JiraService
<
IssueTrackerService
include
Gitlab
::
Routing
.
url_helpers
include
Gitlab
::
Routing
validates
:url
,
url:
true
,
presence:
true
,
if: :activated?
validates
:api_url
,
url:
true
,
allow_blank:
true
...
...
app/services/chat_names/authorize_user_service.rb
浏览文件 @
c81928cf
module
ChatNames
class
AuthorizeUserService
include
Gitlab
::
Routing
.
url_helpers
include
Gitlab
::
Routing
def
initialize
(
service
,
params
)
@service
=
service
...
...
config/application.rb
浏览文件 @
c81928cf
...
...
@@ -166,9 +166,10 @@ module Gitlab
config
.
after_initialize
do
Rails
.
application
.
reload_routes!
named_routes_set
=
Gitlab
::
Application
.
routes
.
named_routes
project_url_helpers
=
Module
.
new
do
named_routes_set
.
helper_names
.
each
do
|
name
|
extend
ActiveSupport
::
Concern
Gitlab
::
Application
.
routes
.
named_routes
.
helper_names
.
each
do
|
name
|
next
unless
name
.
include?
(
'namespace_project'
)
define_method
(
name
.
sub
(
'namespace_project'
,
'project'
))
do
|
project
,
*
args
|
...
...
@@ -177,14 +178,7 @@ module Gitlab
end
end
named_routes_set
.
url_helpers_module
.
include
project_url_helpers
named_routes_set
.
url_helpers_module
.
extend
project_url_helpers
Gitlab
::
Routing
.
url_helpers
.
include
project_url_helpers
Gitlab
::
Routing
.
url_helpers
.
extend
project_url_helpers
GitlabRoutingHelper
.
include
project_url_helpers
GitlabRoutingHelper
.
extend
project_url_helpers
Gitlab
::
Routing
.
add_helpers
(
project_url_helpers
)
end
end
end
lib/gitlab/badge/metadata.rb
浏览文件 @
c81928cf
...
...
@@ -4,7 +4,7 @@ module Gitlab
# Abstract class for badge metadata
#
class
Metadata
include
Gitlab
::
Routing
.
url_helpers
include
Gitlab
::
Routing
include
ActionView
::
Helpers
::
AssetTagHelper
include
ActionView
::
Helpers
::
UrlHelper
...
...
lib/gitlab/conflict/file.rb
浏览文件 @
c81928cf
module
Gitlab
module
Conflict
class
File
include
Gitlab
::
Routing
.
url_helpers
include
Gitlab
::
Routing
include
IconsHelper
MissingResolution
=
Class
.
new
(
ResolutionError
)
...
...
lib/gitlab/email/message/repository_push.rb
浏览文件 @
c81928cf
...
...
@@ -4,7 +4,7 @@ module Gitlab
class
RepositoryPush
attr_reader
:author_id
,
:ref
,
:action
include
Gitlab
::
Routing
.
url_helpers
include
Gitlab
::
Routing
include
DiffHelper
delegate
:namespace
,
:name_with_namespace
,
to: :project
,
prefix: :project
...
...
lib/gitlab/routing.rb
浏览文件 @
c81928cf
...
...
@@ -2,10 +2,30 @@ module Gitlab
module
Routing
extend
ActiveSupport
::
Concern
mattr_accessor
:_includers
self
.
_includers
=
[]
included
do
Gitlab
::
Routing
.
_includers
<<
self
include
Gitlab
::
Routing
.
url_helpers
end
def
self
.
add_helpers
(
mod
)
url_helpers
.
include
mod
url_helpers
.
extend
mod
app_url_helpers
=
Gitlab
::
Application
.
routes
.
named_routes
.
url_helpers_module
app_url_helpers
.
include
mod
app_url_helpers
.
extend
mod
GitlabRoutingHelper
.
include
mod
GitlabRoutingHelper
.
extend
mod
_includers
.
each
do
|
klass
|
klass
.
include
mod
end
end
# Returns the URL helpers Module.
#
# This method caches the output as Rails' "url_helpers" method creates an
...
...
lib/gitlab/slash_commands/presenters/base.rb
浏览文件 @
c81928cf
...
...
@@ -2,7 +2,7 @@ module Gitlab
module
SlashCommands
module
Presenters
class
Base
include
Gitlab
::
Routing
.
url_helpers
include
Gitlab
::
Routing
def
initialize
(
resource
=
nil
)
@resource
=
resource
...
...
lib/gitlab/url_builder.rb
浏览文件 @
c81928cf
module
Gitlab
class
UrlBuilder
include
Gitlab
::
Routing
.
url_helpers
include
Gitlab
::
Routing
include
GitlabRoutingHelper
include
ActionView
::
RecordIdentifier
...
...
spec/lib/extracts_path_spec.rb
浏览文件 @
c81928cf
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
ExtractsPath
,
lib:
true
do
include
ExtractsPath
include
RepoHelpers
include
Gitlab
::
Routing
.
url_helpers
include
Gitlab
::
Routing
let
(
:project
)
{
double
(
'project'
)
}
let
(
:request
)
{
double
(
'request'
)
}
...
...
spec/models/project_services/jira_service_spec.rb
浏览文件 @
c81928cf
require
'spec_helper'
describe
JiraService
,
models:
true
do
include
Gitlab
::
Routing
.
url_helpers
include
Gitlab
::
Routing
describe
"Associations"
do
it
{
is_expected
.
to
belong_to
:project
}
...
...
spec/services/system_note_service_spec.rb
浏览文件 @
c81928cf
require
'spec_helper'
describe
SystemNoteService
,
services:
true
do
include
Gitlab
::
Routing
.
url_helpers
include
Gitlab
::
Routing
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:author
)
{
create
(
:user
)
}
...
...
spec/spec_helper.rb
浏览文件 @
c81928cf
...
...
@@ -57,7 +57,7 @@ RSpec.configure do |config|
config
.
include
StubGitlabCalls
config
.
include
StubGitlabData
config
.
include
ApiHelpers
,
:api
config
.
include
Gitlab
::
Routing
.
url_helpers
,
type: :routing
config
.
include
Gitlab
::
Routing
,
type: :routing
config
.
include
MigrationsHelpers
,
:migration
config
.
infer_spec_type_from_file_location!
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录