Class: Imagen::RemoteBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/imagen/remote_builder.rb

Overview

RemoteBuilder is responsible for wrapping all operations to create code structure for a remote git repository.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo_url) ⇒ RemoteBuilder

Returns a new instance of RemoteBuilder.



12
13
14
15
# File 'lib/imagen/remote_builder.rb', line 12

def initialize(repo_url)
  @repo_url = repo_url
  @dir = Dir.mktmpdir
end

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir.



10
11
12
# File 'lib/imagen/remote_builder.rb', line 10

def dir
  @dir
end

#repo_urlObject (readonly)

Returns the value of attribute repo_url.



10
11
12
# File 'lib/imagen/remote_builder.rb', line 10

def repo_url
  @repo_url
end

Instance Method Details

#buildObject



17
18
19
20
# File 'lib/imagen/remote_builder.rb', line 17

def build
  Clone.perform(repo_url, dir)
  Imagen::Node::Root.new.build_from_dir(dir).tap { teardown }
end