Sha256: 5d72a01cf71956719ba2a281accfa5fbbf3c525ddd5c16f491c7b46372068ee1

Contents?: true

Size: 504 Bytes

Versions: 22

Compression:

Stored size: 504 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Services
    class RuleInitializer < Service
      #
      # @param [String] path
      # @param [Dry::Files] files
      #
      def call(path, files = Dry::Files.new)
        rule = Mihari::Rule.new(
          id: SecureRandom.uuid,
          title: "Title goes here",
          description: "Description goes here",
          created_on: Date.today,
          queries: []
        )
        files.write(path, rule.yaml)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
mihari-8.0.0 lib/mihari/services/initializers.rb
mihari-7.6.4 lib/mihari/services/initializers.rb
mihari-7.6.3 lib/mihari/services/initializers.rb
mihari-7.6.2 lib/mihari/services/initializers.rb
mihari-7.6.1 lib/mihari/services/initializers.rb
mihari-7.6.0 lib/mihari/services/initializers.rb
mihari-7.5.0 lib/mihari/services/initializers.rb
mihari-7.4.0 lib/mihari/services/initializers.rb
mihari-7.3.2 lib/mihari/services/initializers.rb
mihari-7.3.1 lib/mihari/services/initializers.rb
mihari-7.3.0 lib/mihari/services/initializers.rb
mihari-7.2.0 lib/mihari/services/initializers.rb
mihari-7.1.3 lib/mihari/services/initializers.rb
mihari-7.1.2 lib/mihari/services/initializers.rb
mihari-7.1.1 lib/mihari/services/initializers.rb
mihari-7.1.0 lib/mihari/services/initializers.rb
mihari-7.0.5 lib/mihari/services/initializers.rb
mihari-7.0.4 lib/mihari/services/initializers.rb
mihari-7.0.3 lib/mihari/services/initializers.rb
mihari-7.0.2 lib/mihari/services/initializers.rb