Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
52daddc0
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,体验更适合开发者的 AI 搜索 >>
提交
52daddc0
编写于
8月 30, 2016
作者:
D
Douglas Barbosa Alexandre
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use updated_at as the last updated date when importing from GitHub
上级
08ab410f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
55 deletion
+15
-55
lib/gitlab/github_import/issue_formatter.rb
lib/gitlab/github_import/issue_formatter.rb
+1
-5
lib/gitlab/github_import/milestone_formatter.rb
lib/gitlab/github_import/milestone_formatter.rb
+6
-30
lib/gitlab/github_import/pull_request_formatter.rb
lib/gitlab/github_import/pull_request_formatter.rb
+1
-10
spec/lib/gitlab/github_import/issue_formatter_spec.rb
spec/lib/gitlab/github_import/issue_formatter_spec.rb
+2
-3
spec/lib/gitlab/github_import/milestone_formatter_spec.rb
spec/lib/gitlab/github_import/milestone_formatter_spec.rb
+2
-3
spec/lib/gitlab/github_import/pull_request_formatter_spec.rb
spec/lib/gitlab/github_import/pull_request_formatter_spec.rb
+3
-4
未找到文件。
lib/gitlab/github_import/issue_formatter.rb
浏览文件 @
52daddc0
...
...
@@ -12,7 +12,7 @@ module Gitlab
author_id:
author_id
,
assignee_id:
assignee_id
,
created_at:
raw_data
.
created_at
,
updated_at:
updated_at
updated_at:
raw_data
.
updated_at
}
end
...
...
@@ -69,10 +69,6 @@ module Gitlab
def
state
raw_data
.
state
==
'closed'
?
'closed'
:
'opened'
end
def
updated_at
state
==
'closed'
?
raw_data
.
closed_at
:
raw_data
.
updated_at
end
end
end
end
lib/gitlab/github_import/milestone_formatter.rb
浏览文件 @
52daddc0
...
...
@@ -3,14 +3,14 @@ module Gitlab
class
MilestoneFormatter
<
BaseFormatter
def
attributes
{
iid:
number
,
iid:
raw_data
.
number
,
project:
project
,
title:
title
,
description:
description
,
due_date:
due_date
,
title:
raw_data
.
title
,
description:
raw_data
.
description
,
due_date:
raw_data
.
due_on
,
state:
state
,
created_at:
created_at
,
updated_at:
updated_at
created_at:
raw_data
.
created_at
,
updated_at:
raw_data
.
updated_at
}
end
...
...
@@ -20,33 +20,9 @@ module Gitlab
private
def
number
raw_data
.
number
end
def
title
raw_data
.
title
end
def
description
raw_data
.
description
end
def
due_date
raw_data
.
due_on
end
def
state
raw_data
.
state
==
'closed'
?
'closed'
:
'active'
end
def
created_at
raw_data
.
created_at
end
def
updated_at
state
==
'closed'
?
raw_data
.
closed_at
:
raw_data
.
updated_at
end
end
end
end
lib/gitlab/github_import/pull_request_formatter.rb
浏览文件 @
52daddc0
...
...
@@ -20,7 +20,7 @@ module Gitlab
author_id:
author_id
,
assignee_id:
assignee_id
,
created_at:
raw_data
.
created_at
,
updated_at:
updated_at
updated_at:
raw_data
.
updated_at
}
end
...
...
@@ -103,15 +103,6 @@ module Gitlab
'opened'
end
end
def
updated_at
case
state
when
'merged'
then
raw_data
.
merged_at
when
'closed'
then
raw_data
.
closed_at
else
raw_data
.
updated_at
end
end
end
end
end
spec/lib/gitlab/github_import/issue_formatter_spec.rb
浏览文件 @
52daddc0
...
...
@@ -48,8 +48,7 @@ describe Gitlab::GithubImport::IssueFormatter, lib: true do
end
context
'when issue is closed'
do
let
(
:closed_at
)
{
DateTime
.
strptime
(
'2011-01-28T19:01:12Z'
)
}
let
(
:raw_data
)
{
double
(
base_data
.
merge
(
state:
'closed'
,
closed_at:
closed_at
))
}
let
(
:raw_data
)
{
double
(
base_data
.
merge
(
state:
'closed'
))
}
it
'returns formatted attributes'
do
expected
=
{
...
...
@@ -62,7 +61,7 @@ describe Gitlab::GithubImport::IssueFormatter, lib: true do
author_id:
project
.
creator_id
,
assignee_id:
nil
,
created_at:
created_at
,
updated_at:
clos
ed_at
updated_at:
updat
ed_at
}
expect
(
issue
.
attributes
).
to
eq
(
expected
)
...
...
spec/lib/gitlab/github_import/milestone_formatter_spec.rb
浏览文件 @
52daddc0
...
...
@@ -40,8 +40,7 @@ describe Gitlab::GithubImport::MilestoneFormatter, lib: true do
end
context
'when milestone is closed'
do
let
(
:closed_at
)
{
DateTime
.
strptime
(
'2011-01-28T19:01:12Z'
)
}
let
(
:raw_data
)
{
double
(
base_data
.
merge
(
state:
'closed'
,
closed_at:
closed_at
))
}
let
(
:raw_data
)
{
double
(
base_data
.
merge
(
state:
'closed'
))
}
it
'returns formatted attributes'
do
expected
=
{
...
...
@@ -52,7 +51,7 @@ describe Gitlab::GithubImport::MilestoneFormatter, lib: true do
state:
'closed'
,
due_date:
nil
,
created_at:
created_at
,
updated_at:
clos
ed_at
updated_at:
updat
ed_at
}
expect
(
formatter
.
attributes
).
to
eq
(
expected
)
...
...
spec/lib/gitlab/github_import/pull_request_formatter_spec.rb
浏览文件 @
52daddc0
...
...
@@ -62,8 +62,7 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
end
context
'when pull request is closed'
do
let
(
:closed_at
)
{
DateTime
.
strptime
(
'2011-01-28T19:01:12Z'
)
}
let
(
:raw_data
)
{
double
(
base_data
.
merge
(
state:
'closed'
,
closed_at:
closed_at
))
}
let
(
:raw_data
)
{
double
(
base_data
.
merge
(
state:
'closed'
))
}
it
'returns formatted attributes'
do
expected
=
{
...
...
@@ -81,7 +80,7 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
author_id:
project
.
creator_id
,
assignee_id:
nil
,
created_at:
created_at
,
updated_at:
clos
ed_at
updated_at:
updat
ed_at
}
expect
(
pull_request
.
attributes
).
to
eq
(
expected
)
...
...
@@ -108,7 +107,7 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
author_id:
project
.
creator_id
,
assignee_id:
nil
,
created_at:
created_at
,
updated_at:
merg
ed_at
updated_at:
updat
ed_at
}
expect
(
pull_request
.
attributes
).
to
eq
(
expected
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录