lib/mpw/ui/cli.rb in mpw-2.0.2 vs lib/mpw/ui/cli.rb in mpw-2.0.3
- old
+ new
@@ -21,11 +21,18 @@
def initialize(config)
@config = config
end
# Sync the data with the server
+ # @args: allow_sync -> allow or disable sync (boolean)
# @rtnr: true if the synchro is finish
- def sync
+ def sync(allow_sync=nil)
+ if not allow_sync.nil?
+ @allow_sync = allow_sync
+ end
+
+ return true if not @allow_sync
+
@sync = MPW::Sync.new(@config, @mpw, @password)
raise(@sync.error_msg) if not @sync.get_remote
raise(@sync.error_msg) if not @sync.sync