Class: Lazylead::Task::Accuracy
- Inherits:
-
Object
- Object
- Lazylead::Task::Accuracy
- Defined in:
- lib/lazylead/task/accuracy/accuracy.rb
Overview
Evaluate ticket format and accuracy
The task supports the following features:
- fetch issues from remote ticketing system by query
- evaluate each field within the ticket
- post the score to the ticket
Instance Method Summary collapse
-
#initialize(log = Log.new) ⇒ Accuracy
constructor
A new instance of Accuracy.
- #run(sys, postman, opts) ⇒ Object
Constructor Details
Instance Method Details
#run(sys, postman, opts) ⇒ Object
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/lazylead/task/accuracy/accuracy.rb', line 46 def run(sys, postman, opts) Requires.new(__dir__).load opts[:rules] = opts.construct("rules") opts[:total] = opts[:rules].sum(&:score) opts[:tickets] = sys.issues(opts["jql"], opts.jira_defaults.merge(expand: "changelog")) .map { |i| Score.new(i, opts) } .each(&:evaluate) .each(&:post) postman.send(opts) unless opts[:tickets].empty? end |