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
3f59d25d
Commit
3f59d25d
authored
Aug 22, 2016
by
Douglas Barbosa Alexandre
Committed by
Stan Hu
Nov 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an endpoint to get a list of issue comments
parent
3dd15d3f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
0 deletions
+46
-0
lib/bitbucket/client.rb
lib/bitbucket/client.rb
+10
-0
lib/bitbucket/representation/comment.rb
lib/bitbucket/representation/comment.rb
+27
-0
lib/bitbucket/representation/url.rb
lib/bitbucket/representation/url.rb
+9
-0
No files found.
lib/bitbucket/client.rb
View file @
3f59d25d
...
@@ -11,6 +11,16 @@ module Bitbucket
...
@@ -11,6 +11,16 @@ module Bitbucket
Collection
.
new
(
paginator
)
Collection
.
new
(
paginator
)
end
end
def
issue_comments
(
repo
,
number
)
relative_path
=
"/repositories/
#{
repo
}
/issues/
#{
number
}
/comments"
paginator
=
Paginator
.
new
(
connection
,
relative_path
,
:url
)
Collection
.
new
(
paginator
).
map
do
|
comment_url
|
parsed_response
=
connection
.
get
(
comment_url
.
to_s
)
Representation
::
Comment
.
new
(
parsed_response
)
end
end
def
repo
(
name
)
def
repo
(
name
)
parsed_response
=
connection
.
get
(
"/repositories/
#{
name
}
"
)
parsed_response
=
connection
.
get
(
"/repositories/
#{
name
}
"
)
...
...
lib/bitbucket/representation/comment.rb
0 → 100644
View file @
3f59d25d
module
Bitbucket
module
Representation
class
Comment
<
Representation
::
Base
def
author
user
.
fetch
(
'username'
,
'Anonymous'
)
end
def
note
raw
.
dig
(
'content'
,
'raw'
)
end
def
created_at
raw
[
'created_on'
]
end
def
updated_at
raw
[
'updated_on'
]
||
raw
[
'created_on'
]
end
private
def
user
raw
.
fetch
(
'user'
,
{})
end
end
end
end
lib/bitbucket/representation/url.rb
0 → 100644
View file @
3f59d25d
module
Bitbucket
module
Representation
class
Url
<
Representation
::
Base
def
to_s
raw
.
dig
(
'links'
,
'self'
,
'href'
)
end
end
end
end
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