Class: PM::SinatraApp

Inherits:
Sinatra::Base
  • Object
show all
Includes:
Singleton
Defined in:
lib/patchmaster/web/sinatra_app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSinatraApp

Returns a new instance of SinatraApp.



112
113
114
# File 'lib/patchmaster/web/sinatra_app.rb', line 112

def initialize
  @pm = PM::PatchMaster.instance
end

Instance Attribute Details

#pmObject (readonly)

Returns the value of attribute pm.



110
111
112
# File 'lib/patchmaster/web/sinatra_app.rb', line 110

def pm
  @pm
end

#portObject

Returns the value of attribute port.



109
110
111
# File 'lib/patchmaster/web/sinatra_app.rb', line 109

def port
  @port
end

Instance Method Details

#refreshObject

Public method callable by triggers



125
126
127
# File 'lib/patchmaster/web/sinatra_app.rb', line 125

def refresh
  # FIXME
end

#runObject



116
117
118
119
120
121
122
# File 'lib/patchmaster/web/sinatra_app.rb', line 116

def run
  self.class.set(:port, @port) if @port
  @pm.start
ensure
  @pm.stop
  @pm.close_debug_file
end