Class: MinecraftFtb

Inherits:
Object
  • Object
show all
Defined in:
lib/servers/minecraft_ftb.rb

Overview

A class for Feed The Beast Minecraft Server

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMinecraftFtb

Returns a new instance of MinecraftFtb.



4
5
6
7
# File 'lib/servers/minecraft_ftb.rb', line 4

def initialize
  @name = "ftb"
  @app_id = nil
end

Instance Attribute Details

#app_idObject (readonly)

Returns the value of attribute app_id.



3
4
5
# File 'lib/servers/minecraft_ftb.rb', line 3

def app_id
  @app_id
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/servers/minecraft_ftb.rb', line 3

def name
  @name
end

Instance Method Details

#install_server(install_path) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/servers/minecraft_ftb.rb', line 13

def install_server(install_path)
  system("wget https://media.forgecdn.net/files/2658/240/FTBRevelationServer_2.7.0.zip -O /tmp/server.zip")
  system("mkdir #{install_path}")
  system("unzip /tmp/server.zip -d#{install_path}")
  system("chmod +x #{install_path}/ServerStart.sh")
  system("chmod +x #{install_path}/FTBInstall.sh")
  system("/bin/bash #{install_path}/FTBInstall.sh")
  system("rm #{install_path}/eula.txt")
  system("echo eula=true > #{install_path}/eula.txt")
end

#launch(install_path) ⇒ Object



9
10
11
# File 'lib/servers/minecraft_ftb.rb', line 9

def launch(install_path)
  "cd #{install_path} && /bin/bash #{install_path}/ServerStart.sh"
end