Class: ActiveGit::FileSave
- Defined in:
- lib/active_git/events/file_save.rb
Instance Attribute Summary
Attributes inherited from FileEvent
Instance Method Summary collapse
Methods inherited from FileEvent
Constructor Details
This class inherits a constructor from ActiveGit::FileEvent
Instance Method Details
#synchronize(synchronizer) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/active_git/events/file_save.rb', line 4 def synchronize(synchronizer) synchronizer.define_job do ActiveGit.configuration.logger.debug "[ActiveGit] Writing file #{file_name}" FileUtils.mkpath(File.dirname(file_name)) unless Dir.exist?(File.dirname(file_name)) File.open(file_name, 'w') { |f| f.puts data.git_dump } end end |