Class: Omnizip::Commands::MetadataCommand
- Inherits:
-
Object
- Object
- Omnizip::Commands::MetadataCommand
- Defined in:
- lib/omnizip/commands/metadata_command.rb
Overview
Metadata command implementation
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ MetadataCommand
constructor
A new instance of MetadataCommand.
-
#run(archive_path, pattern = nil) ⇒ Object
Run the metadata command.
Constructor Details
#initialize(options = {}) ⇒ MetadataCommand
Returns a new instance of MetadataCommand.
9 10 11 |
# File 'lib/omnizip/commands/metadata_command.rb', line 9 def initialize( = {}) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/omnizip/commands/metadata_command.rb', line 7 def @options end |
Instance Method Details
#run(archive_path, pattern = nil) ⇒ Object
Run the metadata command
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/omnizip/commands/metadata_command.rb', line 16 def run(archive_path, pattern = nil) unless File.exist?(archive_path) raise Errno::ENOENT, "Archive not found: #{archive_path}" end Omnizip::Zip::File.open(archive_path) do |archive| if [:show] (archive, pattern) else (archive, pattern) end end puts "Metadata updated successfully" unless [:show] end |