lib/dev_flow/app.rb in dev_flow-0.1.0 vs lib/dev_flow/app.rb in dev_flow-0.1.1

- old
+ new

@@ -26,10 +26,18 @@ if @config[:local_config] and File.exists? (@config[:local_config]) info "Load local configuration from #{@config[:local_config]}" @config = @config.merge(YAML.load(File.open(@config[:local_config], 'r:utf-8').read)) end + # load roadmap into variable @roadmap + load_roadmap + + # suggest user to take those tasks + @waiting = Hash.new + end + + def load_roadmap # load roadmap, reload config if @config[:roadmap] and File.exists? (@config[:roadmap]) info "Load roadmap from #{@config[:roadmap]}" @roadmap = RoadMap.new(@config[:roadmap], @config).parse @config = @roadmap.config @@ -45,13 +53,10 @@ error "No known members defined!" unless all_member_names.size > 0 if @config["whoami"] error "You (#{user_name}) are not in the known member list. You may use 'dw init' to setup the working environment." unless all_member_names.include? @config["whoami"] end - - # suggest user to take those tasks - @waiting = Hash.new end # log message handler # ------------------------------ def error msg @@ -193,10 +198,11 @@ # do the rebase: if @config["git_remote"] 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." end end @@ -225,10 +231,13 @@ # if this is a complete update, do not switch back unless (is_complete or current_branch == 'develop') switch_to! current_branch `git merge develop` - `git push #{@config[:git_remote]} #{current_branch}` if @config[:git_remote] + if @config[:git_remote] + `git push #{@config[:git_remote]} #{current_branch}` + ask_rebase true # force rebase from git remote + end end end def new_version branch_name if branch_name =~ /^release\_v/