Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/bitlbee_config/core_extensions/string.rb
Instance Method Summary collapse
-
#decrypt_bitlbee_password(key) ⇒ String
Decrypt a bitlbee account password Used to decrypt passwords for individual IM accounts with the password of the bitlbee user.
-
#encrypt_bitlbee_password(key) ⇒ String
Encrypt a bitlbee account password Used to encrypt passwords for individual IM accounts with the password of the bitlbee user.
-
#matches_bitlbee_password_hash?(hash) ⇒ Boolean
Check whether this string matches a given bitlbee password hash.
-
#to_bitlbee_password_hash ⇒ String
Get the bitlbee password hash for this string.
Instance Method Details
#decrypt_bitlbee_password(key) ⇒ String
Decrypt a bitlbee account password Used to decrypt passwords for individual IM accounts with the password of the bitlbee user
40 41 42 43 44 45 |
# File 'lib/bitlbee_config/core_extensions/string.rb', line 40 def decrypt_bitlbee_password(key) cmd = Mixlib::ShellOut.new(" bitlbee -x dec '#{ key }' '#{ self }'") cmd.run_command cmd.error! cmd.stdout.chomp end |
#encrypt_bitlbee_password(key) ⇒ String
Encrypt a bitlbee account password Used to encrypt passwords for individual IM accounts with the password of the bitlbee user
28 29 30 31 32 33 |
# File 'lib/bitlbee_config/core_extensions/string.rb', line 28 def encrypt_bitlbee_password(key) cmd = Mixlib::ShellOut.new(" bitlbee -x enc '#{ key }' '#{ self }'") cmd.run_command cmd.error! cmd.stdout.chomp end |
#matches_bitlbee_password_hash?(hash) ⇒ Boolean
Check whether this string matches a given bitlbee password hash
17 18 19 20 21 |
# File 'lib/bitlbee_config/core_extensions/string.rb', line 17 def matches_bitlbee_password_hash?(hash) cmd = Mixlib::ShellOut.new(" bitlbee -x chkhash '#{ hash }' '#{ self }'") cmd.run_command cmd.exitstatus == 0 end |
#to_bitlbee_password_hash ⇒ String
Get the bitlbee password hash for this string
7 8 9 10 11 12 |
# File 'lib/bitlbee_config/core_extensions/string.rb', line 7 def to_bitlbee_password_hash cmd = Mixlib::ShellOut.new(" bitlbee -x hash '#{ self }'") cmd.run_command cmd.error! cmd.stdout.chomp end |