Class: Gb::Workspace

Inherits:
SubCommand show all
Defined in:
lib/commands/workspace.rb

Instance Attribute Summary

Attributes inherited from SubCommand

#gb_config

Instance Method Summary collapse

Methods inherited from SubCommand

#check_uncommit, #initialize, #run, #save_workspace_config, #validate!, #workspace_config

Methods inherited from Command

#error, handle_exception, #info, report_error, run

Constructor Details

This class inherits a constructor from Gb::SubCommand

Instance Method Details

#run_in_configObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/commands/workspace.rb', line 14

def run_in_config

  remote = 'origin'
  workspace_config = self.workspace_config

  info "current work branch '#{workspace_config.work_branch}'"
  info "track remote branch '#{workspace_config.remote_branch}'."
  puts

  self.gb_config.projects.each do |project|
    project_path = File.expand_path(project.name, './')

    if File.exist?(project_path)
      info "Project '#{project.name}'..."
      g = Git.open(project_path)
      info "current branch '#{g.current_branch}'."
      puts
    else
      error "please run 'gb init first."
      break
    end
  end
end