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
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
...
@@ -6,7 +6,7 @@ module Bitbucket
end
end
def
note
def
note
raw
.
dig
(
'content'
,
'raw'
)
raw
.
fetch
(
'content'
,
{}).
fetch
(
'raw'
,
nil
)
end
end
def
created_at
def
created_at
...
...
lib/bitbucket/representation/issue.rb
View file @
a3be4aeb
...
@@ -12,11 +12,11 @@ module Bitbucket
...
@@ -12,11 +12,11 @@ module Bitbucket
end
end
def
author
def
author
raw
.
dig
(
'reporter'
,
'username'
)
raw
.
fetch
(
'reporter'
,
{}).
fetch
(
'username'
,
nil
)
end
end
def
description
def
description
raw
.
dig
(
'content'
,
'raw'
)
raw
.
fetch
(
'content'
,
{}).
fetch
(
'raw'
,
nil
)
end
end
def
state
def
state
...
@@ -28,7 +28,7 @@ module Bitbucket
...
@@ -28,7 +28,7 @@ module Bitbucket
end
end
def
milestone
def
milestone
raw
.
dig
(
'milestone'
,
'name'
)
raw
[
'milestone'
][
'name'
]
if
raw
[
'milestone'
].
present?
end
end
def
created_at
def
created_at
...
...
lib/bitbucket/representation/pull_request.rb
View file @
a3be4aeb
...
@@ -2,7 +2,7 @@ module Bitbucket
...
@@ -2,7 +2,7 @@ module Bitbucket
module
Representation
module
Representation
class
PullRequest
<
Representation
::
Base
class
PullRequest
<
Representation
::
Base
def
author
def
author
raw
.
dig
(
'author'
,
'username'
)
raw
.
fetch
(
'author'
,
{}).
fetch
(
'username'
,
nil
)
end
end
def
description
def
description
...
@@ -36,19 +36,19 @@ module Bitbucket
...
@@ -36,19 +36,19 @@ module Bitbucket
end
end
def
source_branch_name
def
source_branch_name
source_branch
.
dig
(
'branch'
,
'name'
)
source_branch
.
fetch
(
'branch'
,
{}).
fetch
(
'name'
,
nil
)
end
end
def
source_branch_sha
def
source_branch_sha
source_branch
.
dig
(
'commit'
,
'hash'
)
source_branch
.
fetch
(
'commit'
,
{}).
fetch
(
'hash'
,
nil
)
end
end
def
target_branch_name
def
target_branch_name
target_branch
.
dig
(
'branch'
,
'name'
)
target_branch
.
fetch
(
'branch'
,
{}).
fetch
(
'name'
,
nil
)
end
end
def
target_branch_sha
def
target_branch_sha
target_branch
.
dig
(
'commit'
,
'hash'
)
target_branch
.
fetch
(
'commit'
,
{}).
fetch
(
'hash'
,
nil
)
end
end
private
private
...
...
lib/bitbucket/representation/pull_request_comment.rb
View file @
a3be4aeb
...
@@ -18,7 +18,7 @@ module Bitbucket
...
@@ -18,7 +18,7 @@ module Bitbucket
end
end
def
parent_id
def
parent_id
raw
.
dig
(
'parent'
,
'id'
)
raw
.
fetch
(
'parent'
,
{}).
fetch
(
'id'
,
nil
)
end
end
def
inline?
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