diff --git a/glass-dev-1.rockspec b/glass-dev-1.rockspec index 990d16b..d613b9e 100644 --- a/glass-dev-1.rockspec +++ b/glass-dev-1.rockspec @@ -16,6 +16,7 @@ build = { glass = "glass.lua", ["glass.cosmo"] = "glass/cosmo.lua", ["glass.discount"] = "glass/discount.lua", + ["glass.environment"] = "glass/environment.lua", ["glass.json"] = "glass/json.lua", ["glass.lua"] = "glass/lua.lua", ["glass.moonhtml"] = "glass/moonhtml.lua", diff --git a/glass/environment.lua b/glass/environment.lua new file mode 100644 index 0000000..6f36860 --- /dev/null +++ b/glass/environment.lua @@ -0,0 +1,8 @@ +--- Loader for environment variables +-- @module glass.environment + +--- Loads values from environment variables +-- @treturn string The value of the environment variable +return function(name) + return os.getenv(name:match("[^/].+$")) +end