Class: Invoker::Power::Setup
- Inherits:
-
Object
- Object
- Invoker::Power::Setup
- Defined in:
- lib/invoker/power/setup.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#port_finder ⇒ Object
Returns the value of attribute port_finder.
Class Method Summary collapse
Instance Method Summary collapse
- #check_if_setup_can_run? ⇒ Boolean
- #drop_to_normal_user ⇒ Object
- #find_open_ports ⇒ Object
- #install ⇒ Object
Instance Attribute Details
#port_finder ⇒ Object
Returns the value of attribute port_finder.
6 7 8 |
# File 'lib/invoker/power/setup.rb', line 6 def port_finder @port_finder end |
Class Method Details
.install ⇒ Object
7 8 9 10 |
# File 'lib/invoker/power/setup.rb', line 7 def self.install selected_installer_klass = installer_klass selected_installer_klass.new.install end |
.installer_klass ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/invoker/power/setup.rb', line 17 def self.installer_klass if Invoker.darwin? Invoker::Power::OsxSetup else Invoker::Power::LinuxSetup end end |
.uninstall ⇒ Object
12 13 14 15 |
# File 'lib/invoker/power/setup.rb', line 12 def self.uninstall selected_installer_klass = installer_klass selected_installer_klass.new.uninstall_invoker end |
Instance Method Details
#check_if_setup_can_run? ⇒ Boolean
46 47 48 |
# File 'lib/invoker/power/setup.rb', line 46 def check_if_setup_can_run? !File.exists?(Invoker::Power::Config.config_file) end |
#drop_to_normal_user ⇒ Object
34 35 36 |
# File 'lib/invoker/power/setup.rb', line 34 def drop_to_normal_user EventMachine.set_effective_user(ENV["SUDO_USER"]) end |
#find_open_ports ⇒ Object
38 39 40 |
# File 'lib/invoker/power/setup.rb', line 38 def find_open_ports port_finder.find_ports() end |