Class: Pechkin::Command::AddAuth
- Defined in:
- lib/pechkin/command/add_auth.rb
Overview
Read user:password combination and write it to htpasswd file. If file already contains user then record will be replaced
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#configuration, #handler, #initialize, #puts, #warn
Constructor Details
This class inherits a constructor from Pechkin::Command::Base
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 |
# File 'lib/pechkin/command/add_auth.rb', line 10 def execute user, password = .add_auth.split(':') Pechkin::Auth::Manager.new(.htpasswd).add(user, password) puts IO.read(.htpasswd) end |
#matches? ⇒ Boolean
6 7 8 |
# File 'lib/pechkin/command/add_auth.rb', line 6 def matches? .add_auth end |