class UnbundleParameters

Constants

DESTINATION_DESCRIPTION
MANIFEST_DESCRIPTION
SOURCE_DESCRIPTION

Attributes

destination[RW]
manifest_path[RW]
source[RW]
user_pk_path[RW]

Public Instance Methods

mandatory_params() click to toggle source
# File lib/ec2/amitools/unbundleparameters.rb, line 26
def mandatory_params()
  on('-k', '--privatekey PATH', String, USER_PK_PATH_DESCRIPTION) do |path|
    assert_file_exists(path, '--privatekey')
    @user_pk_path = path
  end

  on('-m', '--manifest PATH', String, MANIFEST_DESCRIPTION) do |manifest|
    assert_file_exists(manifest, '--manifest')
    @manifest_path = manifest
  end
end
optional_params() click to toggle source
# File lib/ec2/amitools/unbundleparameters.rb, line 40
def optional_params()
  on('-s', '--source DIRECTORY', String, SOURCE_DESCRIPTION) do |directory|
    assert_directory_exists(directory, '--source')
    @source = directory
  end  
  
  on('-d', '--destination DIRECTORY', String, DESTINATION_DESCRIPTION) do |directory|
    assert_directory_exists(directory, '--destination')
    @destination = directory
  end
end
set_defaults() click to toggle source
# File lib/ec2/amitools/unbundleparameters.rb, line 61
def set_defaults()
  @source ||= Dir::pwd()
  @destination ||= Dir::pwd()
end
validate_params() click to toggle source
# File lib/ec2/amitools/unbundleparameters.rb, line 54
def validate_params()
  raise MissingMandatory.new('--manifest') unless @manifest_path
  raise MissingMandatory.new('--privatekey') unless @user_pk_path
end