class Spigoter::Plugin

Generalized plugin. @author Daniel Ramos Acosta <danielramosacosta@hotmail.com>

Public Class Methods

list() click to toggle source
# File lib/spigoter/webapi/plugin.rb, line 33
def self.list
  {
    curse: Spigoter::PluginCurse,
    devbukkit: Spigoter::PluginBukkit,
    spigot: Spigoter::PluginSpigot
  }
end
new(website) click to toggle source
# File lib/spigoter/webapi/plugin.rb, line 8
def initialize(website)
  @url = website # Url of the plugin
  # @main_page     # Mainpage content
  # @name          # Name of the plugin
  # @download_page # Content of the download page
  # @download_url  # Download url of the plugin
  # @regexp        # Regexp that matches the URL
  # @file          # Where the file is stored
  main_page # preload main_page
end

Public Instance Methods

download_url() click to toggle source
# File lib/spigoter/webapi/plugin.rb, line 24
def download_url
  @url # Dummy method, just to test
end
file() click to toggle source
# File lib/spigoter/webapi/plugin.rb, line 28
def file
  return @file unless @file.nil?
  @file = Spigoter::Utils.download(download_url) # download_url is implemented in child class
end
main_page() click to toggle source
# File lib/spigoter/webapi/plugin.rb, line 19
def main_page
  return @main_page unless @main_page.nil?
  @main_page = Spigoter::Utils.download(@url)
end