Class: PEBuild::Unpack::Copy

Inherits:
Object
  • Object
show all
Defined in:
lib/pe_build/unpack/copy.rb

Instance Method Summary collapse

Constructor Details

#initialize(src, dst) ⇒ Copy

Returns a new instance of Copy.

Parameters:

  • src (String)
  • dst (String)


8
9
10
# File 'lib/pe_build/unpack/copy.rb', line 8

def initialize(src, dst)
  @src, @dst = src, dst
end

Instance Method Details

#createsString

Returns The file/dir that will be created as a result of unpack.

Returns:

  • (String)

    The file/dir that will be created as a result of unpack



17
18
19
20
# File 'lib/pe_build/unpack/copy.rb', line 17

def creates
  basename = File.basename(@src)
  deploy_path = File.join(@dst, basename)
end

#unpackObject



12
13
14
# File 'lib/pe_build/unpack/copy.rb', line 12

def unpack
  FileUtils.cp(@src, creates)
end