Module: RTram::Server

Defined in:
lib/rtram/server.rb

Class Method Summary collapse

Class Method Details

.start(working_directory) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rtram/server.rb', line 10

def start(working_directory)
  working_directory ||= "./"

  RTram::Project.valid?(working_directory)

  existing_entries = Dir.glob("#{working_directory}/{slim,sass}/**/*.{slim,sass,scss}")
  existing_entries.each { |f| RTram::Converter.convert(f, working_directory) }

  listen_to_convert(working_directory)

  srv = WEBrick::HTTPServer.new({
    DocumentRoot:   "#{working_directory}/output",
    BindAddress:    '127.0.0.1',
    Port:           5000,
  })
  srv.start
end