I feel like that I am about to reinvent the wheel here, so before I do that ...
I have a large set of data that I need to process, and the 'rules' that process the data will evolve over time, so I thought that implementing a simple rules engine would be in order.
Note I am not looking for a natural language parser, I want all of the rules to be ruby procs.
I could imagine the syntax to look something like:
engine = SimpleRulesEngine.new
rule = engine.add_rule(priority: 10) do |row|
row.name != 'George'
end
rule.action do |row|
puts "Yikes, name is not George!, it was #{row.name}"
row.update_attribute :name, 'George'
end
engine.process collection
I was wondering if there was any existing patterns or gems out there that would help with this. The one that seems closest is ruleby, but does not seem to be actively maintained, and seems too complex of a solution for my problem.
Thanks!
Note this is a similar question to : Ruby & Rules Engines, but different in that, I do not care about natural language processing, and rule storage.