Module: Abt::Docs

Defined in:
lib/abt/docs.rb,
lib/abt/docs/cli.rb,
lib/abt/docs/markdown.rb

Defined Under Namespace

Modules: Cli, Markdown

Class Method Summary collapse

Class Method Details

.basic_examplesObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/abt/docs.rb', line 10

def basic_examples
  {
    "Getting started:" => {
      "abt pick harvest" => "Pick harvest task. This will likely stay the same throughout the project",
      "abt pick asana | abt start harvest" => "Pick asana task and start tracking time",
      "abt stop harvest" => "Stop time tracker",
      "abt track asana harvest" => "Continue tracking time, e.g., after a break",
      "abt finalize asana" => "Finalize the selected asana task"
    }
  }
end

.extended_examplesObject

rubocop:disable Metrics/MethodLength



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/abt/docs.rb', line 22

def extended_examples # rubocop:disable Metrics/MethodLength
  {
    "Tracking meetings (without switching current task setting):" => {
      "abt pick asana -d | abt track harvest" => "Track on asana meeting task",
      'abt pick harvest -d | abt track harvest -c "Name of meeting"' => "Track on separate harvest-task"
    },
    "Many commands output ARIs that can be piped into other commands:" => {
      "abt tasks asana | grep -i <name of task>" => nil,
      "abt tasks asana | grep -i <name of task> | abt start" => nil
    },
    "Sharing ARIs:" => {
      "abt share" => "Print current asana and harvest ARIs on a single line",
      "abt share | pbcopy" => "Copy ARIs to clipboard (mac only)",
      "abt track <ARIs from coworker>" => "Start tracking on the task your coworker shared with you",
      "abt current <ARIs from coworker> | abt track" => "Set task as current, then start tracking"
    },
    "One-off tracking on any project": {
      "abt pick asana -dc -- harvest -dc | abt track" =>
        "Find a track any task on any project, without reusing/affecting previous settings",
      "abt pick asana harvest | abt track" => "Can be used instead of the above when outside a git repo"
    },
    "Flags:" => {
      'abt start harvest -c "comment"' => "Add command flags after ARIs",
      'abt start harvest -c "comment" -- asana' =>
        "Use -- to end a list of flags, so that it can be followed by another ARI",
      'abt pick harvest | abt start -c "comment"' =>
        "Flags placed directly after a command applies to the piped in ARI"
    }
  }
end

.providersObject



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/abt/docs.rb', line 53

def providers
  @providers ||= begin
    providers = {}

    providers["Global"] = global_command_definitions

    Abt.schemes.sort.each_with_object(providers) do |scheme, definition|
      definition[scheme] = command_definitions(scheme)
    end

    providers
  end
end