Class: Guard::Git
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
Instance Method Details
#run_all ⇒ Object
12 13 14 |
# File 'lib/guard/git.rb', line 12 def run_all run_on_change(Watcher.match_files(self, Dir.glob('*'))) end |
#run_on_change(paths) ⇒ Object
16 17 18 19 20 |
# File 'lib/guard/git.rb', line 16 def run_on_change(paths) changed_paths = paths.join(' ') puts %Q{Auto committing #{"all files" unless [:exclusive]} after changes in #{changed_paths}} %x{git add -A #{changed_paths if [:exclusive]} && git commit -m "Autocommit at #{Time.now.strftime("%l:%m%P, %d %h %Y")}"} end |
#start ⇒ Object
8 9 10 |
# File 'lib/guard/git.rb', line 8 def start run_all if [:all_on_start] end |