Class: Omnizip::ArchiveCommands

Inherits:
Thor
  • Object
show all
Includes:
Shared
Defined in:
lib/omnizip/cli.rb

Overview

Archive commands subcommand group

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Shared

#format_bytes, #handle_error

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


104
105
106
# File 'lib/omnizip/cli.rb', line 104

def exit_on_failure?
  true
end

Instance Method Details

#create(output, *inputs) ⇒ Object



190
191
192
193
194
# File 'lib/omnizip/cli.rb', line 190

def create(output, *inputs)
  Omnizip::Commands::ArchiveCreateCommand.new(options).run(output, *inputs)
rescue StandardError => e
  handle_error(e)
end

#extract(archive, output_dir = nil) ⇒ Object



238
239
240
241
242
243
# File 'lib/omnizip/cli.rb', line 238

def extract(archive, output_dir = nil)
  Omnizip::Commands::ArchiveExtractCommand.new(options).run(archive,
                                                            output_dir)
rescue StandardError => e
  handle_error(e)
end

#list(archive) ⇒ Object



272
273
274
275
276
# File 'lib/omnizip/cli.rb', line 272

def list(archive)
  Omnizip::Commands::ArchiveListCommand.new(options).run(archive)
rescue StandardError => e
  handle_error(e)
end

#metadata(archive, pattern = nil) ⇒ Object



318
319
320
321
322
# File 'lib/omnizip/cli.rb', line 318

def (archive, pattern = nil)
  Omnizip::Commands::MetadataCommand.new(options).run(archive, pattern)
rescue StandardError => e
  handle_error(e)
end