pathspec-rb(1)

πŸ’– NAME

pathspec-rb β€” the little test-your-pathspecs-against-an-actual-path bestie πŸ’… (this one lives in section 1 of the General Commands Manual, and yes it's the same name as the command, iykyk)


✨ SYNOPSIS ✨

pathspec-rb [options] [subcommand] [path] <name> <path>

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. pathspec-rb is the companion tool that ships alongside the pathspec-ruby library, and its whole vibe is letting you ✨test✨ what match results the library would find using path specs. that's it, that's the job 🫢

(fr fr, the original page spells the tool name pathspc-rb right here, and we're preserving that historic typo moment because facts are facts 😭)

you've got three modes of main-character energy:

  • find all specs matching a path
  • find all files matching specs
  • verify that a path would match any spec

pick your fighter, bestie πŸ‘‘


πŸŽ€ SUB-COMMANDS πŸŽ€

  • specs_match β€” find all specs matching path
  • tree β€” find all files under path matching the spec
  • match β€” check if the path matches any spec

πŸ’… OPTIONS πŸ’…

  • -f, --file <FILENAME> β€” load path specs from the file you pass in as the argument. lowkey important: if you don't give this option, pathspec-rb defaults to loading .gitignore. so it's giving git by default, no cap.
  • -t, --type [git|regex] β€” the type of spec you're expecting in the loaded specs file (the one from the -f option). defaults to git. switch it up if your specs are regex flavored ✨
  • -v, --verbose β€” only output if there are matches. not me gatekeeping output until something actually hits πŸ™ˆ

🌸 EXAMPLES 🌸

find all files ignored by git under your source directory:

$ pathspec-rb tree src/

list all spec rules that would match for the specified path:

$ pathspec-rb specs_match build/

check that a path matches at least one of the specs in a new version of a gitignore file:

$ pathspec-rb match -f .gitignore.new spec/fixtures/

πŸ‘‘ AUTHOR πŸ‘‘

Gabriel Filion β€” the icon who made all this happen, periodt πŸ’œ


and that's the whole page bestie πŸ¦‹ it's from the pathspec-rb(1) manual, page dated 2019, and we are obsessed with it. go test some pathspecs, you're gonna slay πŸŒˆπŸ’–

πŸ“¦ where this page comes from