aboutsummaryrefslogtreecommitdiff
path: root/lib/keyringer/actions/recipients.rb
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-01-29 19:57:58 -0200
committerSilvio Rhatto <rhatto@riseup.net>2011-01-29 19:57:58 -0200
commit4d4df2e46f9fde08ca73fe809f7e87379602f78f (patch)
tree545014212f32968589bef827f4b94df0b3510b96 /lib/keyringer/actions/recipients.rb
parent5d0ae3722c6889fff8c00018066662260a71f3e2 (diff)
parentce02d9f01ca366be945caf286c0b77f8eaab24d1 (diff)
downloadkeyringer-4d4df2e46f9fde08ca73fe809f7e87379602f78f.tar.gz
keyringer-4d4df2e46f9fde08ca73fe809f7e87379602f78f.tar.bz2
Merge commit 'origin/ruby' into ruby
Diffstat (limited to 'lib/keyringer/actions/recipients.rb')
-rw-r--r--lib/keyringer/actions/recipients.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/keyringer/actions/recipients.rb b/lib/keyringer/actions/recipients.rb
new file mode 100644
index 0000000..c5f30ed
--- /dev/null
+++ b/lib/keyringer/actions/recipients.rb
@@ -0,0 +1,25 @@
+module Keyringer
+ module Actions
+ class Recipients
+ def execute
+ subCommand = $args[0]
+
+ recipients = Keyring::Recipients.new
+
+ if subCommand == "add"
+ recipients.addRecipient($args[1], $args[2])
+ elsif subCommand == "remove"
+ recipients.removeRecipient($args[1])
+ elsif subCommand == "list"
+ recipients.listRecipients().each() do |recipient|
+ puts("#{recipient.email} #{recipient.keySignature}")
+ end
+ else
+ throw "Invalid recipients command: #{subCommand} "
+ end
+
+ return ""
+ end
+ end
+ end
+end