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
9972abc2
Commit
9972abc2
authored
Jan 28, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add methods to build eraseable component
parent
c1affed1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
0 deletions
+47
-0
build.rb
app/models/ci/build.rb
+3
-0
compoundable.rb
app/models/concerns/compoundable.rb
+19
-0
eraseable.rb
lib/gitlab/ci/build/eraseable.rb
+25
-0
No files found.
app/models/ci/build.rb
View file @
9972abc2
...
...
@@ -35,6 +35,9 @@
module
Ci
class
Build
<
CommitStatus
include
Compoundable
component
:eraseable
,
Gitlab
::
Ci
::
Build
::
Eraseable
include
Gitlab
::
Application
.
routes
.
url_helpers
LAZY_ATTRIBUTES
=
[
'trace'
]
...
...
app/models/concerns/compoundable.rb
0 → 100644
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
lib/gitlab/ci/build/eraseable.rb
0 → 100644
View file @
9972abc2
module
Gitlab
module
Ci
module
Build
class
Eraseable
def
initialize
(
build
)
@build
=
build
end
def
erase!
raise
NotImplementedError
end
def
erased?
@build
.
artifacts_file
.
exists?
&&
@build
.
artifacts_metadata
.
exists?
end
private
def
trace_file
raise
NotImplementedError
end
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