Permalink
Browse files

Fixing flag alias for server/service

Bumping to version 0.1.1
  • Loading branch information...
1 parent 8e69b76 commit fcc00d0e14928de93e332d988bc04ff4c0e5b751 @mattt committed Jul 21, 2012
Showing with 9 additions and 2 deletions.
  1. +1 −1 lib/security.rb
  2. +8 −1 lib/security/password.rb
View
@@ -1,5 +1,5 @@
module Security
- VERSION = "0.1.0"
+ VERSION = "0.1.1"
end
require 'security/keychain'
View
@@ -39,7 +39,6 @@ def flags_for_options(options = {})
flags[:D] ||= options.delete(:kind)
flags[:G] ||= options.delete(:value)
flags[:j] ||= options.delete(:comment)
- flags[:s] ||= options.delete(:service) || options.delete(:server)
flags.delete_if{|k,v| v.nil?}.collect{|k, v| "-#{k} #{v}".strip}.join(" ")
end
@@ -65,6 +64,13 @@ def find(options)
def delete(options)
system "security delete-generic-password #{flags_for_options(options)}"
end
+
+ private
+
+ def flags_for_options(options = {})
+ options[:s] ||= options.delete(:service)
+ super(options)
+ end
end
end
@@ -91,6 +97,7 @@ def delete(options)
private
def flags_for_options(options = {})
+ options[:s] ||= options.delete(:server)
options[:p] ||= options.delete(:path)
options[:P] ||= options.delete(:port)
options[:r] ||= options.delete(:protocol)

0 comments on commit fcc00d0

Please sign in to comment.