Fix scripts and tests
* Fix the reformat script to work with recent changes * Fix the convert-nei-dump script to remove leading and trailing '_' * Fix various broken tests
This commit is contained in:
@@ -6,7 +6,13 @@ All rights reserved.
|
||||
###
|
||||
|
||||
# Minecraft must be first
|
||||
exports.DefaultMods = [ 'minecraft', 'applied_energistics_2', 'buildcraft', 'ic2_classic' ]
|
||||
exports.DefaultMods = [
|
||||
'minecraft',
|
||||
'applied_energistics_2',
|
||||
'buildcraft',
|
||||
'ic2_classic',
|
||||
'thermal_expansion',
|
||||
]
|
||||
|
||||
exports.Duration = Duration = {}
|
||||
Duration.snap = 100
|
||||
|
||||
@@ -42,13 +42,14 @@ module.exports = class ModPageController extends BaseController
|
||||
recipe = item.getPrimaryRecipe()
|
||||
return if not recipe
|
||||
|
||||
controller = @_recipeControllers[controllerIndex]
|
||||
if not controller?
|
||||
_.delay (=> @_createRecipeController recipe), delay
|
||||
delay += @_delayStep
|
||||
else
|
||||
controller.model = recipe
|
||||
controllerIndex += 1
|
||||
item.eachRecipe (recipe)=>
|
||||
controller = @_recipeControllers[controllerIndex]
|
||||
if not controller?
|
||||
_.delay (=> @_createRecipeController recipe), delay
|
||||
delay += @_delayStep
|
||||
else
|
||||
controller.model = recipe
|
||||
controllerIndex += 1
|
||||
else
|
||||
@$recipes.hide duration:Duration.fast
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ Copyright (c) 2015 by Redwood Labs
|
||||
All rights reserved.
|
||||
###
|
||||
|
||||
StringBuilder = require '../../models/string_builder'
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
module.exports = class CommandParserVersionBase
|
||||
@@ -39,8 +41,8 @@ module.exports = class CommandParserVersionBase
|
||||
return @_model
|
||||
|
||||
unparse: ->
|
||||
builder = new StringBuilder context:@model
|
||||
@_unparseModel builder, model
|
||||
builder = new StringBuilder context:@_model
|
||||
@_unparseModel builder, @_model
|
||||
return builder.toString()
|
||||
|
||||
# Subclass Methods #############################################################################
|
||||
|
||||
@@ -180,26 +180,26 @@ module.exports = class ModVersionParserV1 extends CommandParserVersionBase
|
||||
# Un-parsing Methods ###########################################################################
|
||||
|
||||
_unparseModVersion: (builder, modVersion)->
|
||||
itemList = _.values modVersion.items
|
||||
itemList.sort (a, b)-> a.compareTo b
|
||||
itemList = []
|
||||
modVersion.eachItem (item)-> itemList.push item
|
||||
|
||||
builder
|
||||
.line 'schema: ', 2
|
||||
.line 'name: ', modVersion.name
|
||||
.line 'version: ', modVersion.version
|
||||
.onlyIf modVersion.description?, => builder.line 'description: ', modVersion.description
|
||||
.line 'schema: ', 1
|
||||
.line()
|
||||
.onlyIf itemList.length > 0, =>
|
||||
builder.loop itemList, delimiter:'\n', onEach:(b, i)=> @_unparseItem(b, i)
|
||||
.outdent()
|
||||
|
||||
_unparseItem: (builder, item)->
|
||||
recipes = []
|
||||
item.eachRecipe (recipe)-> recipes.push recipe
|
||||
|
||||
builder
|
||||
.line 'item: ', item.name
|
||||
.indent()
|
||||
.onlyIf item.isGatherable, => builder.line 'gatherable: yes'
|
||||
.onlyIf item.recipes.length > 0, =>
|
||||
builder.loop item.recipes, delimiter:'', onEach:(b, r)=> @_unparseRecipe(b, r)
|
||||
.onlyIf recipes.length > 0, =>
|
||||
builder.loop recipes, delimiter:'', onEach:(b, r)=> @_unparseRecipe(b, r)
|
||||
.outdent()
|
||||
|
||||
_unparseRecipe: (builder, recipe)->
|
||||
|
||||
@@ -32,7 +32,6 @@ module.exports = class VersionedParserBase
|
||||
|
||||
unparse: (schema=null)->
|
||||
schema ?= @_currentSchema
|
||||
if not modVersion? then throw new Error 'modVersion is required'
|
||||
|
||||
parser = @_parsers["#{schema}"]
|
||||
if not parser? then throw new Error "version #{schema} is not supported"
|
||||
|
||||
Reference in New Issue
Block a user