gauge-ruby 0.4.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/api_pb.rb +182 -0
- data/lib/connector.rb +2 -2
- data/lib/executor.rb +19 -17
- data/lib/gauge_runtime.rb +21 -15
- data/lib/lsp_pb.rb +16 -0
- data/lib/lsp_server.rb +78 -0
- data/lib/lsp_services_pb.rb +51 -0
- data/lib/message_processor.rb +24 -22
- data/lib/messages_pb.rb +296 -0
- data/lib/method_cache.rb +1 -1
- data/lib/processors/cache_file_processor.rb +15 -10
- data/lib/processors/datastore_init_processor.rb +4 -4
- data/lib/processors/execution_handler.rb +6 -5
- data/lib/processors/execution_hook_processors.rb +1 -1
- data/lib/processors/implementation_file_list_processor.rb +6 -2
- data/lib/processors/implementation_glob_pattern_processor.rb +36 -0
- data/lib/processors/refactor_step_request_processor.rb +13 -7
- data/lib/processors/step_name_request_processor.rb +14 -12
- data/lib/processors/step_names_request_processor.rb +8 -4
- data/lib/processors/step_positions_request_processor.rb +7 -3
- data/lib/processors/step_validation_request_processor.rb +23 -18
- data/lib/processors/stub_implementation_processor.rb +9 -4
- data/lib/spec_pb.rb +226 -0
- metadata +37 -5
- data/lib/api.pb.rb +0 -273
- data/lib/messages.pb.rb +0 -413
- data/lib/spec.pb.rb +0 -319
@@ -0,0 +1,51 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: lsp.proto for package 'gauge.messages'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2015 ThoughtWorks, Inc.
|
5
|
+
#
|
6
|
+
# This file is part of gauge-proto.
|
7
|
+
#
|
8
|
+
# gauge-proto is free software: you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
10
|
+
# the Free Software Foundation, either version 3 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# gauge-proto is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU General Public License
|
19
|
+
# along with gauge-proto. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'grpc'
|
23
|
+
require 'lsp_pb'
|
24
|
+
|
25
|
+
module Gauge
|
26
|
+
module Messages
|
27
|
+
module LspService
|
28
|
+
class Service
|
29
|
+
|
30
|
+
include GRPC::GenericService
|
31
|
+
|
32
|
+
self.marshal_class_method = :encode
|
33
|
+
self.unmarshal_class_method = :decode
|
34
|
+
self.service_name = 'gauge.messages.lspService'
|
35
|
+
|
36
|
+
rpc :GetStepNames, StepNamesRequest, StepNamesResponse
|
37
|
+
rpc :CacheFile, CacheFileRequest, Empty
|
38
|
+
rpc :GetStepPositions, StepPositionsRequest, StepPositionsResponse
|
39
|
+
rpc :GetImplementationFiles, Empty, ImplementationFileListResponse
|
40
|
+
rpc :ImplementStub, StubImplementationCodeRequest, FileDiff
|
41
|
+
rpc :ValidateStep, StepValidateRequest, StepValidateResponse
|
42
|
+
rpc :Refactor, RefactorRequest, RefactorResponse
|
43
|
+
rpc :GetStepName, StepNameRequest, StepNameResponse
|
44
|
+
rpc :GetGlobPatterns, Empty, ImplementationFileGlobPatternResponse
|
45
|
+
rpc :KillProcess, KillProcessRequest, Empty
|
46
|
+
end
|
47
|
+
|
48
|
+
Stub = Service.rpc_stub_class
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/lib/message_processor.rb
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
16
16
|
# along with Gauge-Ruby. If not, see <http://www.gnu.org/licenses/>.
|
17
17
|
|
18
|
-
require_relative '
|
18
|
+
require_relative 'messages_pb'
|
19
19
|
require_relative 'executor'
|
20
20
|
require_relative 'table'
|
21
21
|
Dir[File.join(File.dirname(__FILE__), 'processors/*.rb')].each {|file| require file}
|
@@ -26,27 +26,29 @@ module Gauge
|
|
26
26
|
extend Processors
|
27
27
|
|
28
28
|
@processors = Hash.new
|
29
|
-
|
30
|
-
@processors[
|
31
|
-
@processors[
|
32
|
-
@processors[
|
33
|
-
@processors[
|
34
|
-
@processors[
|
35
|
-
@processors[
|
36
|
-
@processors[
|
37
|
-
@processors[
|
38
|
-
@processors[
|
39
|
-
@processors[
|
40
|
-
@processors[
|
41
|
-
@processors[
|
42
|
-
@processors[
|
43
|
-
@processors[
|
44
|
-
@processors[
|
45
|
-
@processors[
|
46
|
-
@processors[
|
47
|
-
@processors[
|
48
|
-
@processors[
|
49
|
-
@processors[
|
29
|
+
|
30
|
+
@processors[:StepValidateRequest] = method(:process_step_validation_request)
|
31
|
+
@processors[:ExecutionStarting] = method(:process_execution_start_request)
|
32
|
+
@processors[:ExecutionEnding] = method(:process_execution_end_request)
|
33
|
+
@processors[:SpecExecutionStarting] = method(:process_spec_execution_start_request)
|
34
|
+
@processors[:SpecExecutionEnding] = method(:process_spec_execution_end_request)
|
35
|
+
@processors[:ScenarioExecutionStarting] = method(:process_scenario_execution_start_request)
|
36
|
+
@processors[:ScenarioExecutionEnding] = method(:process_scenario_execution_end_request)
|
37
|
+
@processors[:StepExecutionStarting] = method(:process_step_execution_start_request)
|
38
|
+
@processors[:StepExecutionEnding] = method(:process_step_execution_end_request)
|
39
|
+
@processors[:ExecuteStep] = method(:process_execute_step_request)
|
40
|
+
@processors[:StepNamesRequest] = method(:process_step_names_request)
|
41
|
+
@processors[:KillProcessRequest] = method(:process_kill_processor_request)
|
42
|
+
@processors[:SuiteDataStoreInit] = method(:process_datastore_init)
|
43
|
+
@processors[:SpecDataStoreInit] = method(:process_datastore_init)
|
44
|
+
@processors[:ScenarioDataStoreInit] = method(:process_datastore_init)
|
45
|
+
@processors[:StepNameRequest] = method(:process_step_name_request)
|
46
|
+
@processors[:RefactorRequest] = method(:refactor_step)
|
47
|
+
@processors[:CacheFileRequest] = method(:process_cache_file_request)
|
48
|
+
@processors[:StepPositionsRequest] = method(:process_step_positions_request)
|
49
|
+
@processors[:ImplementationFileListRequest] = method(:process_implementation_file_list_request)
|
50
|
+
@processors[:ImplementationFileGlobPatternRequest] = method(:process_implementation_glob_pattern_request)
|
51
|
+
@processors[:StubImplementationCodeRequest] = method(:process_stub_implementation_code_request)
|
50
52
|
|
51
53
|
def self.is_valid_message(message)
|
52
54
|
return @processors.has_key? message.messageType
|
data/lib/messages_pb.rb
ADDED
@@ -0,0 +1,296 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: messages.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'spec_pb'
|
7
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
|
+
add_message "gauge.messages.KillProcessRequest" do
|
9
|
+
end
|
10
|
+
add_message "gauge.messages.ExecutionStatusResponse" do
|
11
|
+
optional :executionResult, :message, 1, "gauge.messages.ProtoExecutionResult"
|
12
|
+
end
|
13
|
+
add_message "gauge.messages.ExecutionStartingRequest" do
|
14
|
+
optional :currentExecutionInfo, :message, 1, "gauge.messages.ExecutionInfo"
|
15
|
+
end
|
16
|
+
add_message "gauge.messages.ExecutionEndingRequest" do
|
17
|
+
optional :currentExecutionInfo, :message, 1, "gauge.messages.ExecutionInfo"
|
18
|
+
end
|
19
|
+
add_message "gauge.messages.SpecExecutionStartingRequest" do
|
20
|
+
optional :currentExecutionInfo, :message, 1, "gauge.messages.ExecutionInfo"
|
21
|
+
end
|
22
|
+
add_message "gauge.messages.SpecExecutionEndingRequest" do
|
23
|
+
optional :currentExecutionInfo, :message, 1, "gauge.messages.ExecutionInfo"
|
24
|
+
end
|
25
|
+
add_message "gauge.messages.ScenarioExecutionStartingRequest" do
|
26
|
+
optional :currentExecutionInfo, :message, 1, "gauge.messages.ExecutionInfo"
|
27
|
+
end
|
28
|
+
add_message "gauge.messages.ScenarioExecutionEndingRequest" do
|
29
|
+
optional :currentExecutionInfo, :message, 1, "gauge.messages.ExecutionInfo"
|
30
|
+
end
|
31
|
+
add_message "gauge.messages.StepExecutionStartingRequest" do
|
32
|
+
optional :currentExecutionInfo, :message, 1, "gauge.messages.ExecutionInfo"
|
33
|
+
end
|
34
|
+
add_message "gauge.messages.StepExecutionEndingRequest" do
|
35
|
+
optional :currentExecutionInfo, :message, 1, "gauge.messages.ExecutionInfo"
|
36
|
+
end
|
37
|
+
add_message "gauge.messages.ExecutionInfo" do
|
38
|
+
optional :currentSpec, :message, 1, "gauge.messages.SpecInfo"
|
39
|
+
optional :currentScenario, :message, 2, "gauge.messages.ScenarioInfo"
|
40
|
+
optional :currentStep, :message, 3, "gauge.messages.StepInfo"
|
41
|
+
optional :stacktrace, :string, 4
|
42
|
+
end
|
43
|
+
add_message "gauge.messages.SpecInfo" do
|
44
|
+
optional :name, :string, 1
|
45
|
+
optional :fileName, :string, 2
|
46
|
+
optional :isFailed, :bool, 3
|
47
|
+
repeated :tags, :string, 4
|
48
|
+
end
|
49
|
+
add_message "gauge.messages.ScenarioInfo" do
|
50
|
+
optional :name, :string, 1
|
51
|
+
optional :isFailed, :bool, 2
|
52
|
+
repeated :tags, :string, 3
|
53
|
+
end
|
54
|
+
add_message "gauge.messages.StepInfo" do
|
55
|
+
optional :step, :message, 1, "gauge.messages.ExecuteStepRequest"
|
56
|
+
optional :isFailed, :bool, 2
|
57
|
+
optional :stackTrace, :string, 3
|
58
|
+
optional :errorMessage, :string, 4
|
59
|
+
end
|
60
|
+
add_message "gauge.messages.ExecuteStepRequest" do
|
61
|
+
optional :actualStepText, :string, 1
|
62
|
+
optional :parsedStepText, :string, 2
|
63
|
+
optional :scenarioFailing, :bool, 3
|
64
|
+
repeated :parameters, :message, 4, "gauge.messages.Parameter"
|
65
|
+
end
|
66
|
+
add_message "gauge.messages.StepValidateRequest" do
|
67
|
+
optional :stepText, :string, 1
|
68
|
+
optional :numberOfParameters, :int32, 2
|
69
|
+
optional :stepValue, :message, 3, "gauge.messages.ProtoStepValue"
|
70
|
+
end
|
71
|
+
add_message "gauge.messages.StepValidateResponse" do
|
72
|
+
optional :isValid, :bool, 1
|
73
|
+
optional :errorMessage, :string, 2
|
74
|
+
optional :errorType, :enum, 3, "gauge.messages.StepValidateResponse.ErrorType"
|
75
|
+
optional :suggestion, :string, 4
|
76
|
+
end
|
77
|
+
add_enum "gauge.messages.StepValidateResponse.ErrorType" do
|
78
|
+
value :STEP_IMPLEMENTATION_NOT_FOUND, 0
|
79
|
+
value :DUPLICATE_STEP_IMPLEMENTATION, 1
|
80
|
+
end
|
81
|
+
add_message "gauge.messages.SuiteExecutionResult" do
|
82
|
+
optional :suiteResult, :message, 1, "gauge.messages.ProtoSuiteResult"
|
83
|
+
end
|
84
|
+
add_message "gauge.messages.StepNamesRequest" do
|
85
|
+
end
|
86
|
+
add_message "gauge.messages.StepNamesResponse" do
|
87
|
+
repeated :steps, :string, 1
|
88
|
+
end
|
89
|
+
add_message "gauge.messages.ScenarioDataStoreInitRequest" do
|
90
|
+
end
|
91
|
+
add_message "gauge.messages.SpecDataStoreInitRequest" do
|
92
|
+
end
|
93
|
+
add_message "gauge.messages.SuiteDataStoreInitRequest" do
|
94
|
+
end
|
95
|
+
add_message "gauge.messages.ParameterPosition" do
|
96
|
+
optional :oldPosition, :int32, 1
|
97
|
+
optional :newPosition, :int32, 2
|
98
|
+
end
|
99
|
+
add_message "gauge.messages.RefactorRequest" do
|
100
|
+
optional :oldStepValue, :message, 1, "gauge.messages.ProtoStepValue"
|
101
|
+
optional :newStepValue, :message, 2, "gauge.messages.ProtoStepValue"
|
102
|
+
repeated :paramPositions, :message, 3, "gauge.messages.ParameterPosition"
|
103
|
+
optional :saveChanges, :bool, 4
|
104
|
+
end
|
105
|
+
add_message "gauge.messages.FileChanges" do
|
106
|
+
optional :fileName, :string, 1
|
107
|
+
optional :fileContent, :string, 2
|
108
|
+
end
|
109
|
+
add_message "gauge.messages.RefactorResponse" do
|
110
|
+
optional :success, :bool, 1
|
111
|
+
optional :error, :string, 2
|
112
|
+
repeated :filesChanged, :string, 3
|
113
|
+
repeated :fileChanges, :message, 4, "gauge.messages.FileChanges"
|
114
|
+
end
|
115
|
+
add_message "gauge.messages.StepNameRequest" do
|
116
|
+
optional :stepValue, :string, 1
|
117
|
+
end
|
118
|
+
add_message "gauge.messages.StepNameResponse" do
|
119
|
+
optional :isStepPresent, :bool, 1
|
120
|
+
repeated :stepName, :string, 2
|
121
|
+
optional :hasAlias, :bool, 3
|
122
|
+
optional :fileName, :string, 4
|
123
|
+
optional :span, :message, 5, "gauge.messages.Span"
|
124
|
+
end
|
125
|
+
add_message "gauge.messages.UnsupportedMessageResponse" do
|
126
|
+
optional :message, :string, 1
|
127
|
+
end
|
128
|
+
add_message "gauge.messages.CacheFileRequest" do
|
129
|
+
optional :content, :string, 1
|
130
|
+
optional :filePath, :string, 2
|
131
|
+
optional :isClosed, :bool, 3
|
132
|
+
optional :status, :enum, 4, "gauge.messages.CacheFileRequest.FileStatus"
|
133
|
+
end
|
134
|
+
add_enum "gauge.messages.CacheFileRequest.FileStatus" do
|
135
|
+
value :CHANGED, 0
|
136
|
+
value :CLOSED, 1
|
137
|
+
value :CREATED, 2
|
138
|
+
value :DELETED, 3
|
139
|
+
value :OPENED, 4
|
140
|
+
end
|
141
|
+
add_message "gauge.messages.StepPositionsRequest" do
|
142
|
+
optional :filePath, :string, 1
|
143
|
+
end
|
144
|
+
add_message "gauge.messages.StepPositionsResponse" do
|
145
|
+
repeated :stepPositions, :message, 1, "gauge.messages.StepPositionsResponse.StepPosition"
|
146
|
+
optional :error, :string, 2
|
147
|
+
end
|
148
|
+
add_message "gauge.messages.StepPositionsResponse.StepPosition" do
|
149
|
+
optional :stepValue, :string, 1
|
150
|
+
optional :span, :message, 2, "gauge.messages.Span"
|
151
|
+
end
|
152
|
+
add_message "gauge.messages.ImplementationFileGlobPatternRequest" do
|
153
|
+
end
|
154
|
+
add_message "gauge.messages.ImplementationFileGlobPatternResponse" do
|
155
|
+
repeated :globPatterns, :string, 1
|
156
|
+
end
|
157
|
+
add_message "gauge.messages.ImplementationFileListRequest" do
|
158
|
+
end
|
159
|
+
add_message "gauge.messages.ImplementationFileListResponse" do
|
160
|
+
repeated :implementationFilePaths, :string, 1
|
161
|
+
end
|
162
|
+
add_message "gauge.messages.StubImplementationCodeRequest" do
|
163
|
+
optional :implementationFilePath, :string, 1
|
164
|
+
repeated :codes, :string, 2
|
165
|
+
end
|
166
|
+
add_message "gauge.messages.TextDiff" do
|
167
|
+
optional :span, :message, 1, "gauge.messages.Span"
|
168
|
+
optional :content, :string, 2
|
169
|
+
end
|
170
|
+
add_message "gauge.messages.FileDiff" do
|
171
|
+
optional :filePath, :string, 1
|
172
|
+
repeated :textDiffs, :message, 2, "gauge.messages.TextDiff"
|
173
|
+
end
|
174
|
+
add_message "gauge.messages.Message" do
|
175
|
+
optional :messageType, :enum, 1, "gauge.messages.Message.MessageType"
|
176
|
+
optional :messageId, :int64, 2
|
177
|
+
optional :executionStartingRequest, :message, 3, "gauge.messages.ExecutionStartingRequest"
|
178
|
+
optional :specExecutionStartingRequest, :message, 4, "gauge.messages.SpecExecutionStartingRequest"
|
179
|
+
optional :specExecutionEndingRequest, :message, 5, "gauge.messages.SpecExecutionEndingRequest"
|
180
|
+
optional :scenarioExecutionStartingRequest, :message, 6, "gauge.messages.ScenarioExecutionStartingRequest"
|
181
|
+
optional :scenarioExecutionEndingRequest, :message, 7, "gauge.messages.ScenarioExecutionEndingRequest"
|
182
|
+
optional :stepExecutionStartingRequest, :message, 8, "gauge.messages.StepExecutionStartingRequest"
|
183
|
+
optional :stepExecutionEndingRequest, :message, 9, "gauge.messages.StepExecutionEndingRequest"
|
184
|
+
optional :executeStepRequest, :message, 10, "gauge.messages.ExecuteStepRequest"
|
185
|
+
optional :executionEndingRequest, :message, 11, "gauge.messages.ExecutionEndingRequest"
|
186
|
+
optional :stepValidateRequest, :message, 12, "gauge.messages.StepValidateRequest"
|
187
|
+
optional :stepValidateResponse, :message, 13, "gauge.messages.StepValidateResponse"
|
188
|
+
optional :executionStatusResponse, :message, 14, "gauge.messages.ExecutionStatusResponse"
|
189
|
+
optional :stepNamesRequest, :message, 15, "gauge.messages.StepNamesRequest"
|
190
|
+
optional :stepNamesResponse, :message, 16, "gauge.messages.StepNamesResponse"
|
191
|
+
optional :suiteExecutionResult, :message, 17, "gauge.messages.SuiteExecutionResult"
|
192
|
+
optional :killProcessRequest, :message, 18, "gauge.messages.KillProcessRequest"
|
193
|
+
optional :scenarioDataStoreInitRequest, :message, 19, "gauge.messages.ScenarioDataStoreInitRequest"
|
194
|
+
optional :specDataStoreInitRequest, :message, 20, "gauge.messages.SpecDataStoreInitRequest"
|
195
|
+
optional :suiteDataStoreInitRequest, :message, 21, "gauge.messages.SuiteDataStoreInitRequest"
|
196
|
+
optional :stepNameRequest, :message, 22, "gauge.messages.StepNameRequest"
|
197
|
+
optional :stepNameResponse, :message, 23, "gauge.messages.StepNameResponse"
|
198
|
+
optional :refactorRequest, :message, 24, "gauge.messages.RefactorRequest"
|
199
|
+
optional :refactorResponse, :message, 25, "gauge.messages.RefactorResponse"
|
200
|
+
optional :unsupportedMessageResponse, :message, 26, "gauge.messages.UnsupportedMessageResponse"
|
201
|
+
optional :cacheFileRequest, :message, 27, "gauge.messages.CacheFileRequest"
|
202
|
+
optional :stepPositionsRequest, :message, 28, "gauge.messages.StepPositionsRequest"
|
203
|
+
optional :stepPositionsResponse, :message, 29, "gauge.messages.StepPositionsResponse"
|
204
|
+
optional :implementationFileListRequest, :message, 30, "gauge.messages.ImplementationFileListRequest"
|
205
|
+
optional :implementationFileListResponse, :message, 31, "gauge.messages.ImplementationFileListResponse"
|
206
|
+
optional :stubImplementationCodeRequest, :message, 32, "gauge.messages.StubImplementationCodeRequest"
|
207
|
+
optional :fileDiff, :message, 33, "gauge.messages.FileDiff"
|
208
|
+
optional :implementationFileGlobPatternRequest, :message, 34, "gauge.messages.ImplementationFileGlobPatternRequest"
|
209
|
+
optional :implementationFileGlobPatternResponse, :message, 35, "gauge.messages.ImplementationFileGlobPatternResponse"
|
210
|
+
end
|
211
|
+
add_enum "gauge.messages.Message.MessageType" do
|
212
|
+
value :ExecutionStarting, 0
|
213
|
+
value :SpecExecutionStarting, 1
|
214
|
+
value :SpecExecutionEnding, 2
|
215
|
+
value :ScenarioExecutionStarting, 3
|
216
|
+
value :ScenarioExecutionEnding, 4
|
217
|
+
value :StepExecutionStarting, 5
|
218
|
+
value :StepExecutionEnding, 6
|
219
|
+
value :ExecuteStep, 7
|
220
|
+
value :ExecutionEnding, 8
|
221
|
+
value :StepValidateRequest, 9
|
222
|
+
value :StepValidateResponse, 10
|
223
|
+
value :ExecutionStatusResponse, 11
|
224
|
+
value :StepNamesRequest, 12
|
225
|
+
value :StepNamesResponse, 13
|
226
|
+
value :KillProcessRequest, 14
|
227
|
+
value :SuiteExecutionResult, 15
|
228
|
+
value :ScenarioDataStoreInit, 16
|
229
|
+
value :SpecDataStoreInit, 17
|
230
|
+
value :SuiteDataStoreInit, 18
|
231
|
+
value :StepNameRequest, 19
|
232
|
+
value :StepNameResponse, 20
|
233
|
+
value :RefactorRequest, 21
|
234
|
+
value :RefactorResponse, 22
|
235
|
+
value :UnsupportedMessageResponse, 23
|
236
|
+
value :CacheFileRequest, 24
|
237
|
+
value :StepPositionsRequest, 25
|
238
|
+
value :StepPositionsResponse, 26
|
239
|
+
value :ImplementationFileListRequest, 27
|
240
|
+
value :ImplementationFileListResponse, 28
|
241
|
+
value :StubImplementationCodeRequest, 29
|
242
|
+
value :FileDiff, 30
|
243
|
+
value :ImplementationFileGlobPatternRequest, 31
|
244
|
+
value :ImplementationFileGlobPatternResponse, 32
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
module Gauge
|
249
|
+
module Messages
|
250
|
+
KillProcessRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.KillProcessRequest").msgclass
|
251
|
+
ExecutionStatusResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ExecutionStatusResponse").msgclass
|
252
|
+
ExecutionStartingRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ExecutionStartingRequest").msgclass
|
253
|
+
ExecutionEndingRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ExecutionEndingRequest").msgclass
|
254
|
+
SpecExecutionStartingRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.SpecExecutionStartingRequest").msgclass
|
255
|
+
SpecExecutionEndingRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.SpecExecutionEndingRequest").msgclass
|
256
|
+
ScenarioExecutionStartingRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ScenarioExecutionStartingRequest").msgclass
|
257
|
+
ScenarioExecutionEndingRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ScenarioExecutionEndingRequest").msgclass
|
258
|
+
StepExecutionStartingRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StepExecutionStartingRequest").msgclass
|
259
|
+
StepExecutionEndingRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StepExecutionEndingRequest").msgclass
|
260
|
+
ExecutionInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ExecutionInfo").msgclass
|
261
|
+
SpecInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.SpecInfo").msgclass
|
262
|
+
ScenarioInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ScenarioInfo").msgclass
|
263
|
+
StepInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StepInfo").msgclass
|
264
|
+
ExecuteStepRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ExecuteStepRequest").msgclass
|
265
|
+
StepValidateRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StepValidateRequest").msgclass
|
266
|
+
StepValidateResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StepValidateResponse").msgclass
|
267
|
+
StepValidateResponse::ErrorType = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StepValidateResponse.ErrorType").enummodule
|
268
|
+
SuiteExecutionResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.SuiteExecutionResult").msgclass
|
269
|
+
StepNamesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StepNamesRequest").msgclass
|
270
|
+
StepNamesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StepNamesResponse").msgclass
|
271
|
+
ScenarioDataStoreInitRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ScenarioDataStoreInitRequest").msgclass
|
272
|
+
SpecDataStoreInitRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.SpecDataStoreInitRequest").msgclass
|
273
|
+
SuiteDataStoreInitRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.SuiteDataStoreInitRequest").msgclass
|
274
|
+
ParameterPosition = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ParameterPosition").msgclass
|
275
|
+
RefactorRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.RefactorRequest").msgclass
|
276
|
+
FileChanges = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.FileChanges").msgclass
|
277
|
+
RefactorResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.RefactorResponse").msgclass
|
278
|
+
StepNameRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StepNameRequest").msgclass
|
279
|
+
StepNameResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StepNameResponse").msgclass
|
280
|
+
UnsupportedMessageResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.UnsupportedMessageResponse").msgclass
|
281
|
+
CacheFileRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.CacheFileRequest").msgclass
|
282
|
+
CacheFileRequest::FileStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.CacheFileRequest.FileStatus").enummodule
|
283
|
+
StepPositionsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StepPositionsRequest").msgclass
|
284
|
+
StepPositionsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StepPositionsResponse").msgclass
|
285
|
+
StepPositionsResponse::StepPosition = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StepPositionsResponse.StepPosition").msgclass
|
286
|
+
ImplementationFileGlobPatternRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ImplementationFileGlobPatternRequest").msgclass
|
287
|
+
ImplementationFileGlobPatternResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ImplementationFileGlobPatternResponse").msgclass
|
288
|
+
ImplementationFileListRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ImplementationFileListRequest").msgclass
|
289
|
+
ImplementationFileListResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.ImplementationFileListResponse").msgclass
|
290
|
+
StubImplementationCodeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.StubImplementationCodeRequest").msgclass
|
291
|
+
TextDiff = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.TextDiff").msgclass
|
292
|
+
FileDiff = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.FileDiff").msgclass
|
293
|
+
Message = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.Message").msgclass
|
294
|
+
Message::MessageType = Google::Protobuf::DescriptorPool.generated_pool.lookup("gauge.messages.Message.MessageType").enummodule
|
295
|
+
end
|
296
|
+
end
|
data/lib/method_cache.rb
CHANGED
@@ -81,7 +81,7 @@ module Gauge
|
|
81
81
|
|
82
82
|
def self.remove_steps(file)
|
83
83
|
@@steps_map.each_pair do |step, info|
|
84
|
-
l = info[:locations].reject { |loc| File.
|
84
|
+
l = info[:locations].reject { |loc| File.fnmatch? loc[:file], file }
|
85
85
|
l.empty? ? @@steps_map.delete(step) : @@steps_map[step][:locations] = l
|
86
86
|
end
|
87
87
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Copyright 2018 ThoughtWorks, Inc.
|
2
4
|
|
3
5
|
# This file is part of Gauge-Ruby.
|
@@ -21,23 +23,26 @@ module Gauge
|
|
21
23
|
# @api private
|
22
24
|
module Processors
|
23
25
|
def process_cache_file_request(message)
|
24
|
-
|
25
|
-
ast = CodeParser.code_to_ast(message.cacheFileRequest.content)
|
26
|
-
StaticLoader.reload_steps(message.cacheFileRequest.filePath, ast)
|
27
|
-
else
|
28
|
-
load_from_disk message.cacheFileRequest.filePath
|
29
|
-
end
|
26
|
+
cache_file_response(message.cacheFileRequest)
|
30
27
|
nil
|
31
28
|
end
|
32
29
|
|
33
|
-
def
|
34
|
-
|
30
|
+
def cache_file_response(request)
|
31
|
+
f = request.filePath
|
32
|
+
status = Messages::CacheFileRequest::FileStatus.resolve(request.status)
|
33
|
+
if (status == Messages::CacheFileRequest::FileStatus::CHANGED) || (status == Messages::CacheFileRequest::FileStatus::OPENED)
|
34
|
+
ast = CodeParser.code_to_ast(request.content)
|
35
|
+
StaticLoader.reload_steps(f, ast)
|
36
|
+
elsif status == Messages::CacheFileRequest::FileStatus::CREATED
|
37
|
+
ast = CodeParser.code_to_ast File.read(f)
|
38
|
+
StaticLoader.reload_steps(f, ast)
|
39
|
+
elsif (status == Messages::CacheFileRequest::FileStatus::CLOSED) && File.file?(f)
|
35
40
|
ast = CodeParser.code_to_ast File.read(f)
|
36
41
|
StaticLoader.reload_steps(f, ast)
|
37
42
|
else
|
38
43
|
StaticLoader.remove_steps(f)
|
39
44
|
end
|
45
|
+
Messages::Empty.new
|
40
46
|
end
|
41
|
-
|
42
47
|
end
|
43
|
-
end
|
48
|
+
end
|