Class: Omnizip::Commands::ProfileShowCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/omnizip/commands/profile_show_command.rb

Overview

Command to show details of a specific compression profile

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ProfileShowCommand

Returns a new instance of ProfileShowCommand.



7
8
9
# File 'lib/omnizip/commands/profile_show_command.rb', line 7

def initialize(options = {})
  @options = options
end

Instance Method Details

#run(profile_name) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/omnizip/commands/profile_show_command.rb', line 11

def run(profile_name)
  profile_sym = profile_name.to_sym
  profile = Omnizip::Profile.get(profile_sym)

  unless profile
    warn "Profile '#{profile_name}' not found"
    warn ""
    warn "Available profiles:"
    Omnizip::Profile.list.each { |name| warn "  - #{name}" }
    exit 1
  end

  display_profile(profile)
end