Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
19350db42587
Commit
3dd15d3f
authored
Aug 22, 2016
by
Douglas Barbosa Alexandre
Committed by
Stan Hu
Nov 21, 2016
Browse files
Add an endpoint to get a list of issues for a repo
parent
013de17380c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/bitbucket/client.rb
View file @
19350db4
...
...
@@ -4,6 +4,13 @@ def initialize(options = {})
@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 @
19350db4
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