Module: ServiceLoader

Defined in:
lib/file_sv/service_loader.rb

Overview

Responsible for loading all files in service directory and creating service

Class Method Summary collapse

Class Method Details

.create_plan_for(folder) ⇒ Object

Create virtual service plan based on folder



10
11
12
13
# File 'lib/file_sv/service_loader.rb', line 10

def create_plan_for(folder)
  SvPlan.create folder
  puts SvPlan.show
end

.inspect(folder) ⇒ Object

Inspect plan



16
17
18
19
# File 'lib/file_sv/service_loader.rb', line 16

def inspect(folder)
  create_plan_for folder
  puts SvPlan.inspect
end

.serve_plan(thor_options) ⇒ Object

Serve plan



22
23
24
25
26
27
28
# File 'lib/file_sv/service_loader.rb', line 22

def serve_plan(thor_options)
  require "sinatra"
  require_relative "virtual_server"
  GlobalSettings.key = thor_options[:key] if thor_options[:key]
  GlobalSettings.cert = thor_options[:crt] if thor_options[:crt]
  VirtualServer.run!
end