Class: FPM::Command::Validator

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/fpm/command.rb

Overview

A simple flag validator

The goal of this class is to ensure the flags and arguments given are a valid configuration.

Instance Method Summary collapse

Methods included from Util

#ar_cmd, #ar_cmd_deterministic?, #copied_entries, #copy_entry, #copy_metadata, #default_shell, #erbnew, #execmd, #expand_pessimistic_constraints, #logger, #program_exists?, #program_in_path?, #safesystem, #safesystemout, #tar_cmd, #tar_cmd_supports_sort_names_and_set_mtime?

Constructor Details

#initialize(command) ⇒ Validator

Returns a new instance of Validator.



683
684
685
686
687
688
689
# File 'lib/fpm/command.rb', line 683

def initialize(command)
  @command = command
  @valid = true
  @messages = []

  validate
end

Instance Method Details

#messagesObject

def mandatory



751
752
753
# File 'lib/fpm/command.rb', line 751

def messages
  return @messages
end

#ok?Boolean

def initialize

Returns:

  • (Boolean)


691
692
693
# File 'lib/fpm/command.rb', line 691

def ok?
  return @valid
end