lib/wire/commands/validate_command.rb
# runs validation on given project
# returns
# => list of +errors+
runs validation on given project
returns
> list of +errors+
runs validation on given project returns > list of + errors +
def run_on_project
      @errors = []
      @validations.each do |val_clazz|
        (@errors << run_validation(@project, val_clazz)).flatten!
      end
      if @errors.size == 0
        outputs 'VALIDATE', 'OK, model is consistent.', :ok
      else
        outputs 'VALIDATE', 'ERROR, detected inconsistencies:', :error
        @errors.each do |val_error|
          outputs 'VALIDATE', val_error.to_s, :error
        end
      end
      @errors
    end
def run_on_project @errors = [ ] @validations . each do | val_clazz | ( @errors << run_validation ( @project , val_clazz ) ) . flatten! end if @errors . size == 0 outputs 'VALIDATE' , 'OK, model is consistent.' , :ok else outputs 'VALIDATE' , 'ERROR, detected inconsistencies:' , :error @errors . each do | val_error | outputs 'VALIDATE' , val_error . to_s , :error end end @errors end
runs validation on given project
returns
> list of +errors+
runs validation on given project returns > list of + errors +
# run validations against it # TODO: Move validation classes to class level definition