This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list all changed spec files | |
alias d_specs='git diff --name-only | grep _spec.rb|sed -E "s/(.*)/\.\/\1/"' | |
# list all changed *.rb filenames without path and extension | |
alias diffrb='git diff --name-only|xargs basename -s .rb' | |
# diffrb.map { |s| "#{s}_spec"}.join('|') | |
alias any_diffrb="diffrb | tr '\n' '|'|sed -E \"s/^(.*).$/\1_spec/\"" | |
# list all spec files that correspond to changed *.rb files (assuming they share the same prefix) | |
alias d_specs_more='find ./spec -name *_spec.rb|grep -E "(`any_diffrb`)"' | |
# find a spec by path-less name | |
function find_spec() { |