Class: Lazylead::Task::Assignment
- Inherits:
-
Object
- Object
- Lazylead::Task::Assignment
- Defined in:
- lib/lazylead/task/assignment.rb
Overview
Email alerts about illegal issue assignment(s).
- Author
-
Yurii Dubinka ([email protected])
- Copyright
-
Copyright © 2019-2020 Yurii Dubinka
- License
-
MIT
Instance Method Summary collapse
-
#initialize(log = Log.new) ⇒ Assignment
constructor
A new instance of Assignment.
- #run(sys, postman, opts) ⇒ Object
Constructor Details
#initialize(log = Log.new) ⇒ Assignment
Returns a new instance of Assignment.
39 40 41 |
# File 'lib/lazylead/task/assignment.rb', line 39 def initialize(log = Log.new) @log = log end |
Instance Method Details
#run(sys, postman, opts) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/lazylead/task/assignment.rb', line 43 def run(sys, postman, opts) allowed = opts.slice "allowed", "," silent = opts.key? "silent" issues = sys.issues opts["jql"], opts.jira_defaults.merge(expand: "changelog") return if issues.empty? postman.send opts.merge( assignees: issues.map { |i| Assignee.new(i, allowed, silent) } .select(&:illegal?) .each(&:add_label) ) end |