class Abt::Providers::Harvest::Commands::Current
Public Class Methods
description()
click to toggle source
# File lib/abt/providers/harvest/commands/current.rb, line 12 def self.description "Get or set project and or task for current git repository" end
usage()
click to toggle source
# File lib/abt/providers/harvest/commands/current.rb, line 8 def self.usage "abt current harvest[:<project-id>[/<task-id>]]" end
Public Instance Methods
perform()
click to toggle source
# File lib/abt/providers/harvest/commands/current.rb, line 16 def perform require_local_config! require_project! ensure_valid_configuration! if path != config.path config.path = path warn("Configuration updated") end print_configuration end
Private Instance Methods
ensure_valid_configuration!()
click to toggle source
# File lib/abt/providers/harvest/commands/current.rb, line 39 def ensure_valid_configuration! abort("Invalid project: #{project_id}") if project.nil? abort("Invalid task: #{task_id}") if task_id && task.nil? end
print_configuration()
click to toggle source
# File lib/abt/providers/harvest/commands/current.rb, line 31 def print_configuration if task_id.nil? print_project(project) else print_task(project, task) end end