dotfiles/fish/bin/fish_method_missing

20 lines
427 B
Ruby
Executable File

#!/usr/bin/env ruby
command = ARGV.shift
def run(cmd)
puts "Running #{cmd.inspect} instead"
system(cmd)
end
case command
when /^git(@|:\/\/).*\.git$/
run("git clone #{command.inspect}")
when /^(?:ftp|https?):\/\/.+\.t(?:ar\.)?gz$/
run("curl #{command.inspect} | tar xzv")
when /^[a-z0-9_\-\/]+\.feature$/
run("cucumber #{command}")
else
$stderr.puts "No default action defined in #{__FILE__.inspect}"
abort
end