dotfiles/fish/bin/fish_method_missing

20 lines
427 B
Plaintext
Raw Normal View History

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