Class: Factor::CLI::ServerTask

Inherits:
Command
  • Object
show all
Defined in:
lib/cli/server_task.rb

Constant Summary

Constants inherited from Command

Command::CONFIG_FILE_DIR

Instance Method Summary collapse

Instance Method Details

#listObject



32
33
34
# File 'lib/cli/server_task.rb', line 32

def list
  puts "listing all servers"
end

#logsObject



37
38
39
40
41
42
43
# File 'lib/cli/server_task.rb', line 37

def logs
  engine = Factor::Engine.new
  puts "Listening..."
  engine.logs do |message|
    puts "[#{message.route}] #{message.body}"
  end
end

#startObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/cli/server_task.rb', line 8

def start
  engine = Factor::Engine.new

  client = Factor::Client.new
  client.(get_config[:token])

  puts "loading channels"
  engine = client.load_channels(engine)
  puts "loading channels complete"

  puts "loading workflows"
  engine = client.load_workflows(engine)
  puts "loading workflows complete"
    
  puts "loading credentials"
  engine = client.load_credentials(engine)
  puts "loading credentials complete"
    
  puts "starting the server..."
  engine.start
    
end