Class: RedfishTools::Cli::Serve
- Inherits:
-
Object
- Object
- RedfishTools::Cli::Serve
- Defined in:
- lib/redfish_tools/cli/serve.rb
Instance Method Summary collapse
-
#initialize(path, options) ⇒ Serve
constructor
A new instance of Serve.
- #run ⇒ Object
Constructor Details
#initialize(path, options) ⇒ Serve
Returns a new instance of Serve.
9 10 11 12 |
# File 'lib/redfish_tools/cli/serve.rb', line 9 def initialize(path, ) @path = path = end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/redfish_tools/cli/serve.rb', line 14 def run datastore = RedfishTools::DataStore.new(@path) server = RedfishTools::Server.new(datastore, [:user], [:pass], Port: [:port], BindAddress: [:bind], SSLEnable: [:ssl], SSLCertName: [%w[CN localhost]]) trap("INT") { server.shutdown } server.start end |