class Commit < Array def self.discover_commands commands if(Dir.exists?(".git")) if(!`git status`.include?('nothing to commit') || `git status`.include?('untracked files present')) commands["commit"] = Commit.new if(!commands.has_key?("commit")) commands["commit"].add 'git commit -a -v -m "commit all"' end end end def add command self << command if(!include?(command)) end end