Class: SvgConform::Commands::Profiles

Inherits:
Object
  • Object
show all
Defined in:
lib/svg_conform/commands/profiles.rb

Overview

Profiles command for listing available validation profiles

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Profiles

Returns a new instance of Profiles.



10
11
12
13
# File 'lib/svg_conform/commands/profiles.rb', line 10

def initialize(options)
  @options = options
  # Paint doesn't need initialization like Pastel
end

Instance Method Details

#executeObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/svg_conform/commands/profiles.rb', line 15

def execute
  profiles = load_available_profiles

  if @options[:verbose]
    display_detailed_profiles(profiles)
  else
    display_profile_list(profiles)
  end
rescue StandardError => e
  puts Paint["Error: #{e.message}", :red]
  exit 1
end