Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
06399b32
Commit
06399b32
authored
Apr 04, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show Google Code image attachments inline.
parent
e8fb197d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
lib/gitlab/google_code_import/importer.rb
lib/gitlab/google_code_import/importer.rb
+6
-2
spec/fixtures/GoogleCodeProjectHosting.json
spec/fixtures/GoogleCodeProjectHosting.json
+5
-0
spec/lib/gitlab/google_code_import/importer_spec.rb
spec/lib/gitlab/google_code_import/importer_spec.rb
+2
-1
No files found.
lib/gitlab/google_code_import/importer.rb
View file @
06399b32
...
...
@@ -314,8 +314,12 @@ module Gitlab
raw_attachments
.
map
do
|
attachment
|
next
if
attachment
[
"isDeleted"
]
link
=
"https://storage.googleapis.com/google-code-attachments/
#{
@repo
.
name
}
/issue-
#{
issue_id
}
/comment-
#{
comment_id
}
/
#{
attachment
[
"fileName"
]
}
"
"[
#{
attachment
[
"fileName"
]
}
](
#{
link
}
)"
filename
=
attachment
[
"fileName"
]
link
=
"https://storage.googleapis.com/google-code-attachments/
#{
@repo
.
name
}
/issue-
#{
issue_id
}
/comment-
#{
comment_id
}
/
#{
filename
}
"
text
=
"[
#{
filename
}
](
#{
link
}
)"
text
=
"!
#{
text
}
"
if
filename
=~
/\.(png|jpg|jpeg|gif|bmp|tiff)\z/
text
end
.
compact
end
end
...
...
spec/fixtures/GoogleCodeProjectHosting.json
View file @
06399b32
...
...
@@ -372,6 +372,11 @@
"fileName"
:
"tint2_task_scrolling.diff"
,
"fileSize"
:
3059
,
"mimetype"
:
"text/x-c++; charset=us-ascii"
},
{
"attachmentId"
:
"000"
,
"fileName"
:
"screenshot.png"
,
"fileSize"
:
0
,
"mimetype"
:
"image/png"
}
]
},
{
"id"
:
1
,
...
...
spec/lib/gitlab/google_code_import/importer_spec.rb
View file @
06399b32
...
...
@@ -49,7 +49,8 @@ describe Gitlab::GoogleCodeImport::Importer do
expect
(
issue
.
description
).
to
include
(
'Patch is attached that adds two new mouse\-actions \(next\_taskprev\_task\)'
)
expect
(
issue
.
description
).
to
include
(
'that can be used for exactly that purpose.'
)
expect
(
issue
.
description
).
to
include
(
'all the best!'
)
expect
(
issue
.
description
).
to
include
(
'https://storage.googleapis.com/google-code-attachments/tint2/issue-169/comment-0/tint2_task_scrolling.diff'
)
expect
(
issue
.
description
).
to
include
(
'[tint2_task_scrolling.diff](https://storage.googleapis.com/google-code-attachments/tint2/issue-169/comment-0/tint2_task_scrolling.diff)'
)
expect
(
issue
.
description
).
to
include
(
'![screenshot.png](https://storage.googleapis.com/google-code-attachments/tint2/issue-169/comment-0/screenshot.png)'
)
end
it
"imports issue comments"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment