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
Boxiang Sun
gitlab-ce
Commits
c7809d09
Commit
c7809d09
authored
Mar 22, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rubocop offense in pipeline build seed class
parent
7259ee85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
lib/gitlab/ci/pipeline/seed/build.rb
lib/gitlab/ci/pipeline/seed/build.rb
+11
-13
No files found.
lib/gitlab/ci/pipeline/seed/build.rb
View file @
c7809d09
...
...
@@ -5,9 +5,7 @@ module Gitlab
class
Build
<
Seed
::
Base
include
Gitlab
::
Utils
::
StrongMemoize
attr_reader
:pipeline
,
:attributes
delegate
:dig
,
to: :attributes
delegate
:dig
,
to: :@attributes
def
initialize
(
pipeline
,
attributes
)
@pipeline
=
pipeline
...
...
@@ -23,6 +21,16 @@ module Gitlab
@attributes
.
merge!
(
user:
current_user
)
end
def
included?
strong_memoize
(
:inclusion
)
do
only_specs
=
Gitlab
::
Ci
::
Build
::
Policy
.
fabricate
(
@only
)
except_specs
=
Gitlab
::
Ci
::
Build
::
Policy
.
fabricate
(
@except
)
only_specs
.
all?
{
|
spec
|
spec
.
satisfied_by?
(
@pipeline
)
}
&&
except_specs
.
none?
{
|
spec
|
spec
.
satisfied_by?
(
@pipeline
)
}
end
end
def
attributes
@attributes
.
merge
(
pipeline:
@pipeline
,
...
...
@@ -34,16 +42,6 @@ module Gitlab
)
end
def
included?
strong_memoize
(
:inclusion
)
do
only_specs
=
Gitlab
::
Ci
::
Build
::
Policy
.
fabricate
(
@only
)
except_specs
=
Gitlab
::
Ci
::
Build
::
Policy
.
fabricate
(
@except
)
only_specs
.
all?
{
|
spec
|
spec
.
satisfied_by?
(
pipeline
)
}
&&
except_specs
.
none?
{
|
spec
|
spec
.
satisfied_by?
(
pipeline
)
}
end
end
def
to_resource
::
Ci
::
Build
.
new
(
attributes
)
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