Class: RubyScriptExporter::Server

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

Class Method Summary collapse

Class Method Details

.reload_on_request=(reload_on_request) ⇒ Object



11
12
13
# File 'lib/ruby_script_exporter/server.rb', line 11

def self.reload_on_request=(reload_on_request)
  @reload_on_request = reload_on_request
end

.runObject



21
22
23
24
# File 'lib/ruby_script_exporter/server.rb', line 21

def self.run
  measurements = Executor.new(services, report_execution_time: true, report_counts: true).run
  Formatter.new(measurements).format
end

.service_directory=(service_directory) ⇒ Object



7
8
9
# File 'lib/ruby_script_exporter/server.rb', line 7

def self.service_directory=(service_directory)
  @service_directory = service_directory
end

.servicesObject



15
16
17
18
19
# File 'lib/ruby_script_exporter/server.rb', line 15

def self.services
  return @services if @services && !@reload_on_request

  @services = RubyScriptExporter::ScriptLoader.load_directory(@service_directory)
end