pry-moves 1.0.13 → 1.0.14

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: 54b617db559dc0394f447095883171d67be49bbddd46bffb6d65206efd6a7d4b
4
- data.tar.gz: aff84108e38f6be7e651ac0363f83046af91b287856773a8e5944b1d45e218f1
3
+ metadata.gz: 82685576fb9e632b60556d82f67459719b6e202008915e8220c84cbbacd4f65d
4
+ data.tar.gz: 5d0025eb1080c6c4e22510b4996116318eafca80720991274980f32c15bfe9f5
5
5
  SHA512:
6
- metadata.gz: 97c48fd3a44a337062e934de38faa1bce273f29ef81d6e7d3a957f38318deb1c512bc816ba1d12ab0b2c24893fd3c61453b4cf7b0f718b0bd198ff1e304f55bb
7
- data.tar.gz: 2de12cf6e43a8f6e488acec5db74b8745b2b7ef27c6c3b526e6835ea5b89c2f013a1f180202056c401ac147878038d103ea62d81b0fbb3b4a0d3c85486c9db46
6
+ metadata.gz: 79b6cbe65d7eec6a06211941082925439555d84538979ee838457ac67f0e057227e88919c9f99ddb6570a5c8e07083b4e39a47055786804d198b5316b1436fd5
7
+ data.tar.gz: ad42f69cde5275f2f533900ec878765f03fe3c57019e5fafd391088324802fd66ba2b61364d0990b8ae5bfbc6b7aaa7c9bec79600577f8a86ec859ecc6faa361
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pry-moves (1.0.12)
4
+ pry-moves (1.0.13)
5
5
  awesome_print (>= 1.8.0)
6
6
  binding_of_caller (~> 0.7)
7
7
  colorize (~> 0.8)
@@ -16,7 +16,7 @@ GEM
16
16
  debug_inspector (>= 0.0.1)
17
17
  coderay (1.1.2)
18
18
  colorize (0.8.1)
19
- debug_inspector (1.2.0)
19
+ debug_inspector (1.1.0)
20
20
  diff-lcs (1.3)
21
21
  diffy (3.4.2)
22
22
  method_source (0.9.0)
@@ -84,14 +84,17 @@ Pry::Command::Whereami.class_eval do
84
84
  def build_output
85
85
  lines = ['']
86
86
 
87
- formatter = PryMoves::Formatter.new
88
- prefix = Thread.current[:pry_moves_debug] ? "👾 " : ""
89
- # lines << "🍱 #{PryMoves.test_example}" if PryMoves.test_example
90
- lines << "🦆 step_in_everywhere" if PryMoves.step_in_everywhere
91
- lines << "#{prefix}#{formatter.shorten_path location}:#{@line} #{me}"
92
- lines << " ." + formatter.method_signature(target)
93
- lines << ''
94
- lines << "#{code.with_line_numbers(use_line_numbers?).with_marker(marker).highlighted}"
87
+ unless PryMoves.hide_code
88
+ formatter = PryMoves::Formatter.new
89
+ prefix = Thread.current[:pry_moves_debug] ? "👾 " : ""
90
+ # lines << "🍱 #{PryMoves.test_example}" if PryMoves.test_example
91
+ lines << "🦆 step_in_everywhere" if PryMoves.step_in_everywhere
92
+ lines << "#{prefix}#{formatter.shorten_path location}:#{@line} #{me}"
93
+ lines << " ." + formatter.method_signature(target)
94
+ lines << ''
95
+ lines << "#{code.with_line_numbers(use_line_numbers?).with_marker(marker).highlighted}"
96
+ end
97
+ PryMoves.hide_code = false
95
98
 
96
99
  lines << PryMoves::Watch.instance.output(target) unless PryMoves::Watch.instance.empty?
97
100
  lines.concat(PryMoves.messages.map do |message|
@@ -1,3 +1,3 @@
1
1
  module PryMoves
2
- VERSION = '1.0.13'
2
+ VERSION = '1.0.14'
3
3
  end
data/lib/pry-moves.rb CHANGED
@@ -9,7 +9,7 @@ module PryMoves
9
9
  attr_accessor :is_open, :trace, :stack_tips,
10
10
  :stop_on_breakpoints, :dont_print_errors,
11
11
  :test_example, :launched_specs_examples,
12
- :debug_called_times, :step_in_everywhere
12
+ :debug_called_times, :step_in_everywhere, :hide_code
13
13
 
14
14
  def loop
15
15
  Kernel.loop do
@@ -84,7 +84,7 @@ module PryMoves
84
84
  self.step_in_everywhere = false
85
85
  end
86
86
 
87
- def debug(message = nil, data: nil, at: nil, from: nil, options: nil)
87
+ def debug(message = nil, data: nil, at: nil, from: nil, options: {})
88
88
  pry_moves_stack_end = true
89
89
  message ||= data
90
90
  PryMoves.re_execution
@@ -95,6 +95,7 @@ module PryMoves
95
95
  if message
96
96
  PryMoves.messages << format_debug_object(message)
97
97
  end
98
+ self.hide_code = true if data
98
99
  binding.pry options
99
100
  PryMoves.re_execution
100
101
  end
@@ -214,9 +215,15 @@ module PryMoves
214
215
  end
215
216
  end
216
217
 
218
+ # Alos: PryMoves.on(each_new_run: [:skip_on_init])
217
219
  TRIGGERS = [:each_new_run, :restart, :after_debug]
218
220
  def on(trigger, &block)
219
221
  error "Invalid trigger, possible triggers: #{TRIGGERS}", trigger unless TRIGGERS.include? trigger
222
+ if trigger.is_a? Hash
223
+ skip_on_init = trigger.values.first.include? :skip_on_init
224
+ trigger = trigger.keys.first
225
+ end
226
+ block.call if trigger == :each_new_run and !skip_on_init
220
227
  triggers[trigger] << block
221
228
  end
222
229
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-moves
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.13
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - garmoshka-mo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-09 00:00:00.000000000 Z
11
+ date: 2025-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry