Class: EnginePack::EnginePackage

Inherits:
Object
  • Object
show all
Defined in:
lib/engine_pack/engine_package.rb

Instance Method Summary collapse

Constructor Details

#initialize(engine, io: Adaptors::IO.new, package_config: PackageConfig.new(EnginePack.gem_specs.find { |s| s.name == engine }&.full_gem_path)) ⇒ EnginePackage

Returns a new instance of EnginePackage.



6
7
8
9
10
11
12
13
14
# File 'lib/engine_pack/engine_package.rb', line 6

def initialize(
  engine,
  io: Adaptors::IO.new,
  package_config: PackageConfig.new(EnginePack.gem_specs.find { |s| s.name == engine }&.full_gem_path)
)
  @engine = engine
  @io = io
  @package_config = package_config
end

Instance Method Details

#with_path {|tmp_path| ... } ⇒ Object

Yields:

  • (tmp_path)


16
17
18
19
20
21
# File 'lib/engine_pack/engine_package.rb', line 16

def with_path
  io.mkdir(path: tmp_path)
  copy_specified_files(tmp_path)

  yield tmp_path
end