Module: Gauge::Runtime Private
- Defined in:
- lib/gauge_runtime.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- DEFAULT_IMPLEMENTATIONS_DIR_PATH =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
File.join(Dir.pwd, 'step_implementations')
Class Method Summary collapse
- .dispatch_messages(socket) ⇒ Object private
- .handle_message(socket, message) ⇒ Object private
- .portFromEnvVariable(envVariable) ⇒ Object private
- .write_message(socket, message) ⇒ Object private
Class Method Details
.dispatch_messages(socket) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/gauge_runtime.rb', line 32 def self.(socket) while (!socket.eof?) len = Connector.(socket) data = socket.read len = Messages::Message.parse(data) (socket, ) if (. == Messages::Message::MessageType::KillProcessRequest || . == Messages::Message::MessageType::ExecutionEnding) socket.close return end end end |
.handle_message(socket, message) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/gauge_runtime.rb', line 46 def self.(socket, ) if (!MessageProcessor.()) puts "Invalid message received : #{}" execution_status_response = Messages::ExecutionStatusResponse.new(:executionResult => Messages::ProtoExecutionResult.new(:failed => true, :executionTime => 0)) = Messages::Message.new(:messageType => Messages::Message::MessageType::ExecutionStatusResponse, :messageId => ., :executionStatusResponse => execution_status_response) (socket, ) else response = MessageProcessor. (socket, response) end end |
.portFromEnvVariable(envVariable) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
65 66 67 68 69 70 71 |
# File 'lib/gauge_runtime.rb', line 65 def self.portFromEnvVariable(envVariable) port = ENV[envVariable] if (port.nil?) raise RuntimeError, "Could not find Env variable :#{envVariable}" end return port end |
.write_message(socket, message) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
58 59 60 61 62 63 |
# File 'lib/gauge_runtime.rb', line 58 def self.(socket, ) = .to_s size = .bytesize ProtocolBuffers::Varint.encode(socket, size) socket.write end |