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
f6a91ccc
Commit
f6a91ccc
authored
Jan 29, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move eraseable implementation to build concern
parent
9972abc2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
37 deletions
+7
-37
build.rb
app/models/ci/build.rb
+2
-3
eraseable.rb
app/models/ci/build/eraseable.rb
+5
-15
compoundable.rb
app/models/concerns/compoundable.rb
+0
-19
No files found.
app/models/ci/build.rb
View file @
f6a91ccc
...
...
@@ -35,10 +35,9 @@
module
Ci
class
Build
<
CommitStatus
include
Compoundable
component
:eraseable
,
Gitlab
::
Ci
::
Build
::
Eraseable
include
Gitlab
::
Application
.
routes
.
url_helpers
include
Eraseable
LAZY_ATTRIBUTES
=
[
'trace'
]
belongs_to
:runner
,
class_name:
'Ci::Runner'
...
...
lib/gitlab
/ci/build/eraseable.rb
→
app/models
/ci/build/eraseable.rb
View file @
f6a91ccc
module
Gitlab
module
Ci
module
Build
class
Eraseable
def
initialize
(
build
)
@build
=
build
end
module
Ci
class
Build
module
Eraseable
include
ActiveSupport
::
Concern
def
erase!
raise
NotImplementedError
end
def
erased?
@build
.
artifacts_file
.
exists?
&&
@build
.
artifacts_metadata
.
exists?
end
private
def
trace_file
raise
NotImplementedError
end
raise
NotImpementedError
end
end
end
...
...
app/models/concerns/compoundable.rb
deleted
100644 → 0
View file @
9972abc2
module
Compoundable
extend
ActiveSupport
::
Concern
class_methods
do
private
def
component
(
name
,
klass
)
define_method
(
name
)
do
component_object
=
instance_variable_get
(
"@
#{
name
}
"
)
return
component_object
if
component_object
instance_variable_set
(
"@
#{
name
}
"
,
klass
.
new
(
self
))
end
klass
.
instance_methods
(
false
).
each
do
|
method
|
delegate
method
,
to:
name
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