Class: Lazylead::Task::Micromanager

Inherits:
Object
  • Object
show all
Defined in:
lib/lazylead/task/micromanager.rb

Overview

Email alerts about due date modification by not-authorized persons.

Author

Yurii Dubinka ([email protected])

Copyright

Copyright © 2019-2020 Yurii Dubinka

License

MIT

Instance Method Summary collapse

Constructor Details

#initialize(log = Log.new) ⇒ Micromanager

Returns a new instance of Micromanager.



39
40
41
# File 'lib/lazylead/task/micromanager.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
# File 'lib/lazylead/task/micromanager.rb', line 43

def run(sys, postman, opts)
  allowed = opts.slice "allowed", ","
  dues = sys.issues(opts["jql"], opts.jira_defaults.merge(expand: "changelog"))
            .map { |i| Due.new(i, allowed) }
            .select(&:illegal?)
  return if dues.empty?
  postman.send opts.merge(dues: dues)
end