Class: Omnizip::Commands::ArchiveRepairCommand
- Inherits:
-
Object
- Object
- Omnizip::Commands::ArchiveRepairCommand
- Defined in:
- lib/omnizip/commands/archive_repair_command.rb
Overview
Archive repair command
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ArchiveRepairCommand
constructor
Initialize command.
-
#run(input_path, output_path) ⇒ Object
Run repair.
Constructor Details
#initialize(options = {}) ⇒ ArchiveRepairCommand
Initialize command
12 13 14 |
# File 'lib/omnizip/commands/archive_repair_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_repair_command.rb', line 7 def @options end |
Instance Method Details
#run(input_path, output_path) ⇒ Object
Run repair
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/omnizip/commands/archive_repair_command.rb', line 20 def run(input_path, output_path) raise "Archive not found: #{input_path}" unless File.exist?(input_path) # Detect format format = detect_format(input_path) case format when :rar repair_rar(input_path, output_path) else puts "Repair not supported for #{format} archives" exit 1 end end |