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