{"id":15406750,"url":"https://github.com/dannyben/requires","last_synced_at":"2025-04-18T02:51:09.561Z","repository":{"id":43366071,"uuid":"136976298","full_name":"DannyBen/requires","owner":"DannyBen","description":"Require all files in a directory","archived":false,"fork":false,"pushed_at":"2024-07-26T14:53:52.000Z","size":40,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T05:47:50.207Z","etag":null,"topics":["gem","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/DannyBen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-06-11T20:15:45.000Z","updated_at":"2024-07-26T14:53:56.000Z","dependencies_parsed_at":"2024-10-19T12:43:31.726Z","dependency_job_id":null,"html_url":"https://github.com/DannyBen/requires","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":"0.22499999999999998","last_synced_commit":"f6f333aece6d18cea3dcc733e46654eb566e8da3"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Frequires","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Frequires/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Frequires/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Frequires/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DannyBen","download_url":"https://codeload.github.com/DannyBen/requires/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249416761,"owners_count":21268128,"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":["gem","ruby"],"created_at":"2024-10-01T16:25:12.467Z","updated_at":"2025-04-18T02:51:09.537Z","avatar_url":"https://github.com/DannyBen.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Requires\n\n[![Gem Version](https://badge.fury.io/rb/requires.svg)](https://badge.fury.io/rb/requires)\n[![Build Status](https://github.com/DannyBen/requires/workflows/Test/badge.svg)](https://github.com/DannyBen/requires/actions?query=workflow%3ATest)\n\nA tiny convenience function to require or autoload all ruby files in a directory.\n\n## Install\n\n```bash\n$ gem install requires\n```\n\n## Usage\n\n### `requires`\n\n```ruby\n# Require a directory (recursively)\nrequire 'requires'\nrequires 'lib'\n\n# Individual files can also be loaded (with or without extension)\nrequires 'lib/base'\nrequires 'lib/base.rb'\n\n# ...as well as external gems or built in libraries\nrequires 'yaml'\n```\n\nAll paths are relative to the location of the file that calls `requires`.\n\n### `autoloads`\n\nAutoload en masse, with paths relative to the one calling `autuoloads`.\n\n```ruby\nrequire 'requires'\nautoloads 'lib', %i[Asset SomeAPI HTTPClient]\n```\n\nwhich is equivalent to these native autoload statements:\n\n```ruby\nautoload :Asset, './lib/asset'\nautoload :SomeAPI, './lib/some_api'\nautoload :HTTPClient, './lib/HTTPClient'\n```\n\nIn case you wish to autoload from the same directory, you can omit the first\nargument:\n\n```ruby\nautoloads %i[Asset SomeAPI HTTPClient]\n# which is the same as\n# autoloads '.', %i[Asset SomeAPI HTTPClient]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Frequires","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdannyben%2Frequires","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Frequires/lists"}