Skip to content

Commit

Permalink
revert to using a class name check to determine if a DepCtrl initiali…
Browse files Browse the repository at this point in the history
…zer has already run
  • Loading branch information
line0 committed Feb 6, 2016
1 parent 45e4688 commit 2c8f554
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 5 additions & 2 deletions DependencyControl.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@
"fileBaseUrl": "@{fileBaseUrl}v@{version}-@{channel}/modules/@{scriptName}",
"channels": {
"alpha": {
"version": "0.6.2",
"version": "0.6.3",
"released": "2016-02-06",
"default": true,
"files": [
{
"name": ".moon",
"url": "@{fileBaseUrl}@{fileName}",
"sha1": "0135ADCF023F2150B7324C5BABE72F0F26E412F1"
"sha1": "76C22149258CB1189265A367C1B28046F54F8FB3"
},
{
"name": "/ConfigHandler.moon",
Expand Down Expand Up @@ -134,6 +134,9 @@
}
},
"changelog": {
"0.6.3": [
"Fixed a v0.6.2 regression that caused DependencyControl to fail loading the first time after a scheduled self-update."
],
"0.6.2": [
"An issue was fixed that would cause DepCtrl initializer code in modules previously loaded with regular Lua loading mechanisms to be skipped when requested in a _DependencyControl_- context. This kept the [requireffi](https://github.com/torque/ffi-experiments/tree/master/requireffi) _DependencyControl_ record from being established, preventing any updates from taking place.",
"UnitTestSuite: Fixed several broken assertions and related error messages, among them the `assertMatches` and `assertErrorMatches` assertions always returning `true`. Please make sure to rerun your tests after upgrading to confirm your tested actually return values whatever they were supposed to match.",
Expand Down
12 changes: 7 additions & 5 deletions modules/DependencyControl.moon
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,12 @@ class DependencyControl
return [mdl for mdl, _ in pairs mdlConfig.c when mdl\match pattern], mdlConfig

loadModule: (mdl, usePrivate, reload) =>
runInitializer = (rec) ->
return unless type(rec) == "table" and rec.__depCtrlInit
if type(rec.version) != "table" or rec.version.__class != @@
rec.__depCtrlInit @@
runInitializer = (ref) ->
return unless type(ref) == "table" and ref.__depCtrlInit
-- Note to future self: don't change this to a class check! When DepCtrl self-updates
-- any managed module initialized before will still use the same instance
if type(ref.version) != "table" or ref.version.__name != @@__name
ref.__depCtrlInit @@

with mdl
._missing, ._error = nil
Expand Down Expand Up @@ -540,7 +542,7 @@ class DependencyControl

rec = DependencyControl{
name: "DependencyControl",
version: "0.6.2",
version: "0.6.3",
description: "Provides script management and auto-updating for Aegisub macros and modules.",
author: "line0",
url: "http://github.com/TypesettingTools/DependencyControl",
Expand Down

0 comments on commit 2c8f554

Please sign in to comment.