Class: Gratan::Identifier::Auto

Inherits:
Object
  • Object
show all
Defined in:
lib/gratan/identifier/auto.rb

Instance Method Summary collapse

Constructor Details

#initialize(output, options = {}) ⇒ Auto

Returns a new instance of Auto.



2
3
4
5
6
7
8
9
10
# File 'lib/gratan/identifier/auto.rb', line 2

def initialize(output, options = {})
  @options = options

  if output == '-'
    @output = $stdout
  else
    @output = open(output, 'w')
  end
end

Instance Method Details

#identify(user, host) ⇒ Object



12
13
14
15
16
# File 'lib/gratan/identifier/auto.rb', line 12

def identify(user, host)
  password = mkpasswd
  puts_password(user, host, password)
  password
end