Class: PasswordExpirationNotifier::CLI

Inherits:
Thor
  • Object
show all
Includes:
Utils
Defined in:
lib/password_expiration_notifier/cli.rb

Instance Method Summary collapse

Methods included from Utils

#config, #expire_at, #expire_soon?, #expired?, #fetch_users, #now, #remaining, #select, #show_list

Instance Method Details

#listObject



37
38
39
40
# File 'lib/password_expiration_notifier/cli.rb', line 37

def list()
  users = fetch_users(config(options))
  show_list(users)
end

#notifyObject



65
66
67
68
69
70
71
72
73
# File 'lib/password_expiration_notifier/cli.rb', line 65

def notify()
  conf = config(options)
  users = fetch_users(conf)
  slack = PasswordExpirationNotifier::Slack.new(conf)
  users.each do |user|
    message = slack.notify_to(user)
    puts message if options[:verbose]
  end
end