module RaspbergPasswordReport
RaspbergPasswordReport โ IRC cards for !raspberg password replies.
Constants
- SOURCE
- TAG
Public Instance Methods
Source
# File lib/raspberg_password_report.rb, line 37 def format_error(message) IrcReply.error(tag: TAG, message: message) end
Source
# File lib/raspberg_password_report.rb, line 28 def format_help IrcReply.card( tag: TAG, title: "Password Generator", body_lines: help_lines, footer_parts: [SOURCE] ) end
Source
# File lib/raspberg_password_report.rb, line 13 def format_password(passwords:, options:) body_lines = if passwords.length == 1 [passwords.first] else passwords.each_with_index.map { |pw, idx| "#{idx + 1}. #{pw}" } end IrcReply.card( tag: TAG, title: "Password Generator", body_lines: body_lines, footer_parts: [RaspbergPasswordOptions.option_summary(options).join(" ยท "), SOURCE] ) end
Source
# File lib/raspberg_password_report.rb, line 41 def help_lines [ "!raspberg password [length] [options]", "length / len / chars=N โ how many characters (default 8, max 99)", "lower / nolower โ lower case (default on)", "upper / noupper โ UPPER CASE (default on)", "numbers / nonumbers โ digits 0-9 (default on)", "extra / noextra โ keyboard symbols e.g. {,@,! (default off)", "vowl / novowl โ every 2nd letter vowel (default off)", "custom=chars โ add custom characters (max 100)", "count=N โ generate multiple passwords (max 25, default 1)", "Example: !raspberg password 12 extra vowl custom=@#" ] end