diff --git a/30log-clean.lua b/30log-clean.lua index 1072e76..63a4b4c 100644 --- a/30log-clean.lua +++ b/30log-clean.lua @@ -199,7 +199,7 @@ _class = function(name, attr) end class._DESCRIPTION = '30 lines library for object orientation in Lua' -class._VERSION = '30log v1.1.0' +class._VERSION = '30log v1.2.0' class._URL = 'http://github.com/Yonaba/30log' class._LICENSE = 'MIT LICENSE ' diff --git a/30log-global.lua b/30log-global.lua index f6b0d5e..649a038 100644 --- a/30log-global.lua +++ b/30log-global.lua @@ -26,5 +26,5 @@ _class = function(name, attr) local c = deep_copy(attr); _classes[c] = tostring( c.without = function(self, ...) assert_call_from_class(self, 'without(mixin)'); for _, mixin in ipairs({...}) do assert(self.mixins[mixin] == true, ('Attempted to remove a mixin which is not included in %s'):format(tostring(self))); local classes = self:subclasses(); classes[#classes + 1] = self for _, class in ipairs(classes) do for method_name, method in pairs(mixin) do if type(method) == 'function' then class[method_name] = nil end end end; self.mixins[mixin] = nil end; return self end; return setmetatable(c, baseMt) end -class._DESCRIPTION = '30 lines library for object orientation in Lua'; class._VERSION = '30log v1.1.0'; class._URL = 'http://github.com/Yonaba/30log'; class._LICENSE = 'MIT LICENSE ' +class._DESCRIPTION = '30 lines library for object orientation in Lua'; class._VERSION = '30log v1.2.0'; class._URL = 'http://github.com/Yonaba/30log'; class._LICENSE = 'MIT LICENSE ' return setmetatable(class,{__call = function(_,...) return _class(...) end }) \ No newline at end of file diff --git a/30log.lua b/30log.lua index 20a100a..8afc539 100644 --- a/30log.lua +++ b/30log.lua @@ -26,5 +26,5 @@ _class = function(name, attr) local c = deep_copy(attr); _classes[c] = tostring( c.without = function(self, ...) assert_call_from_class(self, 'without(mixin)'); for _, mixin in ipairs({...}) do assert(self.mixins[mixin] == true, ('Attempted to remove a mixin which is not included in %s'):format(tostring(self))); local classes = self:subclasses(); classes[#classes + 1] = self for _, class in ipairs(classes) do for method_name, method in pairs(mixin) do if type(method) == 'function' then class[method_name] = nil end end end; self.mixins[mixin] = nil end; return self end; return setmetatable(c, baseMt) end -class._DESCRIPTION = '30 lines library for object orientation in Lua'; class._VERSION = '30log v1.1.0'; class._URL = 'http://github.com/Yonaba/30log'; class._LICENSE = 'MIT LICENSE ' +class._DESCRIPTION = '30 lines library for object orientation in Lua'; class._VERSION = '30log v1.2.0'; class._URL = 'http://github.com/Yonaba/30log'; class._LICENSE = 'MIT LICENSE ' return setmetatable(class,{__call = function(_,...) return _class(...) end }) \ No newline at end of file diff --git a/rockspecs/30log-1.2.0-1.rockspec b/rockspecs/30log-1.2.0-1.rockspec new file mode 100644 index 0000000..7225f2d --- /dev/null +++ b/rockspecs/30log-1.2.0-1.rockspec @@ -0,0 +1,25 @@ +package = "30log" +version = "1.2.0-1" +source = { + url = "https://github.com/Yonaba/30log/archive/30log-1.2.0-1.tar.gz", + dir = "30log-30log-1.2.0-1" +} +description = { + summary = "30 lines library for object orientation", + detailed = [[ + 30log, in extenso "30 Lines Of Goodness" is a minified library + for object-orientation in Lua. It features named (and unnamed) classes, + single inheritance and provides basic support for mixins.]], + homepage = "http://yonaba.github.io/30log", + license = "MIT " +} +dependencies = {"lua >= 5.1, <=5.3"} +build = { + type = "builtin", + modules = { + ["30log"] = "30log.lua", + ["30log-clean"] = "30log-clean.lua", + ["30log-global"] = "30log-global.lua", + ["30log-singleton"] = "30log-singleton.lua" + } +} \ No newline at end of file diff --git a/version_history.md b/version_history.md index 16076e6..4e1118e 100644 --- a/version_history.md +++ b/version_history.md @@ -1,5 +1,8 @@ #Version history# +##1.2.0 (03/10/2016) +Added `class:cast()`, changes the class of an instance + ##1.1.0 (09/26/2016) ### New features * Added `class:subclasses()` returns the list of all classes which extend from `class` @@ -17,7 +20,7 @@ * An instance of `class` is considered to be the instance of any superclass of `class` * A class is considered to be the subclass of any of its direct superclass's superclasses -##1.0.0 (01/09/2015) +##1.0.0 (01/09/2015) ### New features * `require "30log"` now returns a callable table