Class: Spring::Client::Server

Inherits:
Command
  • Object
show all
Defined in:
lib/spring/client/server.rb

Instance Attribute Summary

Attributes inherited from Command

#args, #env

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

call, #initialize

Constructor Details

This class inherits a constructor from Spring::Client::Command

Class Method Details

.descriptionObject



4
5
6
# File 'lib/spring/client/server.rb', line 4

def self.description
  "Explicitly start a Spring server in the foreground"
end

Instance Method Details

#callObject



8
9
10
11
# File 'lib/spring/client/server.rb', line 8

def call
  require "spring/server"
  Spring::Server.boot(foreground: foreground?)
end

#foreground?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/spring/client/server.rb', line 13

def foreground?
  !args.include?("--background")
end