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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
3dd15d3f
Commit
3dd15d3f
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 issues for a repo
parent
267e27b0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
lib/bitbucket/client.rb
lib/bitbucket/client.rb
+7
-0
lib/bitbucket/representation/issue.rb
lib/bitbucket/representation/issue.rb
+49
-0
No files found.
lib/bitbucket/client.rb
View file @
3dd15d3f
...
...
@@ -4,6 +4,13 @@ module Bitbucket
@connection
=
options
.
fetch
(
:connection
,
Connection
.
new
(
options
))
end
def
issues
(
repo
)
relative_path
=
"/repositories/
#{
repo
}
/issues"
paginator
=
Paginator
.
new
(
connection
,
relative_path
,
:issue
)
Collection
.
new
(
paginator
)
end
def
repo
(
name
)
parsed_response
=
connection
.
get
(
"/repositories/
#{
name
}
"
)
...
...
lib/bitbucket/representation/issue.rb
0 → 100644
View file @
3dd15d3f
module
Bitbucket
module
Representation
class
Issue
<
Representation
::
Base
CLOSED_STATUS
=
%w(resolved invalid duplicate wontfix closed)
.
freeze
def
iid
raw
[
'id'
]
end
def
author
reporter
.
fetch
(
'username'
,
'Anonymous'
)
end
def
description
raw
.
dig
(
'content'
,
'raw'
)
end
def
state
closed?
?
'closed'
:
'opened'
end
def
title
raw
[
'title'
]
end
def
created_at
raw
[
'created_on'
]
end
def
updated_at
raw
[
'edited_on'
]
end
def
to_s
iid
end
private
def
closed?
CLOSED_STATUS
.
include?
(
raw
[
'state'
])
end
def
reporter
raw
.
fetch
(
'reporter'
,
{})
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