Module: Chillfile

Defined in:
lib/chillfile.rb,
lib/chillfile/cli.rb,
lib/chillfile/model.rb,
lib/chillfile/config.rb,
lib/chillfile/database_server.rb

Defined Under Namespace

Modules: DatabaseServer, Model, Sync, SyncHelper Classes: Asset, Base, CLI, Config

Constant Summary collapse

VERSION =
get_version.call

Class Method Summary collapse

Class Method Details

.boot!(config = {}) ⇒ Object



32
33
34
35
36
37
# File 'lib/chillfile.rb', line 32

def boot!(config = {})
  @@config = Chillfile::Config.new(config)
  @@dbserver = Chillfile::DatabaseServer.new
  Chillfile::Model.load!
  true
end

.configObject



39
40
41
# File 'lib/chillfile.rb', line 39

def config
  @@config
end

.dbObject



42
43
44
# File 'lib/chillfile.rb', line 42

def db
  @@dbserver.default_database
end

.db_listObject

databse



60
61
62
# File 'lib/chillfile.rb', line 60

def db_list
  Chillfile::Asset.by_filesystem_raw
end

.fs_listObject

filesystem



55
56
57
# File 'lib/chillfile.rb', line 55

def fs_list
  Treedisha::Filesystem.all_files_with_sha1(config["path"])
end

.sync!(progressbar = nil) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/chillfile.rb', line 46

def sync!(progressbar = nil)
  fs = fs_list
  db = db_list
  comparator = Treedisha::Comparator.new(fs_list, db_list)
  
  Chillfile::Sync.process!(comparator, progressbar)
end