irb 1.13.2 → 1.14.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/irb/ruby_logo.aa CHANGED
@@ -1,41 +1,41 @@
1
- TYPE: LARGE
1
+ TYPE: ASCII_LARGE
2
2
 
3
- -+smJYYN?mm-
4
- HB"BBYT TQg NggT
5
- 9Q+g Nm,T 8g NJW
6
- YS+ N2NJ"Sg N?
7
- BQg #( gT Nggggk J
8
- 5j NJ NJ NNge
9
- #Q #JJ NgT N(
10
- @j bj mT J
11
- Bj @/d NJ (
12
- #q #(( NgT #J
13
- 5d #(t mT $d
14
- #q @(@J NJB;
15
- @( 5d ? HHH H HQmgggggggmN qD
16
- 5d #uN 2QdH E O
17
- 5 5JSd Nd NJH @d j
18
- Fd @J4d s NQH #d (
19
- #( #o6d Nd NgH #d #d
20
- 4 B&Od v NgT #d F
21
- #( 9JGd NH NgUd F
22
- #d #GJQ d NP $
23
- #J #U+#Q N Q # j
24
- j /W BQ+ BQ d NJ NJ
25
- - NjJH HBIjTQggPJQgW N W k #J
26
- #J b HYWgggN j s Nag d NN b #d
27
- #J 5- D s Ngg N d Nd F
28
- Fd BKH2 #+ s NNgg J Q J ]
29
- F H @ J N y K(d P I
30
- F4 E N? #d y #Q NJ E j
31
- F W Nd q m Bg NxW N(H-
32
- F d b @ m Hd gW vKJ
33
- NJ d K d s Bg aT FDd
34
- b # d N m BQ mV N>
35
- e5 Nd #d NggggggQWH HHHH NJ -
36
- m7 NW H N HSVO1z=?11-
37
- NgTH bB kH WBHWWHBHWmQgg&gggggNNN
38
- NNggggggNN
3
+ ,,,;;;;;;;;;;;;;;;;;;;;;;,,
4
+ ,,,;;;;;;;;;,, ,;;;' ''';;,
5
+ ,,;;;''' ';;;, ,,;;'' '';,
6
+ ,;;'' ;;;;;;;;,,,,,, ';;
7
+ ,;;'' ;;;;';;;'''';;;;;;;;;,,,;;
8
+ ,,;'' ;;;; ';;, ''''';;,
9
+ ,;;' ;;;' ';;, ;;
10
+ ,;;' ,;;; '';,, ;;
11
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;;;''''';;;'';,
41
41
  ,,;'' ';;,;;; ',
@@ -57,6 +57,44 @@ TYPE: ASCII
57
57
  ;;; '; ;' ';,,'' ';,;;
58
58
  '; ';,; ,,;''''''''';;;;;;,,;;;
59
59
  ';,,;;,,;;;;;;;;;;''''''''''''''
60
+ TYPE: UNICODE_LARGE
61
+
62
+ ⣀⣤⣴⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣤⣄⡀
63
+ ⢀⣀⣤⣴⣾⣿⣿⣿⠿⣿⣿⣿⣿⣦⣀ ⢀⣤⣶⣿⠿⠛⠁⠈⠉⠙⠻⢿⣷⣦⡀
64
+ ⢀⣠⣴⣾⡿⠿⠛⠉⠉ ⠈⠙⢿⣿⣷⣤⡀ ⣠⣴⣾⡿⠟⠉ ⠉⠻⣿⣦
65
+ ⢀⣤⣶⣿⠟⠋⠁ ⢿⣿⣿⣿⣿⣿⣿⣧⣤⣤⣤⣀⣀⣀⡀ ⠘⢿⣷⡀
66
+ ⢀⣠⣾⡿⠟⠉ ⢸⣿⣿⣿⠟⢿⣿⣯⡙⠛⠛⠛⠿⠿⠿⢿⣿⣿⣶⣶⣶⣦⣤⣬⣿⣧
67
+ ⣠⣴⣿⠟⠋ ⢸⣿⣿⡿ ⠈⠻⣿⣶⣄ ⠉⠉⠉⠙⠛⢻⣿⡆
68
+ ⣠⣾⡿⠛⠁ ⣼⣿⣿⠃ ⠈⠙⢿⣷⣤⡀ ⠈⣿⡇
69
+ ⣠⣾⡿⠋ ⢠⣿⣿⡏ ⠙⠻⣿⣦⣀ ⣿⡇
70
+ ⣠⣾⡿⠋ ⢀⣿⣿⣿ ⠈⠛⢿⣷⣄⡀ ⢠⣿⡇
71
+ ⢀⣾⡿⠋ ⢀⣾⣿⣿⠇ ⠙⠻⣿⣦⣀ ⢸⣿⡇
72
+ ⢀⣴⣿⠟⠁ ⢀⣾⣿⣿⡟ ⠈⠻⢿⣷⣄ ⣾⣿⠇
73
+ ⢠⣾⡿⠃ ⣠⣿⣿⣿⣿⠃ ⣀⣀⣀⣀⣀⣀⣀⣀⣤⣤⣤⣤⣽⣿⣿⣿⣿
74
+ ⣰⣿⠟ ⣴⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠿⠿⠿⠿⠿⠿⠿⠛⠛⠛⠛⠛⠛⠛⠛⣿⣿⣿
75
+ ⣼⣿⠏ ⢠⣾⣿⣿⣿⡿⣿⣿⢿⣷⣦⣄ ⣼⣿⣿⣿
76
+ ⣼⣿⠃ ⢀⣴⣿⣿⣿⠟⠋ ⢸⣿⡆⠈⠛⠿⣿⣦⣄⡀ ⣰⣿⣿⣿⡇
77
+ ⢀⣾⣿⠃ ⢀⣴⣿⣿⣿⠟⠁ ⣿⣷ ⠈⠙⠻⣿⣶⣄⡀ ⣰⣿⠟⣿⣿⡇
78
+ ⢀⣾⣿⠇ ⢀⣴⣿⣿⣿⠟⠁ ⢸⣿⡆ ⠙⠻⢿⣷⣤⣀ ⣰⣿⠏⢠⣿⣿⡇
79
+ ⢠⣿⣿⡟ ⢀⣴⣿⣿⡿⠛⠁ ⣿⣷ ⠉⠻⢿⣷⣦⣀ ⣴⣿⠏ ⢸⣿⣿⠃
80
+ ⣿⣿⣿⡇ ⣠⣴⣿⣿⡿⠋ ⢸⣿⡆ ⠈⠛⢿⣿⣿⠃ ⢸⣿⣿
81
+ ⢠⣿⣿⣿ ⢀⣴⣾⣿⣿⡿⠋ ⠈⣿⣧ ⢠⣾⣿⣿ ⢸⣿⣿
82
+ ⢸⣿⣿⣿⡇ ⣀⣴⣾⣿⣿⣿⡿⠋ ⢹⣿⡆ ⣴⣿⠟⢹⣿⡀ ⢸⣿⡿
83
+ ⢸⣿⡟⣿⣿⣄ ⣀⣤⣶⣿⣿⣿⣿⣿⡟⠉ ⠈⣿⣷ ⢠⣾⡿⠋ ⢸⣿⡇ ⣼⣿⡇
84
+ ⢸⣿⡇⢹⣿⣿⣷⣦⣤⣤⣤⣤⣤⣴⣶⣾⣿⣿⣿⣿⡿⠿⣿⣿⣿⣿⣷⣶⣤⣤⣀⡀ ⢹⣿⡆ ⢀⣴⣿⠟ ⣿⣧ ⣿⣿⡇
85
+ ⢸⣿⠃ ⢿⣿⣿⣿⣿⣿⣿⡿⠿⠿⠛⠛⠉⠉⠁ ⢰⣿⠟⣿⣷⡀⠉⠙⠛⠿⢿⣿⣶⣦⣤⣀⡀ ⠈⣿⣷ ⣠⣿⡿⠁ ⢿⣿ ⣿⣿⡇
86
+ ⢸⣿ ⢀⣾⣿⣿⠋⠉⠁ ⢀⣿⡿ ⠘⣿⣷⡀ ⠉⠙⠛⠿⠿⣿⣶⣦⣤⣄⣀ ⢹⣿⡄ ⣠⣾⡿⠋ ⢸⣿⡆ ⣿⣿
87
+ ⣸⣿⢀⣾⣿⣿⣿⣆ ⣸⣿⠃ ⠘⢿⣷⡀ ⠈⠉⠛⠻⠿⣿⣷⣶⣤⣌⣿⣷⣾⡿⠋ ⠘⣿⡇ ⣿⣿
88
+ ⣿⣿⣾⡿⣿⡿⠹⣿⡆ ⢠⣿⡏ ⠈⢿⣷⡀ ⠈⠉⠙⣻⣿⣿⣿⣀ ⣿⣷⢰⣿⣿
89
+ ⣿⣿⡿⢁⣿⡇ ⢻⣿⡄ ⣾⣿ ⠈⢿⣷⡀ ⢀⣤⣾⡿⠋⠈⠻⢿⣷⣄ ⢻⣿⢸⣿⡟
90
+ ⣿⣿⠁⢸⣿⡇ ⢻⣿⡄ ⢸⣿⠇ ⠈⢿⣷⡀ ⣀⣴⣿⠟⠋ ⠙⢿⣷⣤⡀ ⢸⣿⣿⣿⡇
91
+ ⣿⣿ ⢸⣿⠁ ⠈⢿⣷⡀ ⢀⣿⡟ ⠈⢿⣷⡀ ⢀⣤⣾⡿⠛⠁ ⠙⠻⣿⣦⡀ ⠈⣿⣿⣿⡇
92
+ ⢸⣿⡄⣿⣿ ⠈⣿⣷⡀ ⣼⣿⠃ ⠈⢿⣷⡀ ⢀⣠⣶⣿⠟⠋ ⠈⠻⣿⣦⣄ ⣿⣿⣿⠇
93
+ ⠈⣿⣷⣿⡿ ⠘⣿⣧ ⢠⣿⡏ ⠈⢿⣷⣄⣤⣶⣿⠟⠋ ⠈⠛⢿⣷⣄ ⢸⣿⣿
94
+ ⠘⣿⣿⡇ ⠘⣿⣧ ⣾⣿ ⢀⣠⣼⣿⣿⣿⣿⣿⣷⣶⣶⣶⣶⣶⣶⣤⣤⣤⣤⣤⣤⣀⣀⣀⣀⣀⣀⡀ ⠙⢿⣷⣼⣿⣿
95
+ ⠈⠻⣿⣦⡀ ⠹⣿⣆⢸⣿⠇ ⣀⣠⣴⣾⡿⠟⠋⠁ ⠉⠉⠉⠉⠉⠉⠛⠛⣛⣛⣛⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⡿
96
+ ⠈⠻⢿⣷⣦⣄⣀⡀ ⢹⣿⣿⡟ ⢀⣀⣀⣤⣤⣶⣾⣿⣿⣿⣯⣥⣤⣤⣤⣤⣶⣶⣶⣶⣶⣶⣶⣾⣿⣿⣿⣿⠿⠿⠿⠿⠿⠿⠿⠟⠛⠛⠛⠛⠛⠛⠛⠉⠉⠉⠉⠉⠉
97
+ ⠉⠙⠛⠿⠿⠿⣿⣿⣿⣿⠿⠿⠿⠿⠿⠿⠿⠛⠛⠛⠛⠛⠛⠛⠋⠉⠉⠉⠉⠉⠉⠉
60
98
  TYPE: UNICODE
61
99
  ⣀⣤⣴⣾⣿⣿⣿⡛⠛⠛⠛⠛⣻⣿⠿⠛⠛⠶⣤⡀
62
100
  ⣀⣴⠾⠛⠉⠁ ⠙⣿⣶⣤⣶⣟⣉ ⠈⠻⣦
@@ -100,7 +100,7 @@ module IRB
100
100
  Source.new(file, line)
101
101
  elsif method
102
102
  # Method defined with eval, probably in IRB session
103
- source = RubyVM::AbstractSyntaxTree.of(method)&.source rescue nil
103
+ source = RubyVM::InstructionSequence.of(method)&.script_lines&.join rescue nil
104
104
  Source.new(file, line, source)
105
105
  end
106
106
  rescue EvaluationError
data/lib/irb/statement.rb CHANGED
@@ -68,7 +68,7 @@ module IRB
68
68
  end
69
69
 
70
70
  def suppresses_echo?
71
- false
71
+ true
72
72
  end
73
73
 
74
74
  def should_be_handled_by_debugger?
data/lib/irb/version.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  #
6
6
 
7
7
  module IRB # :nodoc:
8
- VERSION = "1.13.2"
8
+ VERSION = "1.14.1"
9
9
  @RELEASE_VERSION = VERSION
10
- @LAST_UPDATE_DATE = "2024-06-15"
10
+ @LAST_UPDATE_DATE = "2024-09-25"
11
11
  end
data/lib/irb/workspace.rb CHANGED
@@ -176,11 +176,13 @@ EOF
176
176
  end
177
177
 
178
178
  module HelpersContainer
179
- def self.install_helper_methods
180
- HelperMethod.helper_methods.each do |name, helper_method_class|
181
- define_method name do |*args, **opts, &block|
182
- helper_method_class.instance.execute(*args, **opts, &block)
183
- end unless method_defined?(name)
179
+ class << self
180
+ def install_helper_methods
181
+ HelperMethod.helper_methods.each do |name, helper_method_class|
182
+ define_method name do |*args, **opts, &block|
183
+ helper_method_class.instance.execute(*args, **opts, &block)
184
+ end unless method_defined?(name)
185
+ end
184
186
  end
185
187
  end
186
188
 
data/lib/irb.rb CHANGED
@@ -880,40 +880,42 @@ module IRB
880
880
  # An exception raised by IRB.irb_abort
881
881
  class Abort < Exception;end
882
882
 
883
- # The current IRB::Context of the session, see IRB.conf
884
- #
885
- # irb
886
- # irb(main):001:0> IRB.CurrentContext.irb_name = "foo"
887
- # foo(main):002:0> IRB.conf[:MAIN_CONTEXT].irb_name #=> "foo"
888
- def IRB.CurrentContext # :nodoc:
889
- IRB.conf[:MAIN_CONTEXT]
890
- end
883
+ class << self
884
+ # The current IRB::Context of the session, see IRB.conf
885
+ #
886
+ # irb
887
+ # irb(main):001:0> IRB.CurrentContext.irb_name = "foo"
888
+ # foo(main):002:0> IRB.conf[:MAIN_CONTEXT].irb_name #=> "foo"
889
+ def CurrentContext # :nodoc:
890
+ conf[:MAIN_CONTEXT]
891
+ end
891
892
 
892
- # Initializes IRB and creates a new Irb.irb object at the `TOPLEVEL_BINDING`
893
- def IRB.start(ap_path = nil)
894
- STDOUT.sync = true
895
- $0 = File::basename(ap_path, ".rb") if ap_path
893
+ # Initializes IRB and creates a new Irb.irb object at the `TOPLEVEL_BINDING`
894
+ def start(ap_path = nil)
895
+ STDOUT.sync = true
896
+ $0 = File::basename(ap_path, ".rb") if ap_path
896
897
 
897
- IRB.setup(ap_path)
898
+ setup(ap_path)
898
899
 
899
- if @CONF[:SCRIPT]
900
- irb = Irb.new(nil, @CONF[:SCRIPT])
901
- else
902
- irb = Irb.new
900
+ if @CONF[:SCRIPT]
901
+ irb = Irb.new(nil, @CONF[:SCRIPT])
902
+ else
903
+ irb = Irb.new
904
+ end
905
+ irb.run(@CONF)
903
906
  end
904
- irb.run(@CONF)
905
- end
906
907
 
907
- # Quits irb
908
- def IRB.irb_exit(*) # :nodoc:
909
- throw :IRB_EXIT, false
910
- end
908
+ # Quits irb
909
+ def irb_exit(*) # :nodoc:
910
+ throw :IRB_EXIT, false
911
+ end
911
912
 
912
- # Aborts then interrupts irb.
913
- #
914
- # Will raise an Abort exception, or the given `exception`.
915
- def IRB.irb_abort(irb, exception = Abort) # :nodoc:
916
- irb.context.thread.raise exception, "abort then interrupt!"
913
+ # Aborts then interrupts irb.
914
+ #
915
+ # Will raise an Abort exception, or the given `exception`.
916
+ def irb_abort(irb, exception = Abort) # :nodoc:
917
+ irb.context.thread.raise exception, "abort then interrupt!"
918
+ end
917
919
  end
918
920
 
919
921
  class Irb
@@ -1129,7 +1131,7 @@ module IRB
1129
1131
  end
1130
1132
 
1131
1133
  code.force_encoding(@context.io.encoding)
1132
- if (command, arg = parse_command(code))
1134
+ if (command, arg = @context.parse_command(code))
1133
1135
  command_class = Command.load_command(command)
1134
1136
  Statement::Command.new(code, command_class, arg)
1135
1137
  else
@@ -1138,27 +1140,8 @@ module IRB
1138
1140
  end
1139
1141
  end
1140
1142
 
1141
- def parse_command(code)
1142
- command_name, arg = code.strip.split(/\s+/, 2)
1143
- return unless code.lines.size == 1 && command_name
1144
-
1145
- arg ||= ''
1146
- command = command_name.to_sym
1147
- # Command aliases are always command. example: $, @
1148
- if (alias_name = @context.command_aliases[command])
1149
- return [alias_name, arg]
1150
- end
1151
-
1152
- # Check visibility
1153
- public_method = !!Kernel.instance_method(:public_method).bind_call(@context.main, command) rescue false
1154
- private_method = !public_method && !!Kernel.instance_method(:method).bind_call(@context.main, command) rescue false
1155
- if Command.execute_as_command?(command, public_method: public_method, private_method: private_method)
1156
- [command, arg]
1157
- end
1158
- end
1159
-
1160
1143
  def command?(code)
1161
- !!parse_command(code)
1144
+ !!@context.parse_command(code)
1162
1145
  end
1163
1146
 
1164
1147
  def configure_io
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.2
4
+ version: 1.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - aycabta
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-06-15 00:00:00.000000000 Z
12
+ date: 2024-09-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: reline
@@ -68,6 +68,7 @@ files:
68
68
  - lib/irb/command/base.rb
69
69
  - lib/irb/command/break.rb
70
70
  - lib/irb/command/catch.rb
71
+ - lib/irb/command/cd.rb
71
72
  - lib/irb/command/chws.rb
72
73
  - lib/irb/command/context.rb
73
74
  - lib/irb/command/continue.rb