{"id":20947726,"url":"https://github.com/alphahydrae/which_works","last_synced_at":"2026-04-25T00:40:05.128Z","repository":{"id":2682331,"uuid":"3674758","full_name":"AlphaHydrae/which_works","owner":"AlphaHydrae","description":"Ruby UNIX-like which.","archived":false,"fork":false,"pushed_at":"2013-10-04T15:14:51.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-20T16:18:17.370Z","etag":null,"topics":[],"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/AlphaHydrae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-09T21:01:50.000Z","updated_at":"2014-11-19T16:08:52.000Z","dependencies_parsed_at":"2022-08-29T12:41:10.498Z","dependency_job_id":null,"html_url":"https://github.com/AlphaHydrae/which_works","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fwhich_works","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fwhich_works/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fwhich_works/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fwhich_works/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlphaHydrae","download_url":"https://codeload.github.com/AlphaHydrae/which_works/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243345570,"owners_count":20275869,"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-11-19T00:12:48.685Z","updated_at":"2025-12-30T00:25:44.824Z","avatar_url":"https://github.com/AlphaHydrae.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# which\\_works\n\n**Ruby UNIX-like which. Locates a program file in the user's path.**\n\n[![Gem Version](https://badge.fury.io/rb/which_works.png)](http://badge.fury.io/rb/which\\_works)\n[![Dependency Status](https://gemnasium.com/AlphaHydrae/which_works.png)](https://gemnasium.com/AlphaHydrae/which\\_works)\n[![Build Status](https://secure.travis-ci.org/AlphaHydrae/which_works.png?branch=master)](http://travis-ci.org/AlphaHydrae/which\\_works)\n[![Coverage Status](https://coveralls.io/repos/AlphaHydrae/which_works/badge.png?branch=master)](https://coveralls.io/r/AlphaHydrae/which\\_works?branch=master)\n\nThe `which` method takes a list of command names and searches the path\nfor each executable file that would be run had these commands actually\nbeen invoked.\n\n```ruby\nWhich.which('ls')            #=\u003e \"/bin/ls\"\nWhich.which('ls', 'screen')  #=\u003e [ \"/bin/ls\", \"/usr/bin/screen\" ]\nWhich.which('unknown')       #=\u003e nil\n\n# you can also check an absolute path\nWhich.which('/usr/bin/svn')  #=\u003e \"/usr/bin/svn\"\nWhich.which('/usr/bin/foo')  #=\u003e nil\n\n# the :all option returns all executable files,\n# not just the first one found in the path\nWhich.which('svn', :all =\u003e true)   #=\u003e [ \"/opt/local/bin/svn\", \"/usr/bin/svn\" ]\n\n# the :array option always returns an array\nWhich.which('unknown', :array =\u003e true)       #=\u003e []\nWhich.which('ls', :array =\u003e true)            #=\u003e [ \"/bin/ls\" ]\nWhich.which('ls', 'screen', :array =\u003e true)  #=\u003e [ \"/bin/ls\", \"/usr/bin/screen\" ]\n\n# combined options\nWhich.which('ls', 'svn', :all =\u003e true, :array =\u003e true)\n#=\u003e [ \"/bin/ls\", \"/opt/local/bin/svn\", \"/usr/bin/svn\" ]\n\n# you can change the default options\nWhich.options = { :all =\u003e true }\nWhich.options[:array] = true\nWhich.which('ls')       #=\u003e [ \"/bin/ls\" ]\nWhich.which('svn')      #=\u003e [ \"/opt/local/bin/svn\", \"/usr/bin/svn\" ]\n\n# default options can be overridden as usual\nWhich.which('ls', :array =\u003e false)  #=\u003e \"/bin/ls\"\n\n# see the current default options\nWhich.options     #=\u003e { :all =\u003e true, :array =\u003e true }\n```\n\n## Meta\n\n* **Author:** Simon Oulevay (Alpha Hydrae)\n* **License:** MIT (see [LICENSE.txt](https://raw.github.com/AlphaHydrae/which_works/master/LICENSE.txt))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphahydrae%2Fwhich_works","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falphahydrae%2Fwhich_works","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphahydrae%2Fwhich_works/lists"}