jheiss / keyring

Store and access your passwords safely
MIT License
31 stars 12 forks source link

Keyring: accessor for backend #3

Closed andibachmann closed 9 years ago

andibachmann commented 9 years ago

In order to simply check which backend was chosen, I've added

attr_reader backend

in the class Keyring.

Now you can easily do things like

@kr = Keyring.new
unless %w(GnomeKeyring MacosxKeychain).include?(@kr.backend.class.name.split(/::/).last) 
  warn "Your password will not be stored persistently!"
end

Additionally, I limited the version of slop to be < 4.0 : slop has completely refactored the API as of version 4.0

jheiss commented 9 years ago

Thanks!