Class: Omnizip::Commands::ArchiveVerifyCommand
- Inherits:
-
Object
- Object
- Omnizip::Commands::ArchiveVerifyCommand
- Defined in:
- lib/omnizip/commands/archive_verify_command.rb
Overview
Archive verification command
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ArchiveVerifyCommand
constructor
Initialize command.
-
#run(archive_path) ⇒ Object
Run verification.
Constructor Details
#initialize(options = {}) ⇒ ArchiveVerifyCommand
Initialize command
12 13 14 |
# File 'lib/omnizip/commands/archive_verify_command.rb', line 12 def initialize( = {}) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/omnizip/commands/archive_verify_command.rb', line 7 def @options end |
Instance Method Details
#run(archive_path) ⇒ Object
Run verification
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/omnizip/commands/archive_verify_command.rb', line 19 def run(archive_path) unless File.exist?(archive_path) raise "Archive not found: #{archive_path}" end # Detect format format = detect_format(archive_path) case format when :rar verify_rar(archive_path) else puts "Verification not supported for #{format} archives" exit 1 end end |