lib/chillfile.rb in chillfile-0.0.1 vs lib/chillfile.rb in chillfile-0.0.2
- old
+ new
@@ -1,13 +1,18 @@
require "yaml"
require 'rubygems'
+
+# LIB
require "couchrest"
require 'couchrest_model'
require "treedisha"
require "json"
+
+# CLI
require "thor"
+require "progressbar"
require File.join(File.dirname(__FILE__), "chillfile/config")
require File.join(File.dirname(__FILE__), "chillfile/cli")
require File.join(File.dirname(__FILE__), "chillfile/database_server")
require File.join(File.dirname(__FILE__), "chillfile/sync")
@@ -25,23 +30,23 @@
@@config = Chillfile::Config.new(config)
@@dbserver = Chillfile::DatabaseServer.new
Chillfile::Model.load!
true
end
-
+
def config
@@config
end
def db
@@dbserver.default_database
end
- def sync!
+ def sync!(progressbar = nil)
fs = fs_list
db = db_list
comparator = Treedisha::Comparator.new(fs_list, db_list)
- Chillfile::Sync.process!(comparator)
+ Chillfile::Sync.process!(comparator, progressbar)
end
# filesystem
def fs_list
Treedisha::Filesystem.all_files_with_sha1(config["path"])
\ No newline at end of file