Class: Rage::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/rage/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/rage/cli.rb', line 8

def self.exit_on_failure?
  true
end

Instance Method Details

#new(path) ⇒ Object



13
14
15
# File 'lib/rage/cli.rb', line 13

def new(path)
  NewAppGenerator.start([path])
end

#serverObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/rage/cli.rb', line 18

def server
  app = ::Rack::Builder.parse_file("config.ru")
  app = app[0] if app.is_a?(Array)

  ::Iodine.listen service: :http, handler: app, port: Rage.config.port
  ::Iodine.threads = Rage.config.threads_count
  ::Iodine.workers = Rage.config.workers_count

  ::Iodine.start
end