Class: Arkrb::CLI
- Inherits:
-
Thor
- Object
- Thor
- Arkrb::CLI
- Defined in:
- lib/arkrb/cli.rb
Instance Method Summary collapse
- #backup ⇒ Object
- #broadcast(message) ⇒ Object
- #checkmodupdates ⇒ Object
- #checkupdate ⇒ Object
- #disablemod(mod_id) ⇒ Object
- #enablemod(mod_id) ⇒ Object
- #install(name = nil) ⇒ Object
- #installmod(mod_id) ⇒ Object
- #rcon(command) ⇒ Object
- #reinstallmod(mod_id) ⇒ Object
- #restart ⇒ Object
- #saveworld ⇒ Object
- #start ⇒ Object
- #status ⇒ Object
- #stop ⇒ Object
- #uninstallmod(mod_id) ⇒ Object
- #update ⇒ Object
Instance Method Details
#backup ⇒ Object
67 68 69 |
# File 'lib/arkrb/cli.rb', line 67 def backup ark_server([:instance]).backup! end |
#broadcast(message) ⇒ Object
109 110 111 |
# File 'lib/arkrb/cli.rb', line 109 def broadcast() ark_server([:instance]).broadcast end |
#checkmodupdates ⇒ Object
127 128 129 |
# File 'lib/arkrb/cli.rb', line 127 def checkmodupdates ark_server([:instance]).mod_updates_available? end |
#checkupdate ⇒ Object
121 122 123 |
# File 'lib/arkrb/cli.rb', line 121 def checkupdate ark_server([:instance]).update_available? end |
#disablemod(mod_id) ⇒ Object
85 86 87 |
# File 'lib/arkrb/cli.rb', line 85 def disablemod(mod_id) ark_server([:instance]).disable_mod mod_id end |
#enablemod(mod_id) ⇒ Object
79 80 81 |
# File 'lib/arkrb/cli.rb', line 79 def enablemod(mod_id) ark_server([:instance]).enable_mod mod_id end |
#install(name = nil) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/arkrb/cli.rb', line 14 def install(name = nil) if [:list] || name.nil? arkmanager_status = (find_executable('arkmanager').nil?) ? 'Not Installed'.red : 'Installed'.green ark_install_status = (ark_installed?([:instance])) ? 'Installed'.green : 'Not Installed'.red # arkmanager_status = 'Not Installed'.red printf format("%-20s Status %21s\n", 'APP_NAME', 'Description') print_status('ark_manager', arkmanager_status, 'Installs ark-server-tools; Install with: ark_rb install tools') print_status('ark_server', ark_install_status, 'Installs the ark server; Install with: ark_rb install ark') end unless name.nil? case name.to_sym when :arkmanager, :ark_manager, :tools Arkrb.install.server_tools when :ark Arkrb.install.ark([:instance], false) else # do nothing end end end |
#installmod(mod_id) ⇒ Object
91 92 93 |
# File 'lib/arkrb/cli.rb', line 91 def installmod(mod_id) ark_server([:instance]).install_mod mod_id end |
#rcon(command) ⇒ Object
115 116 117 |
# File 'lib/arkrb/cli.rb', line 115 def rcon(command) ark_server([:instance]).rcon_cmd command end |
#reinstallmod(mod_id) ⇒ Object
103 104 105 |
# File 'lib/arkrb/cli.rb', line 103 def reinstallmod(mod_id) ark_server([:instance]).reinstall_mod mod_id end |
#restart ⇒ Object
49 50 51 |
# File 'lib/arkrb/cli.rb', line 49 def restart ark_server([:instance]).restart! end |
#saveworld ⇒ Object
73 74 75 |
# File 'lib/arkrb/cli.rb', line 73 def saveworld ark_server([:instance]).save_world! end |
#start ⇒ Object
37 38 39 |
# File 'lib/arkrb/cli.rb', line 37 def start ark_server([:instance]).start! end |
#status ⇒ Object
55 56 57 |
# File 'lib/arkrb/cli.rb', line 55 def status ark_server([:instance]).status! end |
#stop ⇒ Object
43 44 45 |
# File 'lib/arkrb/cli.rb', line 43 def stop ark_server([:instance]).stop! end |
#uninstallmod(mod_id) ⇒ Object
97 98 99 |
# File 'lib/arkrb/cli.rb', line 97 def uninstallmod(mod_id) ark_server([:instance]).uninstall_mod mod_id end |
#update ⇒ Object
61 62 63 |
# File 'lib/arkrb/cli.rb', line 61 def update ark_server([:instance]).update! end |