Class: Fresco::CLI::Dev

Inherits:
Object
  • Object
show all
Defined in:
lib/fresco/cli/dev.rb

Instance Method Summary collapse

Instance Method Details

#run(argv) ⇒ Object

The dev loop relies on top-level method and constant definitions in the loaded generated/runtime.rb (Request, Response, Sock, dispatch_request, Color, parse_query_string!, …). Keeping the loop itself as a top-level script preserves that scoping —methods defined in dev_loop.rb live in the same Object scope as the things ‘load “generated/runtime.rb”` defines.



10
11
12
13
14
# File 'lib/fresco/cli/dev.rb', line 10

def run(argv)
  ARGV.replace(argv)
  Kernel.load(File.expand_path("dev_loop.rb", __dir__))
  0
end