{"id":15556478,"url":"https://github.com/gforge/torch-dir-loader","last_synced_at":"2025-03-29T03:22:35.904Z","repository":{"id":70448594,"uuid":"80411843","full_name":"gforge/torch-dir-loader","owner":"gforge","description":"Loads a directory of files","archived":false,"fork":false,"pushed_at":"2017-01-31T13:07:13.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-03T13:15:30.087Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gforge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-30T10:28:39.000Z","updated_at":"2017-01-30T14:54:07.000Z","dependencies_parsed_at":"2023-07-29T05:15:59.459Z","dependency_job_id":null,"html_url":"https://github.com/gforge/torch-dir-loader","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"d08b1b2de499611cbdad4b0c0901980ff5f0d5a2"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gforge%2Ftorch-dir-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gforge%2Ftorch-dir-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gforge%2Ftorch-dir-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gforge%2Ftorch-dir-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gforge","download_url":"https://codeload.github.com/gforge/torch-dir-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246132108,"owners_count":20728433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T15:13:59.773Z","updated_at":"2025-03-29T03:22:35.887Z","avatar_url":"https://github.com/gforge.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# torch-dir-loader\n\nLoads a directory of files. You use the function as:\n\n```\nlocal loader = requrie 'torch-dir-loader'\n\nlocal loaded_files, docs, my_object = loader('src')\n```\n\nThe `loaded_files` contains all the files that have loaded. The `docs` contains\ndocs if you're using the `argcheck.doc` system. The `my_object` will be an object\nif you have an `init.lua` that returns an object.\n\n## init.lua details\n\nIf there is an `init.lua` it will load that files collect any returning object and send it to the other files via the parameters.\nIn order to use the object returned from the `init.lua` use the following\nin all other files, below is an example on how to extend a `torch.class`:\n\n```\nlocal params = {...}\nlocal my_object = params[1]\n\nmy_object.additional_function = function()\n\nend\n```\n\n## Load once\n\nEach file that the loader remembers loaded files, thus each file is only loaded\nonce. This means that the second time that the loader is invoked on the same directory\nit won't result in any returned data.\n\n## The specs\n\nSee the specs folder for tests that use the `busted` package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgforge%2Ftorch-dir-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgforge%2Ftorch-dir-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgforge%2Ftorch-dir-loader/lists"}