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
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
0 deletions
+47
-0
app/models/ci/build.rb
app/models/ci/build.rb
+3
-0
app/models/concerns/compoundable.rb
app/models/concerns/compoundable.rb
+19
-0
lib/gitlab/ci/build/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