rookout 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -154,6 +154,22 @@ module Rookout
154
154
 
155
155
  attr_reader :level
156
156
 
157
+ def check_result result, first_obj, second_obj
158
+ return unless [true, false].include? result
159
+ if result
160
+ return
161
+ end
162
+
163
+ unless first_obj.nil?
164
+ raise Exceptions::RookNonPrimitiveObjectType, first_obj.class.to_s unless
165
+ PRIMITIVES.include? first_obj.class
166
+ end
167
+
168
+ return if second_obj.nil?
169
+ raise Exceptions::RookNonPrimitiveObjectType, second_obj.class.to_s unless
170
+ PRIMITIVES.include? second_obj.class
171
+ end
172
+
157
173
  def execute_operation first, second
158
174
  # Remove wrapping of objects as needed
159
175
  first_obj = decapsulate_item first
@@ -166,6 +182,8 @@ module Rookout
166
182
  raise Exceptions::RookExceptionEvaluationFailed.new "", e
167
183
  end
168
184
 
185
+ check_result result, first_obj, second_obj
186
+
169
187
  # If we don't have a result
170
188
  if result.nil?
171
189
  # Verify objects are primitives
@@ -24,13 +24,16 @@ module Rookout
24
24
  end
25
25
  end
26
26
 
27
- attr_reader :message
27
+ attr_reader :message, :exception, :parameters
28
28
 
29
29
  def dumps
30
30
  parameters = NamespaceSerializer.dump Namespaces::RubyObjectNamespace.new(@parameters), false
31
31
  exception = NamespaceSerializer.dump Namespaces::RubyObjectNamespace.new(@exception), false
32
32
 
33
- backtrace_string = @exception.backtrace.join "\n\t"
33
+ backtrace_string = ""
34
+ unless @exception.backtrace.nil?
35
+ backtrace_string = @exception.backtrace.join "\n\t"
36
+ end
34
37
  backtrace_object = Namespaces::RubyObjectNamespace.new(backtrace_string).tailor_limits!
35
38
  traceback = NamespaceSerializer.dump backtrace_object, false
36
39
 
@@ -125,6 +125,31 @@ module Rookout
125
125
  Digest::SHA2.new(256).hexdigest content
126
126
  end
127
127
 
128
+ def handle_unique_line lines, location, filename
129
+ first_line = nil
130
+ second_found = false
131
+
132
+ lines.each_with_index do |line, index|
133
+ if crc_line(line) == location.line_crc
134
+ if first_line.nil?
135
+ first_line = index
136
+ else
137
+ second_found = true
138
+ break
139
+ end
140
+ end
141
+ end
142
+
143
+ if first_line && !second_found
144
+ updated_line = first_line + 1
145
+ location.notify_warning Processor::RookError.new Exceptions::RookLineMoved.new(filename,
146
+ location.lineno,
147
+ updated_line)
148
+ return updated_line
149
+ end
150
+ nil
151
+ end
152
+
128
153
  def find_updated_line filename, location
129
154
  return location.lineno if location.line_crc.nil?
130
155
 
@@ -133,23 +158,8 @@ module Rookout
133
158
  return location.lineno if location.line_crc == line_crc32
134
159
 
135
160
  if location.line_unique
136
- first_line = nil
137
- second_found = false
138
-
139
- lines.each_with_index do |line, index|
140
- if crc_line(line) == location.line_crc
141
- if first_line.nil?
142
- first_line = index
143
- else
144
- second_found = true
145
- break
146
- end
147
- end
148
- end
149
-
150
- if first_line && !second_found
151
- updated_line = first_line + 1
152
- location.notify_warning Exceptions::RookLineMoved.new(filename, location.lineno, updated_line)
161
+ updated_line = handle_unique_line lines, location, filename
162
+ unless updated_line.nil?
153
163
  return updated_line
154
164
  end
155
165
  end
@@ -1,3 +1,3 @@
1
1
  module Rookout
2
- VERSION = "0.1.10".freeze
2
+ VERSION = "0.1.11".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rookout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liran Haimovitch
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-17 00:00:00.000000000 Z
11
+ date: 2020-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: binding_of_caller
@@ -253,7 +253,7 @@ licenses:
253
253
  - Proprietary
254
254
  metadata:
255
255
  homepage_uri: https://rookout.com
256
- post_install_message:
256
+ post_install_message:
257
257
  rdoc_options: []
258
258
  require_paths:
259
259
  - lib
@@ -268,8 +268,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
268
  - !ruby/object:Gem::Version
269
269
  version: '0'
270
270
  requirements: []
271
- rubygems_version: 3.0.3
272
- signing_key:
271
+ rubygems_version: 3.1.2
272
+ signing_key:
273
273
  specification_version: 4
274
274
  summary: rookout is the Ruby SDK for the Rookout Debugging Platform
275
275
  test_files: []