Class: PEBuild::Command::Copy

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

Instance Method Summary collapse

Constructor Details

#initialize(argv, env) ⇒ Copy

Returns a new instance of Copy.



5
6
7
8
# File 'lib/pe_build/command/copy.rb', line 5

def initialize(argv, env)
  super
  @options = {}
end

Instance Method Details

#executeObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/pe_build/command/copy.rb', line 10

def execute
  argv = parse_options(parser)

  filename = File.basename(argv.last)
  src_dir  = File.dirname(argv.last)

  archive = PEBuild::Archive.new(filename, @env)
  archive.version = @options[:version]

  archive.fetch(src_dir)

  @env.ui.info "pe-build: #{archive} has been added and is ready for use!", :prefix => true
end