Class: GitGuts::Autocommit
- Inherits:
-
Thor::GitGroup
- Object
- Group
- Thor::GitGroup
- GitGuts::Autocommit
- Defined in:
- lib/git_guts/autocommit.rb
Constant Summary collapse
- WORKING_DIRECTORY =
Dir.getwd
Constants inherited from Thor::GitGroup
Instance Method Summary collapse
Methods inherited from Thor::GitGroup
Instance Method Details
#autocommit ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/git_guts/autocommit.rb', line 11 def autocommit begin Git.open(WORKING_DIRECTORY) guard_file = " guard 'git'\#{\",:exclusive => true\" if options[:exclusive]} do\n watch(%r{^\#{files.join('|')}$})\n end\n EOF\n Guard.start(:guardfile_contents => guard_file)\n while Guard.running do\n sleep 0.5\n end\n rescue ArgumentError\n puts \"Could open repository. Is it a valid git repository ?\"\n end\nend\n" |