Class: CM::Function::GeneratePassword
- Inherits:
-
Object
- Object
- CM::Function::GeneratePassword
- Defined in:
- lib/CM/function/generate_password.rb
Instance Method Summary collapse
-
#execute(args) ⇒ Object
—————————————————————————– Operations.
Instance Method Details
#execute(args) ⇒ Object
Operations
18 19 20 21 22 23 |
# File 'lib/CM/function/generate_password.rb', line 18 def execute(args) super do length = (args.length == 1 ? args[0] : 40) `openssl rand -base64 "$((#{length} * 2))" | perl -pe 's/[^a-zA-Z0-9]//g' - | cut -c1-#{length}` end end |