Class: Rosette::Core::Commands::GitCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/rosette/core/commands.rb

Overview

Base class for all of Rosette's git-based commands.

Instance Attribute Summary

Attributes inherited from Command

#configuration

Instance Method Summary collapse

Methods inherited from Command

#initialize, #messages, validate, validators

Constructor Details

This class inherits a constructor from Rosette::Core::Commands::Command

Instance Method Details

#valid?Boolean

Returns true if the command's validators all pass, false otherwise. After this method is finished executing, the messages hash will have been populated with error messages per field.

Returns:

  • (Boolean)

120
121
122
123
124
125
126
127
128
# File 'lib/rosette/core/commands.rb', line 120

def valid?
  self.class.validators.all? do |name, validators|
    validators.all? do |validator|
      valid = validator.valid?(send(name), repo_name, configuration)
      messages[name] = validator.messages unless valid
      valid
    end
  end
end