Sha256: 2657faca203bd3655277f68721ce974731e2396b98658d09b29117598a3b4ada

Contents?: true

Size: 1.42 KB

Versions: 7

Compression:

Stored size: 1.42 KB

Contents

module DevFlow
  class Progress < App

    def process!
      self.hello

      # whether I am working on a proper task branch
      current_task = self.task
      error "Not on a known task branch. Can not continue." unless current_task
      
      self.ask_rebase
      puts hr

      # commit you current branch and push
      progress = ARGV[1]
      progress = progress.to_i if progress
      
      if (progress and progress > 0 and progress < 99)
        warn "draw back complete percentage from #{current_task.progress.to_s.bold} to #{progress.to_s.bold}" if current_task.progress > progress
      else
        if progress
          error "invalid progress. Use percentage between 1 to 98."
        else
          puts "Current progress for task #{current_task.display_name.to_s.bold} is #{current_task.progress.to_s.bold}."
          exit
        end
      end
      
      message = ARGV[2] || "update progress to #{progress}"
      message = "[progress] " + message

      info "commit your progress"
      `git commit -am '#{message}'`
      if sync?
        info "push your progress to remote server"
        `git push #{@config["git_remote"]} #{current_task.branch_name}`
      else
        warn "your change did not pushed to the remote server."
      end
      
      # rewrite progress in ROADMAP file under develop trunk
      upload_progress! current_task, progress
    end

  end # class
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dev_flow-0.6.2 lib/dev_flow/commands/progress.rb
dev_flow-0.6.1 lib/dev_flow/commands/progress.rb
dev_flow-0.6.0 lib/dev_flow/commands/progress.rb
dev_flow-0.5.5 lib/dev_flow/commands/progress.rb
dev_flow-0.5.4 lib/dev_flow/commands/progress.rb
dev_flow-0.5.3 lib/dev_flow/commands/progress.rb
dev_flow-0.5.2 lib/dev_flow/commands/progress.rb