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
Tatuya Kamada
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
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
47 deletions
+17
-47
app/models/ci/build.rb
app/models/ci/build.rb
+2
-3
app/models/ci/build/eraseable.rb
app/models/ci/build/eraseable.rb
+15
-0
app/models/concerns/compoundable.rb
app/models/concerns/compoundable.rb
+0
-19
lib/gitlab/ci/build/eraseable.rb
lib/gitlab/ci/build/eraseable.rb
+0
-25
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'
...
...
app/models/ci/build/eraseable.rb
0 → 100644
View file @
f6a91ccc
module
Ci
class
Build
module
Eraseable
include
ActiveSupport
::
Concern
def
erase!
raise
NotImplementedError
end
def
erased?
raise
NotImpementedError
end
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
lib/gitlab/ci/build/eraseable.rb
deleted
100644 → 0
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