class Abt::Providers::Asana::Commands::Pick

Public Class Methods

description() click to toggle source
# File lib/abt/providers/asana/commands/pick.rb, line 12
def self.description
  "Pick a task and - unless told not to - make it current"
end
flags() click to toggle source
# File lib/abt/providers/asana/commands/pick.rb, line 16
def self.flags
  [
    ["-d", "--dry-run", "Keep existing configuration"],
    ["-c", "--clean", "Don't reuse project configuration"]
  ]
end
usage() click to toggle source
# File lib/abt/providers/asana/commands/pick.rb, line 8
def self.usage
  "abt pick asana[:<project-gid>]"
end

Public Instance Methods

perform() click to toggle source
# File lib/abt/providers/asana/commands/pick.rb, line 23
def perform
  pick!

  print_task(project, task)

  return if flags[:"dry-run"]

  if config.local_available?
    config.path = path
  else
    warn("No local configuration to update - will function as dry run")
  end
end

Private Instance Methods

pick!() click to toggle source
# File lib/abt/providers/asana/commands/pick.rb, line 39
def pick!
  prompt_project! if project_gid.nil? || flags[:clean]
  prompt_task!
end