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
a3be4aeb
Commit
a3be4aeb
authored
Dec 16, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid use of Hash#dig to keep compatibility with Ruby 2.1
parent
fe9a372c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
lib/bitbucket/representation/comment.rb
lib/bitbucket/representation/comment.rb
+1
-1
lib/bitbucket/representation/issue.rb
lib/bitbucket/representation/issue.rb
+3
-3
lib/bitbucket/representation/pull_request.rb
lib/bitbucket/representation/pull_request.rb
+5
-5
lib/bitbucket/representation/pull_request_comment.rb
lib/bitbucket/representation/pull_request_comment.rb
+1
-1
No files found.
lib/bitbucket/representation/comment.rb
View file @
a3be4aeb
...
...
@@ -6,7 +6,7 @@ module Bitbucket
end
def
note
raw
.
dig
(
'content'
,
'raw'
)
raw
.
fetch
(
'content'
,
{}).
fetch
(
'raw'
,
nil
)
end
def
created_at
...
...
lib/bitbucket/representation/issue.rb
View file @
a3be4aeb
...
...
@@ -12,11 +12,11 @@ module Bitbucket
end
def
author
raw
.
dig
(
'reporter'
,
'username'
)
raw
.
fetch
(
'reporter'
,
{}).
fetch
(
'username'
,
nil
)
end
def
description
raw
.
dig
(
'content'
,
'raw'
)
raw
.
fetch
(
'content'
,
{}).
fetch
(
'raw'
,
nil
)
end
def
state
...
...
@@ -28,7 +28,7 @@ module Bitbucket
end
def
milestone
raw
.
dig
(
'milestone'
,
'name'
)
raw
[
'milestone'
][
'name'
]
if
raw
[
'milestone'
].
present?
end
def
created_at
...
...
lib/bitbucket/representation/pull_request.rb
View file @
a3be4aeb
...
...
@@ -2,7 +2,7 @@ module Bitbucket
module
Representation
class
PullRequest
<
Representation
::
Base
def
author
raw
.
dig
(
'author'
,
'username'
)
raw
.
fetch
(
'author'
,
{}).
fetch
(
'username'
,
nil
)
end
def
description
...
...
@@ -36,19 +36,19 @@ module Bitbucket
end
def
source_branch_name
source_branch
.
dig
(
'branch'
,
'name'
)
source_branch
.
fetch
(
'branch'
,
{}).
fetch
(
'name'
,
nil
)
end
def
source_branch_sha
source_branch
.
dig
(
'commit'
,
'hash'
)
source_branch
.
fetch
(
'commit'
,
{}).
fetch
(
'hash'
,
nil
)
end
def
target_branch_name
target_branch
.
dig
(
'branch'
,
'name'
)
target_branch
.
fetch
(
'branch'
,
{}).
fetch
(
'name'
,
nil
)
end
def
target_branch_sha
target_branch
.
dig
(
'commit'
,
'hash'
)
target_branch
.
fetch
(
'commit'
,
{}).
fetch
(
'hash'
,
nil
)
end
private
...
...
lib/bitbucket/representation/pull_request_comment.rb
View file @
a3be4aeb
...
...
@@ -18,7 +18,7 @@ module Bitbucket
end
def
parent_id
raw
.
dig
(
'parent'
,
'id'
)
raw
.
fetch
(
'parent'
,
{}).
fetch
(
'id'
,
nil
)
end
def
inline?
...
...
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