{"id":29016655,"url":"https://github.com/chef/cookbook-omnifetch","last_synced_at":"2025-06-25T22:33:14.547Z","repository":{"id":17978394,"uuid":"20980879","full_name":"chef/cookbook-omnifetch","owner":"chef","description":"Fetch Chef Cookbooks from Various Sources to a Local Cache","archived":false,"fork":false,"pushed_at":"2024-07-22T07:48:05.000Z","size":157,"stargazers_count":6,"open_issues_count":6,"forks_count":9,"subscribers_count":64,"default_branch":"main","last_synced_at":"2025-06-12T03:50:28.004Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"maundytime/wxcatttest","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chef.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-06-18T23:01:54.000Z","updated_at":"2022-03-09T09:33:45.000Z","dependencies_parsed_at":"2024-06-19T01:35:37.059Z","dependency_job_id":"f719b17b-c6bc-4245-bbf5-06ad040712eb","html_url":"https://github.com/chef/cookbook-omnifetch","commit_stats":{"total_commits":107,"total_committers":19,"mean_commits":5.631578947368421,"dds":0.8504672897196262,"last_synced_commit":"26f191db869e420c15327308a7172a0b1f5e6fa9"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/chef/cookbook-omnifetch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fcookbook-omnifetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fcookbook-omnifetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fcookbook-omnifetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fcookbook-omnifetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chef","download_url":"https://codeload.github.com/chef/cookbook-omnifetch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fcookbook-omnifetch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261962831,"owners_count":23237046,"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":"2025-06-25T22:31:08.566Z","updated_at":"2025-06-25T22:33:14.535Z","avatar_url":"https://github.com/chef.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CookbookOmnifetch\n[![Gem Version](https://badge.fury.io/rb/cookbook-omnifetch.svg)](https://badge.fury.io/rb/cookbook-omnifetch)\n[![Build status](https://badge.buildkite.com/3f3f8dc5b6c82b74fba32adaad641d004f622b304525d6386c.svg?branch=master)](https://buildkite.com/chef-oss/chef-cookbook-omnifetch-master-verify)\n\n**Umbrella Project**: [Chef Workstation](https://github.com/chef/chef-oss-practices/blob/master/projects/chef-workstation.md)\n\n* **[Project State](https://github.com/chef/chef-oss-practices/blob/master/repo-management/repo-states.md):** Active\n* **Issues [Response Time Maximum](https://github.com/chef/chef-oss-practices/blob/master/repo-management/repo-states.md):** 14 days\n* **Pull Request [Response Time Maximum](https://github.com/chef/chef-oss-practices/blob/master/repo-management/repo-states.md):** 14 days\n\n`CookbookOmnifetch` provides library code for fetching Chef cookbooks\nfrom an artifact server (usually https://supermarket.chef.io),\ngit/github, a local path, or a chef-server to a local cache for\ndevelopement.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'cookbook-omnifetch'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install cookbook-omnifetch\n\n## Usage\n\n#### Inject Dependencies and Configure\n\nCookbook Omnifetch is designed to work with utilities from both the\nBerkshelf and Chef Software ecosystems, so you have to configure it\nbefore you can use it. In ChefDK, we do this:\n\n```ruby\n# Configure CookbookOmnifetch's dependency injection settings to use our classes and config.\nCookbookOmnifetch.configure do |c|\n  c.cache_path = File.expand_path('~/.chefdk/cache')\n  c.storage_path = Pathname.new(File.expand_path('~/.chefdk/cache/cookbooks'))\n  c.shell_out_class = ChefDK::ShellOut\n  c.cached_cookbook_class = ChefDK::CookbookMetadata\nend\n```\n\n#### Fetching Cookbooks\n\nTo download a cookbook:\n\n```ruby\nfetcher = CookbookOmnifetch.init(dependency, source_options)\nfetcher.install\n```\n\nTo specify the cookbook you want, you give CookbookOmnifetch a\ndependency object that responds to `#name` and `#version_constraint`,\ne.g.:\n\n```ruby\nrequire 'semverse'\n\nDependency = Struct.new(:name, :version_constraint)\n\nmy_dep = Dependency.new(\"apache2\", Semverse::Constraint.new(\"~\u003e 1.0\"))\n```\n\nThe source options for the cookbook are given as a Hash; the keys and\nvalues vary based on the kind of storage location. As with Bundler's\n`gem` options, one key specifies the type of upstream service for the\ncookbook while other keys specify other options specific to that type.\nFor example:\n\n```ruby\nCookbookOmnifetch.init(dependency, artifact_server: \"https://supermarket.chef.io/api/v1/cookbooks/apache2/versions/3.0.1/download\")\nCookbookOmnifetch.init(dependency, git: \"git@github.com:svanzoest/apache2-cookbook.git\", tag: \"v3.0.1\")\nCookbookOmnifetch.init(dependency, github: \"svanzoest/apache2-cookbook\", tag: \"v3.0.1\")\nCookbookOmnifetch.init(dependency, path: \"~/chef-cookbooks/apache2\")\n```\n\n## Contributing\n\nFor information on contributing to this project, see https://github.com/chef/chef/blob/master/CONTRIBUTING.md\n\nAfter that:\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -asm 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Thanks\n\nThis code was initially extracted from Berkshelf. Thanks to the\nBerkshelf core teams and contributors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchef%2Fcookbook-omnifetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchef%2Fcookbook-omnifetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchef%2Fcookbook-omnifetch/lists"}