Class: Anvil::Mysql::ScriptRunner

Inherits:
Struct
  • Object
show all
Defined in:
lib/anvil/script_runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hostObject

Returns the value of attribute host

Returns:

  • (Object)

    the current value of host



4
5
6
# File 'lib/anvil/script_runner.rb', line 4

def host
  @host
end

#loggerObject

Returns the value of attribute logger

Returns:

  • (Object)

    the current value of logger



4
5
6
# File 'lib/anvil/script_runner.rb', line 4

def logger
  @logger
end

#scriptObject

Returns the value of attribute script

Returns:

  • (Object)

    the current value of script



4
5
6
# File 'lib/anvil/script_runner.rb', line 4

def script
  @script
end

#userObject

Returns the value of attribute user

Returns:

  • (Object)

    the current value of user



4
5
6
# File 'lib/anvil/script_runner.rb', line 4

def user
  @user
end

Instance Method Details

#callObject



5
6
7
8
9
# File 'lib/anvil/script_runner.rb', line 5

def call
  SshExecutor.new(host, user, logger).call do |ssh|
    ssh.exec! script, "SSH"
  end
end