diff options
author | abhibeckert <abhi@abhibeckert.com> | 2011-06-27 10:29:39 +0000 |
---|---|---|
committer | abhibeckert <abhi@abhibeckert.com> | 2011-06-27 10:29:39 +0000 |
commit | 4774e16aac96643b6ee86243bdd1acf6bc9ec4f3 (patch) | |
tree | 024ebf13e9667fb3230ae7897effd9bcea71964b /SharedSupport/Default Bundles | |
parent | bdce9864553e64d39d9908d85e154675c5d093f1 (diff) | |
download | sequelpro-4774e16aac96643b6ee86243bdd1acf6bc9ec4f3.tar.gz sequelpro-4774e16aac96643b6ee86243bdd1acf6bc9ec4f3.tar.bz2 sequelpro-4774e16aac96643b6ee86243bdd1acf6bc9ec4f3.zip |
* add author/description to hashing bundles
* improve code of hashing bundles so they're easier to understand/learn from
Diffstat (limited to 'SharedSupport/Default Bundles')
-rw-r--r-- | SharedSupport/Default Bundles/MD5 Hash.spBundle/command.plist | 12 | ||||
-rw-r--r-- | SharedSupport/Default Bundles/SHA1 Hash.spBundle/command.plist | 12 |
2 files changed, 22 insertions, 2 deletions
diff --git a/SharedSupport/Default Bundles/MD5 Hash.spBundle/command.plist b/SharedSupport/Default Bundles/MD5 Hash.spBundle/command.plist index 0b820665..110231c2 100644 --- a/SharedSupport/Default Bundles/MD5 Hash.spBundle/command.plist +++ b/SharedSupport/Default Bundles/MD5 Hash.spBundle/command.plist @@ -2,15 +2,25 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> + <key>author</key> + <string>Abhi Beckert</string> <key>category</key> <string>Hash</string> <key>command</key> <string>#!/usr/bin/ruby +# fetch selected text from STDIN +selectedText = gets + +# create sha1 hash require 'digest/md5' +hash = Digest::MD5.hexdigest(selectedText) -print Digest::MD5.hexdigest(gets) +# output hash +print hash </string> + <key>description</key> + <string>Convert the selected text to an MD5 hash.</string> <key>input</key> <string>selectedtext</string> <key>input_fallback</key> 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 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> + <key>author</key> + <string>Abhi Beckert</string> <key>category</key> <string>Hash</string> <key>command</key> <string>#!/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 </string> + <key>description</key> + <string>Convert the selected text to a sha1 hash.</string> <key>input</key> <string>selectedtext</string> <key>input_fallback</key> |