Sha256: 51a30628604f41e81c5ba7f5c29902ba922605d32ec5e3d9cc6ad231f221bd3a

Contents?: true

Size: 582 Bytes

Versions: 4

Compression:

Stored size: 582 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Commands
    module Validator
      include Mixins::Rule

      def self.included(thor)
        thor.class_eval do
          desc "rule [PATH]", "Validate format of a rule file"
          def rule(path)
            rule = load_rule(path)

            begin
              validate_rule! rule
              puts "Valid format. The input is parsed as the following:"
              puts rule.data.to_yaml
            rescue RuleValidationError
              nil
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mihari-4.1.2 lib/mihari/commands/validator.rb
mihari-4.1.1 lib/mihari/commands/validator.rb
mihari-4.1.0 lib/mihari/commands/validator.rb
mihari-4.0.0 lib/mihari/commands/validator.rb