Class: Kanji::CLI::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/kanji/cli/server.rb

Class Method Summary collapse

Class Method Details

.app_nameObject


27
28
29
# File 'lib/kanji/cli/server.rb', line 27

def self.app_name
  Dry::Core::Inflector.camelize(Pathname.getwd.basename.to_s)
end

.default_optionsObject


15
16
17
18
19
20
21
22
23
24
25
# File 'lib/kanji/cli/server.rb', line 15

def self.default_options
  {
    pattern: "**/*.rb",
    signal: "TERM",
    notify: false,
    name: app_name,
    ignore: [],
    dir: ["app", "system"],
    cmd: "rackup config.ru"
  }
end

.start(options = {}) ⇒ Object


8
9
10
11
12
13
# File 'lib/kanji/cli/server.rb', line 8

def self.start(options = {})
  Rerun::Runner.keep_running(
    "thin -R config.ru -a 127.0.0.1 -p #{options["port"]} -D start",
    default_options
  )
end