Class: Reservoir::WhichScript
- Inherits:
-
Object
- Object
- Reservoir::WhichScript
- Defined in:
- lib/reservoir/which_script.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#response ⇒ Object
Returns the value of attribute response.
-
#script ⇒ Object
Returns the value of attribute script.
Instance Method Summary collapse
- #go(app_name) ⇒ Object
-
#initialize(data = {}) ⇒ WhichScript
constructor
A new instance of WhichScript.
- #remote_server ⇒ Object
- #remote_user ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(data = {}) ⇒ WhichScript
Returns a new instance of WhichScript.
7 8 9 10 |
# File 'lib/reservoir/which_script.rb', line 7 def initialize(data = {}) @caller = Caller.new(:remote_server => data[:remote_server], :remote_user => data[:remote_user]) @success = false end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/reservoir/which_script.rb', line 5 def path @path end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/reservoir/which_script.rb', line 5 def response @response end |
#script ⇒ Object
Returns the value of attribute script.
5 6 7 |
# File 'lib/reservoir/which_script.rb', line 5 def script @script end |
Instance Method Details
#go(app_name) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/reservoir/which_script.rb', line 20 def go(app_name) @script = app_name @path = @caller.go_with_response("which #{app_name}") if @path == '' @path = nil @success = false @response = 'script not installed' else @success = true @response = @path end @success end |
#remote_server ⇒ Object
16 17 18 |
# File 'lib/reservoir/which_script.rb', line 16 def remote_server @caller.remote_server end |
#remote_user ⇒ Object
12 13 14 |
# File 'lib/reservoir/which_script.rb', line 12 def remote_user @caller.remote_user end |
#success? ⇒ Boolean
35 36 37 |
# File 'lib/reservoir/which_script.rb', line 35 def success? @success end |