Class: EmbeddedJs::GemPackage

Inherits:
Object
  • Object
show all
Defined in:
lib/embedded_js/gem_package.rb

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of GemPackage.



8
9
10
11
12
13
14
15
16
# File 'lib/embedded_js/gem_package.rb', line 8

def initialize(
  engine,
  io: Adaptors::IO.new,
  package_config: PackageConfig.new(EmbeddedJs.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)


18
19
20
21
22
23
# File 'lib/embedded_js/gem_package.rb', line 18

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

  yield tmp_path
end