Class: Citrus::Core::WorkspaceBuilder
- Inherits:
-
Object
- Object
- Citrus::Core::WorkspaceBuilder
- Defined in:
- lib/citrus/core/workspace_builder.rb
Instance Attribute Summary collapse
-
#build_root ⇒ Object
readonly
Returns the value of attribute build_root.
-
#code_fetcher ⇒ Object
readonly
Returns the value of attribute code_fetcher.
Instance Method Summary collapse
- #create_workspace(build) ⇒ Object
-
#initialize(build_root, code_fetcher) ⇒ WorkspaceBuilder
constructor
A new instance of WorkspaceBuilder.
Constructor Details
#initialize(build_root, code_fetcher) ⇒ WorkspaceBuilder
Returns a new instance of WorkspaceBuilder.
7 8 9 10 |
# File 'lib/citrus/core/workspace_builder.rb', line 7 def initialize(build_root, code_fetcher) @build_root = build_root @code_fetcher = code_fetcher end |
Instance Attribute Details
#build_root ⇒ Object (readonly)
Returns the value of attribute build_root.
5 6 7 |
# File 'lib/citrus/core/workspace_builder.rb', line 5 def build_root @build_root end |
#code_fetcher ⇒ Object (readonly)
Returns the value of attribute code_fetcher.
5 6 7 |
# File 'lib/citrus/core/workspace_builder.rb', line 5 def code_fetcher @code_fetcher end |
Instance Method Details
#create_workspace(build) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/citrus/core/workspace_builder.rb', line 12 def create_workspace(build) path = File.join(build_root, partition, build.uuid) FileUtils.mkpath(path) code_fetcher.fetch(build.changeset, path) path end |