Class: LumiaServer::Platform::Paper

Inherits:
LumiaServer::Platform show all
Defined in:
lib/lumia-server/platform/paper.rb

Constant Summary collapse

VERSIONS =
{
    '1.12.2' => 'https://ci.destroystokyo.com/job/PaperSpigot/1294/artifact/paperclip.jar',
    '1.11.2' => 'https://ci.destroystokyo.com/job/PaperSpigot/1104/artifact/paperclip.jar',
    '1.10.2' => 'https://ci.destroystokyo.com/job/PaperSpigot/916/artifact/paperclip.jar',
    '1.9.4' => 'https://ci.destroystokyo.com/job/PaperSpigot/773/artifact/paperclip.jar',
    '1.8.8' => 'https://ci.destroystokyo.com/job/PaperSpigot/443/artifact/paperclip.jar'
}.freeze

Instance Attribute Summary

Attributes inherited from LumiaServer::Platform

#data, #id, #name, #provider, #server_yaml, #version

Instance Method Summary collapse

Methods inherited from LumiaServer::Platform

#install, #needs_update, new

Constructor Details

#initialize(data, server_yaml) ⇒ Paper

Returns a new instance of Paper.



13
14
15
16
# File 'lib/lumia-server/platform/paper.rb', line 13

def initialize(data, server_yaml)
  super
  @name = 'Paper'
end

Instance Method Details

#install_platformObject



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/lumia-server/platform/paper.rb', line 18

def install_platform
  if provider.nil?
    if VERSIONS.key?(version)
      file = 'paperclip.jar'
      IO.copy_stream(open(VERSIONS[version]), File.join('build', file))
    else
      raise 'Invalid platform version provided'
    end
  else
    provider.install('build')
  end
end