Class: NabaztagHackKit::Server

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/nabaztag_hack_kit/server.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Server

set :public_folder, File.dirname(__FILE__) + ‘../public’



13
14
15
16
17
18
19
# File 'lib/nabaztag_hack_kit/server.rb', line 13

def initialize(opts = {})
  super
  @base_file     = opts.fetch(:base_file, __FILE__)
  @bytecode_file = opts.fetch(:bytecode_file, public_file('bytecode.bin')).to_s
  abort("Couldn't find Bytecode file. Pls compile first") unless File.exist?(@bytecode_file)
  puts "Serving Bytecode from #{@bytecode_file}"
end