Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
4328bc17
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,发现更多精彩内容 >>
提交
4328bc17
编写于
5月 12, 2017
作者:
D
Douwe Maan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow blob viewer to support multiple filetypes
上级
361b2b13
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
7 addition
and
7 deletion
+7
-7
app/models/blob_viewer/base.rb
app/models/blob_viewer/base.rb
+4
-4
app/models/blob_viewer/gitlab_ci_yml.rb
app/models/blob_viewer/gitlab_ci_yml.rb
+1
-1
app/models/blob_viewer/license.rb
app/models/blob_viewer/license.rb
+1
-1
app/models/blob_viewer/route_map.rb
app/models/blob_viewer/route_map.rb
+1
-1
未找到文件。
app/models/blob_viewer/base.rb
浏览文件 @
4328bc17
...
...
@@ -2,7 +2,7 @@ module BlobViewer
class
Base
PARTIAL_PATH_PREFIX
=
'projects/blob/viewers'
.
freeze
class_attribute
:partial_name
,
:loading_partial_name
,
:type
,
:extensions
,
:file_type
,
:client_side
,
:binary
,
:switcher_icon
,
:switcher_title
,
:max_size
,
:absolute_max_size
class_attribute
:partial_name
,
:loading_partial_name
,
:type
,
:extensions
,
:file_type
s
,
:client_side
,
:binary
,
:switcher_icon
,
:switcher_title
,
:max_size
,
:absolute_max_size
self
.
loading_partial_name
=
'loading'
...
...
@@ -54,17 +54,17 @@ module BlobViewer
def
self
.
can_render?
(
blob
,
verify_binary:
true
)
return
false
if
verify_binary
&&
binary?
!=
blob
.
binary?
return
true
if
extensions
&
.
include?
(
blob
.
extension
)
return
true
if
file_type
&&
Gitlab
::
FileDetector
.
type_of
(
blob
.
path
)
==
file_type
return
true
if
file_type
s
&
.
include?
(
Gitlab
::
FileDetector
.
type_of
(
blob
.
path
))
false
end
def
too_large?
blob
.
raw_size
>
max_size
max_size
&&
blob
.
raw_size
>
max_size
end
def
absolutely_too_large?
blob
.
raw_size
>
absolute_max_size
absolute_max_size
&&
blob
.
raw_size
>
absolute_max_size
end
def
can_override_max_size?
...
...
app/models/blob_viewer/gitlab_ci_yml.rb
浏览文件 @
4328bc17
...
...
@@ -5,7 +5,7 @@ module BlobViewer
self
.
partial_name
=
'gitlab_ci_yml'
self
.
loading_partial_name
=
'gitlab_ci_yml_loading'
self
.
file_type
=
:gitlab_ci
self
.
file_type
s
=
%i(gitlab_ci)
self
.
binary
=
false
def
validation_message
...
...
app/models/blob_viewer/license.rb
浏览文件 @
4328bc17
...
...
@@ -7,7 +7,7 @@ module BlobViewer
include
Auxiliary
self
.
partial_name
=
'license'
self
.
file_type
=
:license
self
.
file_type
s
=
%i(license)
self
.
binary
=
false
def
license
...
...
app/models/blob_viewer/route_map.rb
浏览文件 @
4328bc17
...
...
@@ -5,7 +5,7 @@ module BlobViewer
self
.
partial_name
=
'route_map'
self
.
loading_partial_name
=
'route_map_loading'
self
.
file_type
=
:route_map
self
.
file_type
s
=
%i(route_map)
self
.
binary
=
false
def
validation_message
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录