Class: LogListener::Start
- Inherits:
-
Object
- Object
- LogListener::Start
- Defined in:
- lib/log-listener/classes/start.rb
Constant Summary collapse
- PATH =
'/data/public/log'
Instance Attribute Summary collapse
-
#app_udp_log ⇒ Object
readonly
Returns the value of attribute app_udp_log.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#result ⇒ Object
Returns the value of attribute result.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #execute_this_command(actions) ⇒ Object
-
#initialize(*args) ⇒ Start
constructor
A new instance of Start.
- #setup_path_to_udp(path) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Start
Returns a new instance of Start.
9 10 11 12 13 14 |
# File 'lib/log-listener/classes/start.rb', line 9 def initialize(*args) @host = args[0] @user = args[1] @password = args[2] @result = [] end |
Instance Attribute Details
#app_udp_log ⇒ Object (readonly)
Returns the value of attribute app_udp_log.
4 5 6 |
# File 'lib/log-listener/classes/start.rb', line 4 def app_udp_log @app_udp_log end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
4 5 6 |
# File 'lib/log-listener/classes/start.rb', line 4 def host @host end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
4 5 6 |
# File 'lib/log-listener/classes/start.rb', line 4 def password @password end |
#result ⇒ Object
Returns the value of attribute result.
4 5 6 |
# File 'lib/log-listener/classes/start.rb', line 4 def result @result end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
4 5 6 |
# File 'lib/log-listener/classes/start.rb', line 4 def user @user end |
Instance Method Details
#execute_this_command(actions) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/log-listener/classes/start.rb', line 20 def execute_this_command(actions) Net::SSH.start("#{@host}", "#{@user}", :password => "#{password}") do |ssh| go_to_path = ssh.exec!("cd #{PATH}") do_this = ssh.exec!("#{actions}") @result << do_this end end |
#setup_path_to_udp(path) ⇒ Object
16 17 18 |
# File 'lib/log-listener/classes/start.rb', line 16 def setup_path_to_udp(path) @app_udp_log = "#{path}" end |