X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Fcommon%2Fuser_interface.rb;fp=lib%2Fcommon%2Fuser_interface.rb;h=6a60d041b56a39465024b04add715de23d13df5a;hp=0000000000000000000000000000000000000000;hb=3763f510274a2ec7ce894122dc26d1ded6055cfc;hpb=1231b3dcd3c59cd0855efe3ee02fc56c6380505d diff --git a/lib/common/user_interface.rb b/lib/common/user_interface.rb new file mode 100644 index 0000000..6a60d04 --- /dev/null +++ b/lib/common/user_interface.rb @@ -0,0 +1,19 @@ +def make_header(program_name, plugin_name) + # The header that we output before the list of domains/users. + # Just the path of this script, the current time, and the plugin name. + header = "#{program_name}, " + + current_time = Time.now() + if current_time.respond_to?(:iso8601) + # Somehow this method is missing on some machines. + header += current_time.iso8601.to_s + else + # Fall back to whatever this looks like. + header += current_time.to_s + end + + header += ' (Plugin: ' + plugin_name + ")\n" + header += '-' * header.size # Underline the header. + + return header +end