r54069 - in trunk: LibBabble-Inventory-3.0 LibBabble-Inventory-3.0/LibStub LibBabble-Spell-3.0 LibBabble-Spell-3.0/LibStub LibBabble-Zone-3.0 LibBabble-Zone-3.0/LibStub LibDogTag-2.0 LibDogTag-2.0/LibStub LibGratuity-3.0 LibGratuity-3.0/LibStub LibInventory-2.1 LibInventory-2.1/LibStub LibRock-1.0 LibRock-1.0/LibStub LibRoman-1.0 LibRoman-1.0/LibStub

2 views
Skip to first unread message

svnco...@wowace.com

unread,
Nov 6, 2007, 7:51:32 PM11/6/07
to wowace-gar...@googlegroups.com
Author: funkydude
Date: Tue Nov 6 19:51:32 2007
New Revision: 54069

Log:
.trunk: Fix various libraries to use LibStub properly

Added:
trunk/LibBabble-Inventory-3.0/LibStub/
trunk/LibBabble-Inventory-3.0/LibStub/LibStub.lua (contents, props changed)
trunk/LibBabble-Spell-3.0/LibStub/
trunk/LibBabble-Spell-3.0/LibStub/LibStub.lua (contents, props changed)
trunk/LibBabble-Zone-3.0/LibStub/
trunk/LibBabble-Zone-3.0/LibStub/LibStub.lua (contents, props changed)
trunk/LibDogTag-2.0/LibStub/
trunk/LibDogTag-2.0/LibStub/LibStub.lua (contents, props changed)
trunk/LibGratuity-3.0/LibStub/
trunk/LibGratuity-3.0/LibStub/LibStub.lua (contents, props changed)
trunk/LibInventory-2.1/LibStub/
trunk/LibInventory-2.1/LibStub/LibStub.lua (contents, props changed)
trunk/LibRock-1.0/LibStub/
trunk/LibRock-1.0/LibStub/LibStub.lua (contents, props changed)
trunk/LibRoman-1.0/LibStub/
trunk/LibRoman-1.0/LibStub/LibStub.lua (contents, props changed)
Modified:
trunk/LibBabble-Inventory-3.0/LibBabble-Inventory-3.0.lua
trunk/LibBabble-Inventory-3.0/LibBabble-Inventory-3.0.toc
trunk/LibBabble-Spell-3.0/LibBabble-Spell-3.0.lua
trunk/LibBabble-Spell-3.0/LibBabble-Spell-3.0.toc
trunk/LibBabble-Zone-3.0/LibBabble-Zone-3.0.lua
trunk/LibBabble-Zone-3.0/LibBabble-Zone-3.0.toc
trunk/LibDogTag-2.0/LibDogTag-2.0.lua
trunk/LibDogTag-2.0/LibDogTag-2.0.toc
trunk/LibGratuity-3.0/LibGratuity-3.0.lua
trunk/LibGratuity-3.0/LibGratuity-3.0.toc
trunk/LibInventory-2.1/LibInventory-2.1.toc
trunk/LibRock-1.0/LibRock-1.0.lua
trunk/LibRock-1.0/LibRock-1.0.toc
trunk/LibRoman-1.0/LibRoman-1.0.lua
trunk/LibRoman-1.0/LibRoman-1.0.toc

Modified: trunk/LibBabble-Inventory-3.0/LibBabble-Inventory-3.0.lua
==============================================================================
--- trunk/LibBabble-Inventory-3.0/LibBabble-Inventory-3.0.lua (original)
+++ trunk/LibBabble-Inventory-3.0/LibBabble-Inventory-3.0.lua Tue Nov 6 19:51:32 2007
@@ -13,58 +13,6 @@

-- #AUTODOC_NAMESPACE prototype

-do
- -- LibStub is hereby placed in the Public Domain
- -- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
- local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
- local LibStub = _G[LIBSTUB_MAJOR]
-
- -- Check to see is this version of the stub is obsolete
- if not LibStub or not LibStub.minors[LIBSTUB_MAJOR] or LibStub.minors[LIBSTUB_MAJOR] < LIBSTUB_MINOR then
- LibStub = LibStub or {libs = {}, minors = {} }
- _G[LIBSTUB_MAJOR] = LibStub
- LibStub.libs[LIBSTUB_MAJOR], LibStub.minors[LIBSTUB_MAJOR] = LibStub, LIBSTUB_MINOR
-
- -- LibStub:NewLibrary(major, minor)
- -- major (string) - the major version of the library
- -- minor (string or number ) - the minor version of the library
- --
- -- returns nil if a newer or same version of the lib is already present
- -- returns empty library object or old library object if upgrade is needed
- function LibStub:NewLibrary(major, minor)
- assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
- minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
-
- local oldminor = self.minors[major]
- if oldminor and oldminor >= minor then return nil end
- self.minors[major], self.libs[major] = minor, self.libs[major] or {}
- return self.libs[major], oldminor
- end
-
- -- LibStub:GetLibrary(major, [silent])
- -- major (string) - the major version of the library
- -- silent (boolean) - if true, library is optional, silently return nil if its not found
- --
- -- throws an error if the library can not be found (except silent is set)
- -- returns the library object if found
- function LibStub:GetLibrary(major, silent)
- if not silent and not self.libs[major] then
- error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
- end
- return self.libs[major], self.minors[major]
- end
-
- -- LibStub:IterateLibraries()
- --
- -- Returns an iterator for the currently registered libraries
- function LibStub:IterateLibraries()
- return pairs(self.libs)
- end
-
- setmetatable(LibStub, { __call = LibStub.GetLibrary })
- end
-end
-
local GAME_LOCALE = GetLocale()
do
-- LibBabble-Core-3.0 is hereby placed in the Public Domain

Modified: trunk/LibBabble-Inventory-3.0/LibBabble-Inventory-3.0.toc
==============================================================================
--- trunk/LibBabble-Inventory-3.0/LibBabble-Inventory-3.0.toc (original)
+++ trunk/LibBabble-Inventory-3.0/LibBabble-Inventory-3.0.toc Tue Nov 6 19:51:32 2007
@@ -7,4 +7,5 @@
## X-Category: Library
## X-License: MIT

+LibStub\LibStub.lua
lib.xml
\ No newline at end of file

Added: trunk/LibBabble-Inventory-3.0/LibStub/LibStub.lua
==============================================================================
--- (empty file)
+++ trunk/LibBabble-Inventory-3.0/LibStub/LibStub.lua Tue Nov 6 19:51:32 2007
@@ -0,0 +1,30 @@
+-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
+-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
+local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
+local LibStub = _G[LIBSTUB_MAJOR]
+
+if not LibStub or LibStub.minor < LIBSTUB_MINOR then
+ LibStub = LibStub or {libs = {}, minors = {} }
+ _G[LIBSTUB_MAJOR] = LibStub
+ LibStub.minor = LIBSTUB_MINOR
+
+ function LibStub:NewLibrary(major, minor)
+ assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
+ minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
+
+ local oldminor = self.minors[major]
+ if oldminor and oldminor >= minor then return nil end
+ self.minors[major], self.libs[major] = minor, self.libs[major] or {}
+ return self.libs[major], oldminor
+ end
+
+ function LibStub:GetLibrary(major, silent)
+ if not self.libs[major] and not silent then
+ error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
+ end
+ return self.libs[major], self.minors[major]
+ end
+
+ function LibStub:IterateLibraries() return pairs(self.libs) end
+ setmetatable(LibStub, { __call = LibStub.GetLibrary })
+end

Modified: trunk/LibBabble-Spell-3.0/LibBabble-Spell-3.0.lua
==============================================================================
--- trunk/LibBabble-Spell-3.0/LibBabble-Spell-3.0.lua (original)
+++ trunk/LibBabble-Spell-3.0/LibBabble-Spell-3.0.lua Tue Nov 6 19:51:32 2007
@@ -13,58 +13,6 @@

-- #AUTODOC_NAMESPACE prototype

-do
- -- LibStub is hereby placed in the Public Domain
- -- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
- local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
- local LibStub = _G[LIBSTUB_MAJOR]
-
- -- Check to see is this version of the stub is obsolete
- if not LibStub or not LibStub.minors[LIBSTUB_MAJOR] or LibStub.minors[LIBSTUB_MAJOR] < LIBSTUB_MINOR then
- LibStub = LibStub or {libs = {}, minors = {} }
- _G[LIBSTUB_MAJOR] = LibStub
- LibStub.libs[LIBSTUB_MAJOR], LibStub.minors[LIBSTUB_MAJOR] = LibStub, LIBSTUB_MINOR
-
- -- LibStub:NewLibrary(major, minor)
- -- major (string) - the major version of the library
- -- minor (string or number ) - the minor version of the library
- --
- -- returns nil if a newer or same version of the lib is already present
- -- returns empty library object or old library object if upgrade is needed
- function LibStub:NewLibrary(major, minor)
- assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
- minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
-
- local oldminor = self.minors[major]
- if oldminor and oldminor >= minor then return nil end
- self.minors[major], self.libs[major] = minor, self.libs[major] or {}
- return self.libs[major], oldminor
- end
-
- -- LibStub:GetLibrary(major, [silent])
- -- major (string) - the major version of the library
- -- silent (boolean) - if true, library is optional, silently return nil if its not found
- --
- -- throws an error if the library can not be found (except silent is set)
- -- returns the library object if found
- function LibStub:GetLibrary(major, silent)
- if not silent and not self.libs[major] then
- error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
- end
- return self.libs[major], self.minors[major]
- end
-
- -- LibStub:IterateLibraries()
- --
- -- Returns an iterator for the currently registered libraries
- function LibStub:IterateLibraries()
- return pairs(self.libs)
- end
-
- setmetatable(LibStub, { __call = LibStub.GetLibrary })
- end
-end
-
local GAME_LOCALE = GetLocale()
do
-- LibBabble-Core-3.0 is hereby placed in the Public Domain

Modified: trunk/LibBabble-Spell-3.0/LibBabble-Spell-3.0.toc
==============================================================================
--- trunk/LibBabble-Spell-3.0/LibBabble-Spell-3.0.toc (original)
+++ trunk/LibBabble-Spell-3.0/LibBabble-Spell-3.0.toc Tue Nov 6 19:51:32 2007
@@ -10,4 +10,5 @@
## X-Category: Library
## X-License: MIT

+LibStub\LibStub.lua
lib.xml
\ No newline at end of file

Added: trunk/LibBabble-Spell-3.0/LibStub/LibStub.lua
==============================================================================
--- (empty file)
+++ trunk/LibBabble-Spell-3.0/LibStub/LibStub.lua Tue Nov 6 19:51:32 2007
@@ -0,0 +1,30 @@
+-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
+-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
+local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
+local LibStub = _G[LIBSTUB_MAJOR]
+
+if not LibStub or LibStub.minor < LIBSTUB_MINOR then
+ LibStub = LibStub or {libs = {}, minors = {} }
+ _G[LIBSTUB_MAJOR] = LibStub
+ LibStub.minor = LIBSTUB_MINOR
+
+ function LibStub:NewLibrary(major, minor)
+ assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
+ minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
+
+ local oldminor = self.minors[major]
+ if oldminor and oldminor >= minor then return nil end
+ self.minors[major], self.libs[major] = minor, self.libs[major] or {}
+ return self.libs[major], oldminor
+ end
+
+ function LibStub:GetLibrary(major, silent)
+ if not self.libs[major] and not silent then
+ error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
+ end
+ return self.libs[major], self.minors[major]
+ end
+
+ function LibStub:IterateLibraries() return pairs(self.libs) end
+ setmetatable(LibStub, { __call = LibStub.GetLibrary })
+end

Modified: trunk/LibBabble-Zone-3.0/LibBabble-Zone-3.0.lua
==============================================================================
--- trunk/LibBabble-Zone-3.0/LibBabble-Zone-3.0.lua (original)
+++ trunk/LibBabble-Zone-3.0/LibBabble-Zone-3.0.lua Tue Nov 6 19:51:32 2007
@@ -13,58 +13,6 @@

-- #AUTODOC_NAMESPACE prototype

-do
- -- LibStub is hereby placed in the Public Domain
- -- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
- local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
- local LibStub = _G[LIBSTUB_MAJOR]
-
- -- Check to see is this version of the stub is obsolete
- if not LibStub or not LibStub.minors[LIBSTUB_MAJOR] or LibStub.minors[LIBSTUB_MAJOR] < LIBSTUB_MINOR then
- LibStub = LibStub or {libs = {}, minors = {} }
- _G[LIBSTUB_MAJOR] = LibStub
- LibStub.libs[LIBSTUB_MAJOR], LibStub.minors[LIBSTUB_MAJOR] = LibStub, LIBSTUB_MINOR
-
- -- LibStub:NewLibrary(major, minor)
- -- major (string) - the major version of the library
- -- minor (string or number ) - the minor version of the library
- --
- -- returns nil if a newer or same version of the lib is already present
- -- returns empty library object or old library object if upgrade is needed
- function LibStub:NewLibrary(major, minor)
- assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
- minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
-
- local oldminor = self.minors[major]
- if oldminor and oldminor >= minor then return nil end
- self.minors[major], self.libs[major] = minor, self.libs[major] or {}
- return self.libs[major], oldminor
- end
-
- -- LibStub:GetLibrary(major, [silent])
- -- major (string) - the major version of the library
- -- silent (boolean) - if true, library is optional, silently return nil if its not found
- --
- -- throws an error if the library can not be found (except silent is set)
- -- returns the library object if found
- function LibStub:GetLibrary(major, silent)
- if not silent and not self.libs[major] then
- error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
- end
- return self.libs[major], self.minors[major]
- end
-
- -- LibStub:IterateLibraries()
- --
- -- Returns an iterator for the currently registered libraries
- function LibStub:IterateLibraries()
- return pairs(self.libs)
- end
-
- setmetatable(LibStub, { __call = LibStub.GetLibrary })
- end
-end
-
local GAME_LOCALE = GetLocale()
do
-- LibBabble-Core-3.0 is hereby placed in the Public Domain

Modified: trunk/LibBabble-Zone-3.0/LibBabble-Zone-3.0.toc
==============================================================================
--- trunk/LibBabble-Zone-3.0/LibBabble-Zone-3.0.toc (original)
+++ trunk/LibBabble-Zone-3.0/LibBabble-Zone-3.0.toc Tue Nov 6 19:51:32 2007
@@ -10,4 +10,5 @@
## X-Category: Library
## X-License: MIT

+LibStub\LibStub.lua
lib.xml
\ No newline at end of file

Added: trunk/LibBabble-Zone-3.0/LibStub/LibStub.lua
==============================================================================
--- (empty file)
+++ trunk/LibBabble-Zone-3.0/LibStub/LibStub.lua Tue Nov 6 19:51:32 2007
@@ -0,0 +1,30 @@
+-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
+-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
+local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
+local LibStub = _G[LIBSTUB_MAJOR]
+
+if not LibStub or LibStub.minor < LIBSTUB_MINOR then
+ LibStub = LibStub or {libs = {}, minors = {} }
+ _G[LIBSTUB_MAJOR] = LibStub
+ LibStub.minor = LIBSTUB_MINOR
+
+ function LibStub:NewLibrary(major, minor)
+ assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
+ minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
+
+ local oldminor = self.minors[major]
+ if oldminor and oldminor >= minor then return nil end
+ self.minors[major], self.libs[major] = minor, self.libs[major] or {}
+ return self.libs[major], oldminor
+ end
+
+ function LibStub:GetLibrary(major, silent)
+ if not self.libs[major] and not silent then
+ error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
+ end
+ return self.libs[major], self.minors[major]
+ end
+
+ function LibStub:IterateLibraries() return pairs(self.libs) end
+ setmetatable(LibStub, { __call = LibStub.GetLibrary })
+end

Modified: trunk/LibDogTag-2.0/LibDogTag-2.0.lua
==============================================================================
--- trunk/LibDogTag-2.0/LibDogTag-2.0.lua (original)
+++ trunk/LibDogTag-2.0/LibDogTag-2.0.lua Tue Nov 6 19:51:32 2007
@@ -18,58 +18,6 @@
local MAJOR_VERSION = "LibDogTag-2.0"
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) or 0

-do
- -- LibStub is hereby placed in the Public Domain
- -- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
- local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
- local LibStub = _G[LIBSTUB_MAJOR]
-
- -- Check to see is this version of the stub is obsolete
- if not LibStub or not LibStub.minors[LIBSTUB_MAJOR] or LibStub.minors[LIBSTUB_MAJOR] < LIBSTUB_MINOR then
- LibStub = LibStub or {libs = {}, minors = {} }
- _G[LIBSTUB_MAJOR] = LibStub
- LibStub.libs[LIBSTUB_MAJOR], LibStub.minors[LIBSTUB_MAJOR] = LibStub, LIBSTUB_MINOR
-
- -- LibStub:NewLibrary(major, minor)
- -- major (string) - the major version of the library
- -- minor (string or number ) - the minor version of the library
- --
- -- returns nil if a newer or same version of the lib is already present
- -- returns empty library object or old library object if upgrade is needed
- function LibStub:NewLibrary(major, minor)
- assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
- minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
-
- local oldminor = self.minors[major]
- if oldminor and oldminor >= minor then return nil end
- self.minors[major], self.libs[major] = minor, self.libs[major] or {}
- return self.libs[major], oldminor
- end
-
- -- LibStub:GetLibrary(major, [silent])
- -- major (string) - the major version of the library
- -- silent (boolean) - if true, library is optional, silently return nil if its not found
- --
- -- throws an error if the library can not be found (except silent is set)
- -- returns the library object if found
- function LibStub:GetLibrary(major, silent)
- if not silent and not self.libs[major] then
- error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
- end
- return self.libs[major], self.minors[major]
- end
-
- -- LibStub:IterateLibraries()
- --
- -- Returns an iterator for the currently registered libraries
- function LibStub:IterateLibraries()
- return pairs(self.libs)
- end
-
- setmetatable(LibStub, { __call = LibStub.GetLibrary })
- end
-end
-
local DogTag, oldMinor = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
if not DogTag then
return

Modified: trunk/LibDogTag-2.0/LibDogTag-2.0.toc
==============================================================================
--- trunk/LibDogTag-2.0/LibDogTag-2.0.toc (original)
+++ trunk/LibDogTag-2.0/LibDogTag-2.0.toc Tue Nov 6 19:51:32 2007
@@ -9,4 +9,5 @@
## OptionalDeps: LibJoker-1.0, Babble-2.2, Babble-Spell-2.2, MobHealth, MobInfo2, Threat-1.0, RangeCheck-1.0
## X-License: LGPL v2.1

+LibStub\LibStub.lua
lib.xml

Added: trunk/LibDogTag-2.0/LibStub/LibStub.lua
==============================================================================
--- (empty file)
+++ trunk/LibDogTag-2.0/LibStub/LibStub.lua Tue Nov 6 19:51:32 2007
@@ -0,0 +1,30 @@
+-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
+-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
+local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
+local LibStub = _G[LIBSTUB_MAJOR]
+
+if not LibStub or LibStub.minor < LIBSTUB_MINOR then
+ LibStub = LibStub or {libs = {}, minors = {} }
+ _G[LIBSTUB_MAJOR] = LibStub
+ LibStub.minor = LIBSTUB_MINOR
+
+ function LibStub:NewLibrary(major, minor)
+ assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
+ minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
+
+ local oldminor = self.minors[major]
+ if oldminor and oldminor >= minor then return nil end
+ self.minors[major], self.libs[major] = minor, self.libs[major] or {}
+ return self.libs[major], oldminor
+ end
+
+ function LibStub:GetLibrary(major, silent)
+ if not self.libs[major] and not silent then
+ error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
+ end
+ return self.libs[major], self.minors[major]
+ end
+
+ function LibStub:IterateLibraries() return pairs(self.libs) end
+ setmetatable(LibStub, { __call = LibStub.GetLibrary })
+end

Modified: trunk/LibGratuity-3.0/LibGratuity-3.0.lua
==============================================================================
--- trunk/LibGratuity-3.0/LibGratuity-3.0.lua (original)
+++ trunk/LibGratuity-3.0/LibGratuity-3.0.lua Tue Nov 6 19:51:32 2007
@@ -8,57 +8,6 @@
]]

local vmajor, vminor = "LibGratuity-3.0", tonumber(("$Revision$"):match("(%d+)"))
-do
- -- LibStub is hereby placed in the Public Domain
- -- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
- local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
- local LibStub = _G[LIBSTUB_MAJOR]
-
- -- Check to see is this version of the stub is obsolete
- if not LibStub or not LibStub.minors[LIBSTUB_MAJOR] or LibStub.minors[LIBSTUB_MAJOR] < LIBSTUB_MINOR then
- LibStub = LibStub or {libs = {}, minors = {} }
- _G[LIBSTUB_MAJOR] = LibStub
- LibStub.libs[LIBSTUB_MAJOR], LibStub.minors[LIBSTUB_MAJOR] = LibStub, LIBSTUB_MINOR
-
- -- LibStub:NewLibrary(major, minor)
- -- major (string) - the major version of the library
- -- minor (string or number ) - the minor version of the library
- --
- -- returns nil if a newer or same version of the lib is already present
- -- returns empty library object or old library object if upgrade is needed
- function LibStub:NewLibrary(major, minor)
- assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
- minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
-
- local oldminor = self.minors[major]
- if oldminor and oldminor >= minor then return nil end
- self.minors[major], self.libs[major] = minor, self.libs[major] or {}
- return self.libs[major], oldminor
- end
-
- -- LibStub:GetLibrary(major, [silent])
- -- major (string) - the major version of the library
- -- silent (boolean) - if true, library is optional, silently return nil if its not found
- --
- -- throws an error if the library can not be found (except silent is set)
- -- returns the library object if found
- function LibStub:GetLibrary(major, silent)
- if not silent and not self.libs[major] then
- error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
- end
- return self.libs[major], self.minors[major]
- end
-
- -- LibStub:IterateLibraries()
- --
- -- Returns an iterator for the currently registered libraries
- function LibStub:IterateLibraries()
- return pairs(self.libs)
- end
-
- setmetatable(LibStub, { __call = LibStub.GetLibrary })
- end
-end

local lib = LibStub:NewLibrary(vmajor, vminor)
if not lib then

Modified: trunk/LibGratuity-3.0/LibGratuity-3.0.toc
==============================================================================
--- trunk/LibGratuity-3.0/LibGratuity-3.0.toc (original)
+++ trunk/LibGratuity-3.0/LibGratuity-3.0.toc Tue Nov 6 19:51:32 2007
@@ -8,4 +8,5 @@
## X-Category: Library
## X-AceLibrary-Gratuity-2.0: true

+LibStub\LibStub.lua
lib.xml

Added: trunk/LibGratuity-3.0/LibStub/LibStub.lua
==============================================================================
--- (empty file)
+++ trunk/LibGratuity-3.0/LibStub/LibStub.lua Tue Nov 6 19:51:32 2007
@@ -0,0 +1,30 @@
+-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
+-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
+local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
+local LibStub = _G[LIBSTUB_MAJOR]
+
+if not LibStub or LibStub.minor < LIBSTUB_MINOR then
+ LibStub = LibStub or {libs = {}, minors = {} }
+ _G[LIBSTUB_MAJOR] = LibStub
+ LibStub.minor = LIBSTUB_MINOR
+
+ function LibStub:NewLibrary(major, minor)
+ assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
+ minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
+
+ local oldminor = self.minors[major]
+ if oldminor and oldminor >= minor then return nil end
+ self.minors[major], self.libs[major] = minor, self.libs[major] or {}
+ return self.libs[major], oldminor
+ end
+
+ function LibStub:GetLibrary(major, silent)
+ if not self.libs[major] and not silent then
+ error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
+ end
+ return self.libs[major], self.minors[major]
+ end
+
+ function LibStub:IterateLibraries() return pairs(self.libs) end
+ setmetatable(LibStub, { __call = LibStub.GetLibrary })
+end

Modified: trunk/LibInventory-2.1/LibInventory-2.1.toc
==============================================================================
--- trunk/LibInventory-2.1/LibInventory-2.1.toc (original)
+++ trunk/LibInventory-2.1/LibInventory-2.1.toc Tue Nov 6 19:51:32 2007
@@ -8,7 +8,7 @@
## X-Category: Library

## X-WoWIPortal: elkano
-## OptionalDeps: LibStub
## LoadOnDemand: 1

+LibStub\LibStub.lua
lib.xml

Added: trunk/LibInventory-2.1/LibStub/LibStub.lua
==============================================================================
--- (empty file)
+++ trunk/LibInventory-2.1/LibStub/LibStub.lua Tue Nov 6 19:51:32 2007
@@ -0,0 +1,30 @@
+-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
+-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
+local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
+local LibStub = _G[LIBSTUB_MAJOR]
+
+if not LibStub or LibStub.minor < LIBSTUB_MINOR then
+ LibStub = LibStub or {libs = {}, minors = {} }
+ _G[LIBSTUB_MAJOR] = LibStub
+ LibStub.minor = LIBSTUB_MINOR
+
+ function LibStub:NewLibrary(major, minor)
+ assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
+ minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
+
+ local oldminor = self.minors[major]
+ if oldminor and oldminor >= minor then return nil end
+ self.minors[major], self.libs[major] = minor, self.libs[major] or {}
+ return self.libs[major], oldminor
+ end
+
+ function LibStub:GetLibrary(major, silent)
+ if not self.libs[major] and not silent then
+ error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
+ end
+ return self.libs[major], self.minors[major]
+ end
+
+ function LibStub:IterateLibraries() return pairs(self.libs) end
+ setmetatable(LibStub, { __call = LibStub.GetLibrary })
+end

Modified: trunk/LibRock-1.0/LibRock-1.0.lua
==============================================================================
--- trunk/LibRock-1.0/LibRock-1.0.lua (original)
+++ trunk/LibRock-1.0/LibRock-1.0.lua Tue Nov 6 19:51:32 2007
@@ -304,37 +304,6 @@

-- #AUTODOC_NAMESPACE Rock

-do
- -- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
- -- LibStub is hereby placed in the Public Domain -- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
- local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 4 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
- local LibStub = _G[LIBSTUB_MAJOR]
-
- if not LibStub or LibStub.minor < LIBSTUB_MINOR then
- LibStub = LibStub or {libs = {}, minors = {} }
- _G[LIBSTUB_MAJOR] = LibStub
- LibStub.minor = LIBSTUB_MINOR
-
- function LibStub:NewLibrary(major, minor)
- assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
- minor = assert(tonumber(strmatch(minor, "%-?%d+")), "Minor version must either be a number or contain a number.")
- local oldminor = self.minors[major]
- if oldminor and oldminor >= minor then return nil end
- self.minors[major], self.libs[major] = minor, self.libs[major] or {}
- return self.libs[major], oldminor
- end
-
- function LibStub:GetLibrary(major, silent)
- if not self.libs[major] and not silent then
- error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
- end
- return self.libs[major], self.minors[major]
- end
-
- function LibStub:IterateLibraries() return pairs(self.libs) end
- setmetatable(LibStub, { __call = LibStub.GetLibrary })
- end
-end

local LibStub = _G.LibStub

Modified: trunk/LibRock-1.0/LibRock-1.0.toc
==============================================================================
--- trunk/LibRock-1.0/LibRock-1.0.toc (original)
+++ trunk/LibRock-1.0/LibRock-1.0.toc Tue Nov 6 19:51:32 2007
@@ -11,4 +11,5 @@
## SavedVariables: LibRock_1_0DB
## OptionalDeps: !BugGrabber, !Swatter

+LibStub\LibStub.lua
lib.xml
\ No newline at end of file

Added: trunk/LibRock-1.0/LibStub/LibStub.lua
==============================================================================
--- (empty file)
+++ trunk/LibRock-1.0/LibStub/LibStub.lua Tue Nov 6 19:51:32 2007
@@ -0,0 +1,30 @@
+-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
+-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
+local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
+local LibStub = _G[LIBSTUB_MAJOR]
+
+if not LibStub or LibStub.minor < LIBSTUB_MINOR then
+ LibStub = LibStub or {libs = {}, minors = {} }
+ _G[LIBSTUB_MAJOR] = LibStub
+ LibStub.minor = LIBSTUB_MINOR
+
+ function LibStub:NewLibrary(major, minor)
+ assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
+ minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
+
+ local oldminor = self.minors[major]
+ if oldminor and oldminor >= minor then return nil end
+ self.minors[major], self.libs[major] = minor, self.libs[major] or {}
+ return self.libs[major], oldminor
+ end
+
+ function LibStub:GetLibrary(major, silent)
+ if not self.libs[major] and not silent then
+ error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
+ end
+ return self.libs[major], self.minors[major]
+ end
+
+ function LibStub:IterateLibraries() return pairs(self.libs) end
+ setmetatable(LibStub, { __call = LibStub.GetLibrary })
+end

Modified: trunk/LibRoman-1.0/LibRoman-1.0.lua
==============================================================================
--- trunk/LibRoman-1.0/LibRoman-1.0.lua (original)
+++ trunk/LibRoman-1.0/LibRoman-1.0.lua Tue Nov 6 19:51:32 2007
@@ -1,57 +1,3 @@
---[[ Copy/Pasted version of LibStub ]]--
-do
- -- $Id: LibStub.lua 48018 2007-09-03 01:50:17Z mikk $
- -- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
- -- LibStub is hereby placed in the Public Domain
- -- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
- local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
- local LibStub = _G[LIBSTUB_MAJOR]
-
- -- Check to see is this version of the stub is obsolete
- if not LibStub or LibStub.minor < LIBSTUB_MINOR then
- LibStub = LibStub or {libs = {}, minors = {} }
- _G[LIBSTUB_MAJOR] = LibStub
- LibStub.minor = LIBSTUB_MINOR
-
- -- LibStub:NewLibrary(major, minor)
- -- major (string) - the major version of the library
- -- minor (string or number ) - the minor version of the library
- --
- -- returns nil if a newer or same version of the lib is already present
- -- returns empty library object or old library object if upgrade is needed
- function LibStub:NewLibrary(major, minor)
- assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
- minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
-
- local oldminor = self.minors[major]
- if oldminor and oldminor >= minor then return nil end
- self.minors[major], self.libs[major] = minor, self.libs[major] or {}
- return self.libs[major], oldminor
- end
-
- -- LibStub:GetLibrary(major, [silent])
- -- major (string) - the major version of the library
- -- silent (boolean) - if true, library is optional, silently return nil if its not found
- --
- -- throws an error if the library can not be found (except silent is set)
- -- returns the library object if found
- function LibStub:GetLibrary(major, silent)
- if not self.libs[major] and not silent then
- error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
- end
- return self.libs[major], self.minors[major]
- end
-
- -- LibStub:IterateLibraries()
- --
- -- Returns an iterator for the currently registered libraries
- function LibStub:IterateLibraries()
- return pairs(self.libs)
- end
-
- setmetatable(LibStub, { __call = LibStub.GetLibrary })
- end
-end

local MAJOR_VERSION = "LibRoman-1.0"
local MINOR_VERSION = tonumber(("$Revision$"):match("(%d+)")) - 100000

Modified: trunk/LibRoman-1.0/LibRoman-1.0.toc
==============================================================================
--- trunk/LibRoman-1.0/LibRoman-1.0.toc (original)
+++ trunk/LibRoman-1.0/LibRoman-1.0.toc Tue Nov 6 19:51:32 2007
@@ -10,4 +10,5 @@
## X-License: Whatever you want it to be
## OptionalDeps: !BugGrabber, !Swatter

-lib.xml
\ No newline at end of file
+LibStub\LibStub.lua
+lib.xml

Added: trunk/LibRoman-1.0/LibStub/LibStub.lua
==============================================================================
--- (empty file)
+++ trunk/LibRoman-1.0/LibStub/LibStub.lua Tue Nov 6 19:51:32 2007
@@ -0,0 +1,30 @@
+-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
+-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
+local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
+local LibStub = _G[LIBSTUB_MAJOR]
+
+if not LibStub or LibStub.minor < LIBSTUB_MINOR then
+ LibStub = LibStub or {libs = {}, minors = {} }
+ _G[LIBSTUB_MAJOR] = LibStub
+ LibStub.minor = LIBSTUB_MINOR
+
+ function LibStub:NewLibrary(major, minor)
+ assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
+ minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
+
+ local oldminor = self.minors[major]
+ if oldminor and oldminor >= minor then return nil end
+ self.minors[major], self.libs[major] = minor, self.libs[major] or {}
+ return self.libs[major], oldminor
+ end
+
+ function LibStub:GetLibrary(major, silent)
+ if not self.libs[major] and not silent then
+ error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
+ end
+ return self.libs[major], self.minors[major]
+ end
+
+ function LibStub:IterateLibraries() return pairs(self.libs) end
+ setmetatable(LibStub, { __call = LibStub.GetLibrary })
+end

Reply all
Reply to author
Forward
0 new messages