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
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/lazylead/task/accuracy/accuracy.rb', line 45 def run(sys, postman, opts) Dir[File.join(__dir__, "*.rb")].sort.each { |f| require f } rules = opts.slice("rules", ",") .map(&:constantize) .map(&:new) raised = sys.issues(opts["jql"], opts.jira_defaults) .map { |i| Score.new(i, opts, rules) } .each(&:evaluate) .each(&:post) postman.send opts.merge(tickets: raised) unless raised.empty? end |