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
11
12
# File 'lib/gratan/identifier/auto.rb', line 2

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

  unless @options[:dry_run]
    if output == '-'
      @output = $stdout
    else
      @output = open(output, 'w')
    end
  end
end

Instance Method Details

#identify(user, host) ⇒ Object



14
15
16
17
18
# File 'lib/gratan/identifier/auto.rb', line 14

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