lib/dev_flow/app.rb in dev_flow-0.2.4 vs lib/dev_flow/app.rb in dev_flow-0.3.0
- old
+ new
@@ -70,10 +70,14 @@
def info msg
@logger.info "[INFO] " + msg
end
+ def debug msg
+ @logger.debug "[DEBUG] " + msg
+ end
+
# helper function
# ------------------------------
def all_member_names
@members.keys
end
@@ -85,13 +89,14 @@
def leader_name
@members[@config["leader"]].display_name
end
- def task
+ def task branch = nil
+ branch = @git.current_branch unless branch
@roadmap.tasks.each do |task|
- return task if task.branch_name == @git.current_branch
+ return task if task.branch_name == branch
end
nil
end
def in_trunk?
@@ -120,10 +125,14 @@
def tasks_for_close
@roadmap.tasks.select {|task| task.progress == 99}
end
+ def sync?
+ @config["git_remote"] and (not @config[:offline])
+ end
+
# display informations
# -----------------------
def hr; "-"*76 end
def hrh; hr.bold end
def hrb; "="*76 end
@@ -186,24 +195,24 @@
end
# interactive methods with git remote server
# ------------------------------------------------------
def ask_rebase force = false
- return false if @config[:offline]
+ # return false unless sync? #if @config[:offline]
- unless force
- print "Rebase your wokring directory? [Y/n]:".bold.yellow
- ans = STDIN.gets.chomp!
- return false if ans == 'n'
- end
+ #unless force
+ # print "Rebase your wokring directory? [Y/n]:".bold.yellow
+ # ans = STDIN.gets.chomp!
+ # return false if ans == 'n'
+ #end
# do the rebase:
- if @config["git_remote"]
+ if sync?
info "Rebase you working directory from #{@config["git_remote"]}/devleop"
@git.rebase! @config["git_remote"], 'develop'
load_roadmap # load roadmap again
else
- info "Git remote not defined, skip rebase."
+ warn "Git remote not defined, skip rebase."
end
end
# switch to other branch
def switch_to! branch