From 4774e16aac96643b6ee86243bdd1acf6bc9ec4f3 Mon Sep 17 00:00:00 2001 From: abhibeckert Date: Mon, 27 Jun 2011 10:29:39 +0000 Subject: * add author/description to hashing bundles * improve code of hashing bundles so they're easier to understand/learn from --- .../Default Bundles/SHA1 Hash.spBundle/command.plist | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'SharedSupport/Default Bundles/SHA1 Hash.spBundle') diff --git a/SharedSupport/Default Bundles/SHA1 Hash.spBundle/command.plist b/SharedSupport/Default Bundles/SHA1 Hash.spBundle/command.plist index 93300c53..e2dd0c70 100644 --- a/SharedSupport/Default Bundles/SHA1 Hash.spBundle/command.plist +++ b/SharedSupport/Default Bundles/SHA1 Hash.spBundle/command.plist @@ -2,15 +2,25 @@ + author + Abhi Beckert category Hash command #!/usr/bin/ruby +# fetch selected text from STDIN +selectedText = gets + +# create sha1 hash require 'digest/sha1' +hash = Digest::SHA1.hexdigest(selectedText) -print Digest::SHA1.hexdigest(gets) +# output hash +print hash + description + Convert the selected text to a sha1 hash. input selectedtext input_fallback -- cgit v1.2.3