BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c7c4d657
Commit
c7c4d657
authored
Nov 19, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up Bitbucket connection based on review comments
parent
4d7303a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
client.rb
lib/bitbucket/client.rb
+1
-1
connection.rb
lib/bitbucket/connection.rb
+8
-8
No files found.
lib/bitbucket/client.rb
View file @
c7c4d657
module
Bitbucket
module
Bitbucket
class
Client
class
Client
def
initialize
(
options
=
{})
def
initialize
(
options
=
{})
@connection
=
options
.
fetch
(
:connection
,
Connection
.
new
(
options
)
)
@connection
=
Connection
.
new
(
options
)
end
end
def
issues
(
repo
)
def
issues
(
repo
)
...
...
lib/bitbucket/connection.rb
View file @
c7c4d657
...
@@ -7,12 +7,12 @@ module Bitbucket
...
@@ -7,12 +7,12 @@ module Bitbucket
def
initialize
(
options
=
{})
def
initialize
(
options
=
{})
@api_version
=
options
.
fetch
(
:api_version
,
DEFAULT_API_VERSION
)
@api_version
=
options
.
fetch
(
:api_version
,
DEFAULT_API_VERSION
)
@base_uri
=
options
.
fetch
(
:base_uri
,
DEFAULT_BASE_URI
)
@base_uri
=
options
.
fetch
(
:base_uri
,
DEFAULT_BASE_URI
)
@
query
=
options
.
fetch
(
:query
,
DEFAULT_QUERY
)
@
default_query
=
options
.
fetch
(
:query
,
DEFAULT_QUERY
)
@token
=
options
.
fetch
(
:token
)
@token
=
options
[
:token
]
@expires_at
=
options
.
fetch
(
:expires_at
)
@expires_at
=
options
[
:expires_at
]
@expires_in
=
options
.
fetch
(
:expires_in
)
@expires_in
=
options
[
:expires_in
]
@refresh_token
=
options
.
fetch
(
:refresh_token
)
@refresh_token
=
options
[
:refresh_token
]
end
end
def
client
def
client
...
@@ -24,13 +24,13 @@ module Bitbucket
...
@@ -24,13 +24,13 @@ module Bitbucket
end
end
def
query
(
params
=
{})
def
query
(
params
=
{})
@query
.
merge!
(
params
)
@
default_
query
.
merge!
(
params
)
end
end
def
get
(
path
,
query
=
{})
def
get
(
path
,
extra_
query
=
{})
refresh!
if
expired?
refresh!
if
expired?
response
=
connection
.
get
(
build_url
(
path
),
params:
@
query
.
merge
(
query
))
response
=
connection
.
get
(
build_url
(
path
),
params:
@
default_query
.
merge
(
extra_
query
))
response
.
parsed
response
.
parsed
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