Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
473445c7
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,发现更多精彩内容 >>
提交
473445c7
编写于
1月 08, 2012
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
complete hooks for post receive
上级
57ac5fe9
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
64 addition
and
5 deletion
+64
-5
.foreman
.foreman
+1
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
app/controllers/repositories_controller.rb
app/controllers/repositories_controller.rb
+1
-1
app/views/hooks/_data_ex.html.erb
app/views/hooks/_data_ex.html.erb
+42
-0
app/views/hooks/index.html.haml
app/views/hooks/index.html.haml
+14
-0
app/views/hooks/show.html.haml
app/views/hooks/show.html.haml
+4
-1
config/database.yml
config/database.yml
+1
-1
未找到文件。
.foreman
浏览文件 @
473445c7
port:
9999
port:
3000
app/controllers/projects_controller.rb
浏览文件 @
473445c7
...
...
@@ -68,7 +68,7 @@ class ProjectsController < ApplicationController
def
show
return
render
"projects/empty"
unless
@project
.
repo_exists?
&&
@project
.
has_commits?
limit
=
(
params
[
:limit
]
||
1
0
).
to_i
limit
=
(
params
[
:limit
]
||
2
0
).
to_i
@activities
=
@project
.
cached_updates
(
limit
)
end
...
...
app/controllers/repositories_controller.rb
浏览文件 @
473445c7
...
...
@@ -9,7 +9,7 @@ class RepositoriesController < ApplicationController
layout
"project"
def
show
@activities
=
@project
.
fresh_commits
(
1
0
)
@activities
=
@project
.
fresh_commits
(
2
0
)
end
def
branches
...
...
app/views/hooks/_data_ex.html.erb
0 → 100644
浏览文件 @
473445c7
<%
data_ex_str
=
<<
eos
{
:before => "95790bf891e76fee5e1747ab589903a6a1f80f22",
:after => "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
:ref => "refs/heads/master",
:repository => {
:name => "Diaspora",
:url => "localhost/diaspora",
:description => "",
:homepage => "localhost/diaspora",
:private => true
},
:commits => [
[0] {
:id => "450d0de7532f8b663b9c5cce183b...",
:message => "Update Catalan translation to e38cb41.",
:timestamp => "2011-12-12T14:27:31+02:00",
:url => "http://localhost/diaspora/commits/450d0de7532f...",
:author => {
:name => "Jordi Mallach",
:email => "jordi@softcatala.org"
}
},
....
[3] {
:id => "da1560886d4f094c3e6c9ef40349...",
:message => "fixed readme",
:timestamp => "2012-01-03T23:36:29+02:00",
:url => "http://localhost/diaspora/commits/da1560886d...",
:author => {
:name => "gitlab dev user",
:email => "gitlabdev@dv6700.(none)"
}
}
]
}
eos
%>
<%
js_lexer
=
Pygments
::
Lexer
[
:js
]
%>
<%=
raw
js_lexer
.
highlight
(
data_ex_str
)
%>
app/views/hooks/index.html.haml
浏览文件 @
473445c7
=
render
"repositories/head"
.right
=
link_to
"Add new"
,
new_project_hook_path
(
@project
),
:class
=>
"grey-button append-bottom-10"
-
unless
@hooks
.
empty?
%div
.update-data.ui-box.ui-box-small
...
...
@@ -14,3 +18,13 @@
-
else
%h3
No hooks
.clear
%h3
Help
%p
Post receive hooks. For now only POST request allowed. We send some data with request. Example below
.view_file
.view_file_header
%strong
POST data passed
.data.no-padding
=
render
"data_ex"
app/views/hooks/show.html.haml
浏览文件 @
473445c7
=
render
"repositories/head"
%h3
=
@hook
.
url
%h3
%span
.commit.tag
POST
=
@hook
.
url
-
if
can?
current_user
,
:admin_project
,
@project
.merge-tabs
...
...
config/database.yml
浏览文件 @
473445c7
...
...
@@ -20,6 +20,6 @@ test:
production
:
adapter
:
sqlite3
database
:
db/
production
.sqlite3
database
:
db/
development
.sqlite3
pool
:
5
timeout
:
5000
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录