Module: ActiveGit
- Extended by:
- Commands
- Defined in:
- lib/active_git.rb,
lib/active_git/version.rb,
lib/active_git/commands.rb,
lib/active_git/inflector.rb,
lib/active_git/model_parser.rb,
lib/active_git/synchronizer.rb,
lib/active_git/configuration.rb,
lib/active_git/events/db_event.rb,
lib/active_git/events/db_create.rb,
lib/active_git/events/db_delete.rb,
lib/active_git/events/db_update.rb,
lib/active_git/events/file_save.rb,
lib/active_git/events/file_event.rb,
lib/active_git/events/file_delete.rb,
lib/active_git/events/db_delete_all.rb,
lib/active_git/events/folder_remove.rb,
lib/active_git/synchronization_error.rb,
lib/active_git/active_record_extension.rb
Defined Under Namespace
Modules: ActiveRecord, Commands, Inflector
Classes: Configuration, DbCreate, DbDelete, DbDeleteAll, DbEvent, DbUpdate, FileDelete, FileEvent, FileSave, FolderRemove, ModelParser, SynchronizationError, Synchronizer
Constant Summary
collapse
- VERSION =
'0.0.9'
Class Method Summary
collapse
Methods included from Commands
checkout, commit_all, conflicts, dump_db, load_files, merge, pull, reset, resolve_conflicts
Class Method Details
.batch(&block) ⇒ Object
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/active_git.rb', line 54
def self.batch(&block)
@batch_mode = true
begin
result = yield
Synchronizer.synchronize queued_events
result
ensure
@batch_mode = false
queued_events.clear
end
end
|
.configuration ⇒ Object
29
30
31
|
# File 'lib/active_git.rb', line 29
def self.configuration
@configuration ||= Configuration.new
end
|
33
34
35
|
# File 'lib/active_git.rb', line 33
def self.configure
yield configuration
end
|
.models ⇒ Object
37
38
39
|
# File 'lib/active_git.rb', line 37
def self.models
@models ||= Set.new
end
|
.repository ⇒ Object
41
42
43
44
|
# File 'lib/active_git.rb', line 41
def self.repository
@repository = GitWrapper::Repository.new(ActiveGit.configuration.working_path) if @repository.nil? || @repository.location != ActiveGit.configuration.working_path
@repository
end
|
.synchronize(*events) ⇒ Object
46
47
48
49
50
51
52
|
# File 'lib/active_git.rb', line 46
def self.synchronize(*events)
if @batch_mode
enqueue events
else
Synchronizer.synchronize events
end
end
|