test_bench-telemetry 2.1.0.3 → 2.1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8652b11a81710eca5cbd907396aecc2c790c047d5a4b9e681909b06855a2d7a9
4
- data.tar.gz: 2bd1eb8d089b5d00480cd28e21034e5879562def468c9bd329b50ff2549577c9
3
+ metadata.gz: 8deb57684f33eeadb3402ccf6c05a119ff5e836957cfb00deed4cbbf442a755a
4
+ data.tar.gz: 83e4ceb13ec5766dbbec3d348f41458c1508dc5f98852754a298fd06818f5123
5
5
  SHA512:
6
- metadata.gz: bb527458e28bc3c2cae0f0976bc6c8dda04c213b5c244fee20ce1e076a32d4329c61eaa833ce2bcaa08337a763cfbd602aaa9cb8e1c885cf93ae538968986ea7
7
- data.tar.gz: bc84eaf0dfd1d8bd9d0af7dab20794a08e8c4367ce67eeb15e97c7db7f4c9fb5fb84daa332d219207f664aafec0100cc128193262d892ef5cbcf982abc016071
6
+ metadata.gz: cf31234b99ed73ea46932a1141746f2b322b82736b6a62122d0ac82aedccbe429ebd698adc9911a27f98c93db6e837794b67c9dedcac4b28506971cd0152c440
7
+ data.tar.gz: cbd88250f3b9cfc0278de0c45605c5c77183506212a426bc597bc1d41497083bb4c4bc1177326b7ebab88de517a470c8ee84b157e096bdecba7c62a8c2039500
@@ -33,6 +33,10 @@ module TestBench
33
33
 
34
34
  module EventType
35
35
  def event_type
36
+ @event_type ||= event_type!
37
+ end
38
+
39
+ def event_type!
36
40
  *, inner_namespace = self.name.split('::')
37
41
 
38
42
  inner_namespace.to_sym
@@ -105,9 +105,7 @@ module TestBench
105
105
  end
106
106
 
107
107
  def self.match_value(value_text)
108
- pattern = %r{\A#{value}\z}
109
-
110
- pattern.match(value_text)
108
+ value_pattern.match(value_text)
111
109
  end
112
110
 
113
111
  def self.event_data
@@ -115,34 +113,34 @@ module TestBench
115
113
  end
116
114
 
117
115
  def self.type
118
- @type ||= %r{(?<type>[A-Z][[:alnum:]]+)}
116
+ %r{(?<type>[A-Z][[:alnum:]]+)}
119
117
  end
120
118
 
121
119
  def self.process_id
122
- @process_id ||= %r{(?<process_id>#{integer})}
120
+ %r{(?<process_id>#{integer})}
121
+ end
122
+
123
+ def self.value_pattern
124
+ @value_pattern ||= %r{\A#{value}\z}
123
125
  end
124
126
 
125
127
  def self.time_attribute
126
- @time_attribute ||= %r{(?<time_attribute>#{time})}
128
+ %r{(?<time_attribute>#{time})}
127
129
  end
128
130
 
129
131
  def self.data
130
- @data ||= %r{(?<data>#{value}(?:\t#{value})*)}
132
+ %r{(?<data>#{value}(?:\t#{value})*)}
131
133
  end
132
134
 
133
135
  def self.value
134
- @value ||= %r{#{integer}|#{time}|#{self.nil}|#{boolean}|#{string}}
136
+ %r{#{integer}|#{time}|#{self.nil}|#{boolean}|#{string}}
135
137
  end
136
138
 
137
139
  def self.integer
138
- @integer ||= %r{(?<integer>[[:digit:]]+)}
140
+ %r{(?<integer>[[:digit:]]+)}
139
141
  end
140
142
 
141
143
  def self.time
142
- @time ||= time!
143
- end
144
-
145
- def self.time!
146
144
  year = %r{(?<year>[[:digit:]]{4})}
147
145
  month = %r{(?<month>[[:digit:]]{2})}
148
146
  day = %r{(?<day>[[:digit:]]{2})}
@@ -155,15 +153,15 @@ module TestBench
155
153
  end
156
154
 
157
155
  def self.nil
158
- @nil ||= %r{(?<nil>(?=[\t\r\z])?)}
156
+ %r{(?<nil>(?=[\t\r\z])?)}
159
157
  end
160
158
 
161
159
  def self.boolean
162
- @boolean ||= %r{(?<true>true)|(?<false>false)}
160
+ %r{(?<true>true)|(?<false>false)}
163
161
  end
164
162
 
165
163
  def self.string
166
- @string ||= %r{(?<string>".*")}
164
+ %r{(?<string>".*")}
167
165
  end
168
166
  end
169
167
  end
@@ -103,6 +103,18 @@ module TestBench
103
103
  end
104
104
 
105
105
  def self.get(event_type)
106
+ handler_methods[event_type]
107
+ end
108
+
109
+ def self.handler_methods
110
+ @handler_methods ||= Hash.new do |handler_methods, event_type|
111
+ handler_method = get!(event_type)
112
+
113
+ handler_methods[event_type] = handler_method
114
+ end
115
+ end
116
+
117
+ def self.get!(event_type)
106
118
  event_name = Event::EventName.get(event_type)
107
119
 
108
120
  :"handle_#{event_name}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_bench-telemetry
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0.3
4
+ version: 2.1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Ladd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-25 00:00:00.000000000 Z
11
+ date: 2023-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test_bench-random