Class: Omnizip::ArchiveCommands

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

Overview

Archive commands subcommand group

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Cli::Shared

#format_bytes, #handle_error

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/omnizip/cli.rb', line 75

def exit_on_failure?
  true
end

Instance Method Details

#create(output, *inputs) ⇒ Object



161
162
163
164
165
# File 'lib/omnizip/cli.rb', line 161

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



209
210
211
212
213
214
# File 'lib/omnizip/cli.rb', line 209

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



243
244
245
246
247
# File 'lib/omnizip/cli.rb', line 243

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

#metadata(archive, pattern = nil) ⇒ Object



289
290
291
292
293
# File 'lib/omnizip/cli.rb', line 289

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