fluid_cli 0.1.3 → 0.1.4

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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -1
  3. data/exe/fluid +0 -3
  4. data/lib/fluid_cli/version.rb +1 -1
  5. data/lib/fluid_cli.rb +0 -1
  6. data/packaging/homebrew/fluid_cli.base.rb +0 -2
  7. metadata +1 -39
  8. data/vendor/deps/debug/CONTRIBUTING.md +0 -573
  9. data/vendor/deps/debug/Gemfile +0 -10
  10. data/vendor/deps/debug/LICENSE.txt +0 -22
  11. data/vendor/deps/debug/README.md +0 -996
  12. data/vendor/deps/debug/Rakefile +0 -57
  13. data/vendor/deps/debug/TODO.md +0 -23
  14. data/vendor/deps/debug/debug.gemspec +0 -33
  15. data/vendor/deps/debug/exe/rdbg +0 -53
  16. data/vendor/deps/debug/ext/debug/Makefile +0 -273
  17. data/vendor/deps/debug/ext/debug/debug.c +0 -228
  18. data/vendor/deps/debug/ext/debug/debug_version.h +0 -1
  19. data/vendor/deps/debug/ext/debug/extconf.rb +0 -27
  20. data/vendor/deps/debug/ext/debug/iseq_collector.c +0 -93
  21. data/vendor/deps/debug/lib/debug/abbrev_command.rb +0 -77
  22. data/vendor/deps/debug/lib/debug/breakpoint.rb +0 -556
  23. data/vendor/deps/debug/lib/debug/client.rb +0 -263
  24. data/vendor/deps/debug/lib/debug/color.rb +0 -123
  25. data/vendor/deps/debug/lib/debug/config.rb +0 -592
  26. data/vendor/deps/debug/lib/debug/console.rb +0 -224
  27. data/vendor/deps/debug/lib/debug/dap_custom/traceInspector.rb +0 -336
  28. data/vendor/deps/debug/lib/debug/debug.bundle +0 -0
  29. data/vendor/deps/debug/lib/debug/frame_info.rb +0 -190
  30. data/vendor/deps/debug/lib/debug/irb_integration.rb +0 -37
  31. data/vendor/deps/debug/lib/debug/local.rb +0 -115
  32. data/vendor/deps/debug/lib/debug/open.rb +0 -13
  33. data/vendor/deps/debug/lib/debug/open_nonstop.rb +0 -15
  34. data/vendor/deps/debug/lib/debug/prelude.rb +0 -50
  35. data/vendor/deps/debug/lib/debug/server.rb +0 -534
  36. data/vendor/deps/debug/lib/debug/server_cdp.rb +0 -1348
  37. data/vendor/deps/debug/lib/debug/server_dap.rb +0 -1108
  38. data/vendor/deps/debug/lib/debug/session.rb +0 -2667
  39. data/vendor/deps/debug/lib/debug/source_repository.rb +0 -150
  40. data/vendor/deps/debug/lib/debug/start.rb +0 -5
  41. data/vendor/deps/debug/lib/debug/thread_client.rb +0 -1457
  42. data/vendor/deps/debug/lib/debug/tracer.rb +0 -241
  43. data/vendor/deps/debug/lib/debug/version.rb +0 -5
  44. data/vendor/deps/debug/lib/debug.rb +0 -9
  45. data/vendor/deps/debug/misc/README.md.erb +0 -660
@@ -1,190 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module DEBUGGER__
4
- FrameInfo = Struct.new(:location, :self, :binding, :iseq, :class, :frame_depth,
5
- :has_return_value, :return_value,
6
- :has_raised_exception, :raised_exception,
7
- :show_line,
8
- :_local_variables, :_callee, # for recorder
9
- :dupped_binding,
10
- )
11
-
12
- # extend FrameInfo with debug.so
13
- begin
14
- require_relative 'debug.so'
15
- rescue LoadError
16
- require 'debug/debug.so'
17
- end
18
-
19
- class FrameInfo
20
- HOME = ENV['HOME'] ? (ENV['HOME'] + '/') : nil
21
-
22
- def path
23
- location.path
24
- end
25
-
26
- def realpath
27
- location.absolute_path
28
- end
29
-
30
- def self.pretty_path path
31
- return '#<none>' unless path
32
- use_short_path = CONFIG[:use_short_path]
33
-
34
- case
35
- when use_short_path && path.start_with?(dir = RbConfig::CONFIG["rubylibdir"] + '/')
36
- path.sub(dir, '$(rubylibdir)/')
37
- when use_short_path && Gem.path.any? do |gp|
38
- path.start_with?(dir = gp + '/gems/')
39
- end
40
- path.sub(dir, '$(Gem)/')
41
- when HOME && path.start_with?(HOME)
42
- path.sub(HOME, '~/')
43
- else
44
- path
45
- end
46
- end
47
-
48
- def pretty_path
49
- FrameInfo.pretty_path path
50
- end
51
-
52
- def name
53
- # p frame_type: frame_type, self: self
54
- case frame_type
55
- when :block
56
- level, block_loc = block_identifier
57
- "block in #{block_loc}#{level}"
58
- when :method
59
- method_identifier
60
- when :c
61
- c_identifier
62
- when :other
63
- other_identifier
64
- end
65
- end
66
-
67
- def file_lines
68
- SESSION.source(self.iseq)
69
- end
70
-
71
- def frame_type
72
- if self.local_variables && iseq
73
- if iseq.type == :block
74
- :block
75
- elsif callee
76
- :method
77
- else
78
- :other
79
- end
80
- else
81
- :c
82
- end
83
- end
84
-
85
- BLOCK_LABL_REGEXP = /\Ablock( \(\d+ levels\))* in (.+)\z/
86
-
87
- def block_identifier
88
- return unless frame_type == :block
89
- re_match = location.label.match(BLOCK_LABL_REGEXP)
90
- _, level, block_loc = re_match ? re_match.to_a : [nil, nil, location.label]
91
-
92
- [level || "", block_loc]
93
- end
94
-
95
- def method_identifier
96
- return unless frame_type == :method
97
- "#{klass_sig}#{callee}"
98
- end
99
-
100
- def c_identifier
101
- return unless frame_type == :c
102
- "[C] #{klass_sig}#{location.base_label}"
103
- end
104
-
105
- def other_identifier
106
- return unless frame_type == :other
107
- location.label
108
- end
109
-
110
- def callee
111
- self._callee ||= begin
112
- self.binding&.eval('__callee__')
113
- rescue NameError # BasicObject
114
- nil
115
- end
116
- end
117
-
118
- def return_str
119
- if self.binding && iseq && has_return_value
120
- DEBUGGER__.safe_inspect(return_value, short: true)
121
- end
122
- end
123
-
124
- def matchable_location
125
- # realpath can sometimes be nil so we can't use it here
126
- "#{path}:#{location.lineno}"
127
- end
128
-
129
- def location_str
130
- "#{pretty_path}:#{location.lineno}"
131
- end
132
-
133
- def eval_binding
134
- if b = self.dupped_binding
135
- b
136
- else
137
- b = self.binding || TOPLEVEL_BINDING
138
- self.dupped_binding = b.dup
139
- end
140
- end
141
-
142
- def local_variables
143
- if lvars = self._local_variables
144
- lvars
145
- elsif b = self.binding
146
- b.local_variables.map{|var|
147
- [var, b.local_variable_get(var)]
148
- }.to_h
149
- end
150
- end
151
-
152
- def iseq_parameters_info
153
- case frame_type
154
- when :block, :method
155
- parameters_info
156
- else
157
- nil
158
- end
159
- end
160
-
161
- def parameters_info
162
- vars = iseq.parameters_symbols
163
- vars.map{|var|
164
- begin
165
- { name: var, value: DEBUGGER__.safe_inspect(local_variable_get(var), short: true) }
166
- rescue NameError, TypeError
167
- nil
168
- end
169
- }.compact
170
- end
171
-
172
- private def get_singleton_class obj
173
- obj.singleton_class # TODO: don't use it
174
- rescue TypeError
175
- nil
176
- end
177
-
178
- private def local_variable_get var
179
- local_variables[var]
180
- end
181
-
182
- private def klass_sig
183
- if self.class == get_singleton_class(self.self)
184
- "#{self.self}."
185
- else
186
- "#{self.class}#"
187
- end
188
- end
189
- end
190
- end
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'irb'
4
-
5
- module DEBUGGER__
6
- module IrbPatch
7
- def evaluate(line, line_no)
8
- SESSION.send(:restart_all_threads)
9
- super
10
- # This is to communicate with the test framework so it can feed the next input
11
- puts "INTERNAL_INFO: {}" if ENV['RUBY_DEBUG_TEST_UI'] == 'terminal'
12
- ensure
13
- SESSION.send(:stop_all_threads)
14
- end
15
- end
16
-
17
- class ThreadClient
18
- def activate_irb_integration
19
- IRB.setup(location, argv: [])
20
- workspace = IRB::WorkSpace.new(current_frame&.binding || TOPLEVEL_BINDING)
21
- irb = IRB::Irb.new(workspace)
22
- IRB.conf[:MAIN_CONTEXT] = irb.context
23
- IRB::Debug.setup(irb)
24
- IRB::Context.prepend(IrbPatch)
25
- end
26
- end
27
-
28
- class Session
29
- def deactivate_irb_integration
30
- Reline.completion_proc = nil
31
- Reline.output_modifier_proc = nil
32
- Reline.autocompletion = false
33
- Reline.dig_perfect_match_proc = nil
34
- reset_ui UI_LocalConsole.new
35
- end
36
- end
37
- end
@@ -1,115 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'io/console/size'
4
- require_relative 'console'
5
-
6
- module DEBUGGER__
7
- class UI_LocalConsole < UI_Base
8
- def initialize
9
- @console = Console.new
10
- end
11
-
12
- def remote?
13
- false
14
- end
15
-
16
- def activate_sigint
17
- prev_handler = trap(:SIGINT){
18
- if SESSION.active?
19
- ThreadClient.current.on_trap :SIGINT
20
- end
21
- }
22
- SESSION.intercept_trap_sigint_start prev_handler
23
- end
24
-
25
- def deactivate_sigint
26
- if SESSION.intercept_trap_sigint?
27
- prev = SESSION.intercept_trap_sigint_end
28
- trap(:SIGINT, prev)
29
- end
30
- end
31
-
32
- def activate session, on_fork: false
33
- activate_sigint unless CONFIG[:no_sigint_hook]
34
- end
35
-
36
- def deactivate
37
- deactivate_sigint
38
- @console.deactivate
39
- end
40
-
41
- def width
42
- if (w = IO.console_size[1]) == 0 # for tests PTY
43
- 80
44
- else
45
- w
46
- end
47
- end
48
-
49
- def quit n
50
- yield
51
- exit n
52
- end
53
-
54
- def ask prompt
55
- setup_interrupt do
56
- print prompt
57
- ($stdin.gets || '').strip
58
- end
59
- end
60
-
61
- def puts str = nil
62
- case str
63
- when Array
64
- str.each{|line|
65
- $stdout.puts line.chomp
66
- }
67
- when String
68
- str.each_line{|line|
69
- $stdout.puts line.chomp
70
- }
71
- when nil
72
- $stdout.puts
73
- end
74
- end
75
-
76
- def readline prompt = '(rdbg)'
77
- setup_interrupt do
78
- (@console.readline(prompt) || 'quit').strip
79
- end
80
- end
81
-
82
- def setup_interrupt
83
- SESSION.intercept_trap_sigint false do
84
- current_thread = Thread.current # should be session_server thread
85
-
86
- prev_handler = trap(:INT){
87
- current_thread.raise Interrupt
88
- }
89
-
90
- yield
91
- ensure
92
- trap(:INT, prev_handler)
93
- end
94
- end
95
-
96
- def after_fork_parent
97
- parent_pid = Process.pid
98
-
99
- at_exit{
100
- SESSION.intercept_trap_sigint_end
101
- trap(:SIGINT, :IGNORE)
102
-
103
- if Process.pid == parent_pid
104
- # only check child process from its parent
105
- begin
106
- # wait for all child processes to keep terminal
107
- Process.waitpid
108
- rescue Errno::ESRCH, Errno::ECHILD
109
- end
110
- end
111
- }
112
- end
113
- end
114
- end
115
-
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
- #
3
- # Open the door for the debugger to connect.
4
- # Users can connect to debuggee program with "rdbg --attach" option.
5
- #
6
- # If RUBY_DEBUG_PORT envval is provided (digits), open TCP/IP port.
7
- # Otherwise, UNIX domain socket is used.
8
- #
9
-
10
- require_relative 'session'
11
- return unless defined?(DEBUGGER__)
12
-
13
- DEBUGGER__.open
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
- #
3
- # Open the door for the debugger to connect.
4
- # Unlike debug/open, it does not stop at the beginning of the program.
5
- # Users can connect to debuggee program with "rdbg --attach" option or
6
- # VSCode attach type.
7
- #
8
- # If RUBY_DEBUG_PORT envval is provided (digits), open TCP/IP port.
9
- # Otherwise, UNIX domain socket is used.
10
- #
11
-
12
- require_relative 'session'
13
- return unless defined?(DEBUGGER__)
14
-
15
- DEBUGGER__.open(nonstop: true)
@@ -1,50 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- return if ENV['RUBY_DEBUG_ENABLE'] == '0'
4
- return if defined?(::DEBUGGER__::Session)
5
-
6
- # Put the following line in your login script (e.g. ~/.bash_profile) with modified path:
7
- #
8
- # export RUBYOPT="-r /path/to/debug/prelude ${RUBYOPT}"
9
- #
10
- module Kernel
11
- def debugger(*a, up_level: 0, **kw)
12
- begin
13
- require_relative 'version'
14
- cur_version = ::DEBUGGER__::VERSION
15
- require_relative 'frame_info'
16
-
17
- if !defined?(::DEBUGGER__::SO_VERSION) || ::DEBUGGER__::VERSION != ::DEBUGGER__::SO_VERSION
18
- ::Object.send(:remove_const, :DEBUGGER__)
19
- raise LoadError
20
- end
21
- require_relative 'session'
22
- up_level += 1
23
- rescue LoadError
24
- $LOADED_FEATURES.delete_if{|e|
25
- e.start_with?(__dir__) || e.end_with?('debug/debug.so')
26
- }
27
- require 'debug/session'
28
- require 'debug/version'
29
- ::DEBUGGER__.info "Can not activate debug #{cur_version} specified by debug/prelude.rb. Activate debug #{DEBUGGER__::VERSION} instead."
30
- up_level += 1
31
- end
32
-
33
- ::DEBUGGER__::start no_sigint_hook: true, nonstop: true
34
-
35
- begin
36
- debugger(*a, up_level: up_level, **kw)
37
- self
38
- rescue ArgumentError # for 1.2.4 and earlier
39
- debugger(*a, **kw)
40
- self
41
- end
42
- end
43
-
44
- alias bb debugger if ENV['RUBY_DEBUG_BB']
45
- end
46
-
47
- class Binding
48
- alias break debugger
49
- alias b debugger
50
- end