Class: Zenflow::Admin

Inherits:
Thor
  • Object
show all
Defined in:
lib/zenflow/commands/admin.rb

Instance Method Summary collapse

Instance Method Details

#authorize(hub = nil) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/zenflow/commands/admin.rb', line 40

def authorize(hub=nil)
  hub = resolve_hub(hub)

  Zenflow::Log("Authorizing #{hub_label(hub.hub)}")

  hub.authorize
end

#config(hub = nil) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/zenflow/commands/admin.rb', line 31

def config(hub=nil)
  hub = resolve_hub(hub)

  Zenflow::Log("Configuring #{hub_label(hub.hub)}")

  hub.config
end

#currentObject



14
15
16
# File 'lib/zenflow/commands/admin.rb', line 14

def current
  Zenflow::Log("This project's hub is #{hub_label(Zenflow::Github::CURRENT.hub)}")
end

#describe(hub = nil) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/zenflow/commands/admin.rb', line 19

def describe(hub=nil)
  hub = resolve_hub(hub)

  Zenflow::Log("Configuration details for hub #{hub_label(hub.hub)}")

  Zenflow::Log(Terminal::Table.new(
    headings: ["Parameter", "Github Config Key", "Github Config Value", "Value (with system defaults)"],
    rows: hub.describe
  ).to_s, indent: false, arrows: false, color: false)
end

#listObject



5
6
7
8
9
10
11
# File 'lib/zenflow/commands/admin.rb', line 5

def list
  Zenflow::Log("Recogized hubs")
  Zenflow::Log(Terminal::Table.new(
    headings: ['Hub'],
    rows: get_list_of_hubs()
  ).to_s, indent: false, arrows: false, color: false)
end