Class: ForgeFilesModsInput
- Defined in:
- lib/wonko_the_sane/input/forgefiles_mods_input.rb
Instance Method Summary collapse
-
#initialize(artifact) ⇒ ForgeFilesModsInput
constructor
A new instance of ForgeFilesModsInput.
- #parse(data, version) ⇒ Object
Methods inherited from BaseInput
Constructor Details
#initialize(artifact) ⇒ ForgeFilesModsInput
Returns a new instance of ForgeFilesModsInput.
2 3 4 |
# File 'lib/wonko_the_sane/input/forgefiles_mods_input.rb', line 2 def initialize(artifact) @artifact = artifact end |
Instance Method Details
#parse(data, version) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/wonko_the_sane/input/forgefiles_mods_input.rb', line 6 def parse(data, version) file = WonkoVersion.new file.uid = @artifact file.version = version file.time = data[:info] f = data[:files].find do |file| type = file[:buildtype].downcase (file[:ext] == 'jar' or file[:ext] == 'zip') and (type == 'universal' or type == 'client' or type == 'main') #not type.include? 'src' and not type.include? 'deobf' and not type.include? 'api' and not type.include? 'backup' end if not f logger.warn 'No file found for ' + file.uid + ' version ' + file.version return [] end file.requires << Referenced.new('net.minecraft', f[:mcver]) dl = FileDownload.new dl.url = f[:url] dl.destination = "mods/#{file.uid}-#{file.version}.jar" file.common.downloads << dl return BaseSanitizer.sanitize file end |