break 0.8.0 → 0.9.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e14cd966917b91b925d085e986916164b42e5a3dd1986818b0e45e291e8177d5
4
- data.tar.gz: 596fc1d57d319b23303ec89832c3e93cfbc62a6d040406f5ce9cad4dc8103735
3
+ metadata.gz: 7ef06d9ad6c7511104925c2b1d6f9e5a61b8dc2e1cb1f9b982701e927b7b7610
4
+ data.tar.gz: 7e5909e5fd6673e8a209c34763946816ed1304fd82d86340e7c998a5ba472994
5
5
  SHA512:
6
- metadata.gz: 8c9bf9ea4a4ddb23c69c27f536e1f54b87dd785346dd70e7f13c5dcc6fe51248ec3987f87e35f4dd6dd03016de4360e94a744d5218b5c33c48ce96d1e443e78a
7
- data.tar.gz: 5f4f020f420ed3adb3db0db53960fa68c0b2824802dd3a718923ae151d71ae46eabeb037414ac3753131f329eccd46305b04429e1c77705eff4b7e61e5d4a718
6
+ metadata.gz: a2c4c328b86982034c6113067c1f117d273d12a882c262713d2997d0e3d430c96964b60f46dc25ebe28eb8172188157841ca6fdbf737ea2f36e9aeb64139b882
7
+ data.tar.gz: 84f61f9b4c78e735b459b8f5b79a49ff9857e5f9b3fc28eb360f2dd2775b83b848d7c161267fb6008258018c38a8cd62cd1b0c62dcaf5003097a10082c5c1bd4
@@ -10,6 +10,18 @@ module Break
10
10
  end
11
11
  end
12
12
 
13
+ def initialize(*)
14
+ super
15
+
16
+ @delayed_context = Fiber.new do |*args|
17
+ session.context!(*args)
18
+
19
+ loop do
20
+ session.context!(*Fiber.yield)
21
+ end
22
+ end
23
+ end
24
+
13
25
  def execute(*args)
14
26
  TracePoint.trace(*trace_events) do |trace|
15
27
  next if Filter.internal?(trace.path)
@@ -26,6 +38,10 @@ module Break
26
38
 
27
39
  private
28
40
 
41
+ def context!(*args)
42
+ @delayed_context.resume(*args)
43
+ end
44
+
29
45
  def trace_events
30
46
  self.class.trace_events
31
47
  end
@@ -9,6 +9,7 @@ module Break::IRB
9
9
  define_command session, :step, Break::StepCommand
10
10
  define_command session, :up, Break::UpCommand
11
11
  define_command session, :down, Break::DownCommand
12
+ define_command session, :list, Break::ListCommand
12
13
  define_command session, :continue, Break::ContinueCommand, preserve: false
13
14
  end
14
15
 
@@ -19,9 +20,9 @@ module Break::IRB
19
20
  cls.new(session).execute(*args)
20
21
  ensure
21
22
  # We don't have a clear guideline of when an IRB session starts and
22
- # when it ends. If we're excuting commands, we have to quit the IRB
23
+ # when it ends. If we're executing commands, we have to quit the IRB
23
24
  # session which naturally marks it as stopped. If we're executing a
24
- # `break` command though we actually want to keep marking it as started
25
+ # `break` command we actually want to keep marking it as started
25
26
  # so we don't step over `binding.irb` calls.
26
27
  Break::Session.start! if preserve
27
28
  end
@@ -43,9 +43,9 @@ module Break::IRB
43
43
  # commands support in the lexer level, we need to call the `next` command
44
44
  # in syntactically correct way.
45
45
  def special_case_next_eval(irb_context)
46
- def irb_context.evaluate(line, line_no, exception: nil)
46
+ def irb_context.evaluate(line, line_no, *args)
47
47
  line = "self.next\n" if line == "next\n"
48
- super(line, line_no, exception: exception)
48
+ super(line, line_no, *args)
49
49
  end
50
50
 
51
51
  irb_context
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Break
4
- VERSION = "0.8.0"
4
+ VERSION = "0.9.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: break
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genadi Samokovarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-28 00:00:00.000000000 Z
11
+ date: 2020-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler