fancy_irb 2.0.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 420f2bb457ec0eab47d8b118dc0579cc010060338406972fe53e9339411988ff
4
- data.tar.gz: 7a6adaf799dd94809ed4c8c998827983a2d7105a22b42449fc3f7ffdff6c2a05
3
+ metadata.gz: e83c9be5a7ebe03773a2d0bbfa6a7d8954f462540603008da7f5367587d29026
4
+ data.tar.gz: 87db76be462c8340edcfd7c1f2b71a5c002c88d7ca4e9e6091e4f268573f8368
5
5
  SHA512:
6
- metadata.gz: e61b4ad622dce35fccbfdb7f47beaa3aeed028d08aacbb051bb8d48b2a1140e1cc22686805fbab831968d09519947e0b9215686acc37fef495cb2d8ac8cc3b82
7
- data.tar.gz: 89a2464bb36c7385792f3cb7dc7e9a3336c81249c9f07b80060dbf9248abc85ad97a21d35a050679107dd53b0899d029796c650d979a328b037c33777d4ee279
6
+ metadata.gz: 764c7c723e2de02521781c151a357c94b2f8e6d2956a3ee3eb17e2751d3cc756f038278a28fa2f0fd0b7e6f67760e5bb2d4a078a59c7367d7af2b981a0b7c8d9
7
+ data.tar.gz: 0006710c8ec95a1ef58a3c75a4efbef00220c86e29829250e62d9b9cbbe263a894bc0a49e503ea5568e6d9e6326c5486df9e8412ba457efcc13c164cdaf2c8c1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.1.1
4
+ * Fix assignments (IRB ref: https://github.com/ruby/irb/commit/c5ea79d5cecea9cae6ad0c1f31703a98cd329431)
5
+
6
+ ## 2.1.0
7
+ * Refactor IRB extension to accommodate IRB 1.8.2
8
+
3
9
  ## 2.0.0
4
10
  * Fix core functionality for newer IRB
5
11
  * Require Ruby 3.x / IRB 1.7+
@@ -1,22 +1,12 @@
1
- module IRB
2
- class Irb
3
- def output_value
1
+ module FancyIrb
2
+ module IrbExtCommon
3
+ def output_value(_omit = false)
4
4
  FancyIrb.output_value(@context, @scanner)
5
5
  end
6
6
 
7
- alias prompt_non_fancy prompt
8
- def prompt(prompt_arg, ltype, indent, line_no)
9
- FancyIrb.handle_prompt(
10
- prompt_non_fancy(prompt_arg, ltype, indent, line_no),
11
- IRB.conf[:AUTO_INDENT] ? indent * 2 : 0
12
- # IRB.conf[:AUTO_INDENT] && IRB.conf[:PROMPT][IRB.conf[:PROMPT_MODE]][:PROMPT_C] == prompt_arg
13
- )
14
- end
15
-
16
- alias signal_status_non_fancy signal_status
17
7
  def signal_status(name, *args, &block)
18
8
  FancyIrb.reset_line!
19
- signal_status_non_fancy(name, *args, &block)
9
+ super(name, *args, &block)
20
10
  ensure
21
11
  if name == :IN_EVAL
22
12
  FancyIrb.present_and_clear_captured_error!
@@ -24,14 +14,48 @@ module IRB
24
14
  end
25
15
  end
26
16
 
27
- class Context
28
- alias evaluate_non_fancy evaluate
17
+ module IrbExtPrompt
18
+ private def format_prompt(format, ltype, indent, line_no)
19
+ FancyIrb.handle_prompt(
20
+ super(format, ltype, indent, line_no),
21
+ IRB.conf[:AUTO_INDENT] ? indent * 2 : 0
22
+ # IRB.conf[:AUTO_INDENT] && IRB.conf[:PROMPT][IRB.conf[:PROMPT_MODE]][:PROMPT_C] == format
23
+ )
24
+ end
25
+ end
29
26
 
27
+ module IrbExtPromptLegacy
28
+ def prompt(format, ltype, indent, line_no)
29
+ FancyIrb.handle_prompt(
30
+ super(format, ltype, indent, line_no),
31
+ IRB.conf[:AUTO_INDENT] ? indent * 2 : 0
32
+ # IRB.conf[:AUTO_INDENT] && IRB.conf[:PROMPT][IRB.conf[:PROMPT_MODE]][:PROMPT_C] == format
33
+ )
34
+ end
35
+ end
36
+
37
+ module ContextExt
30
38
  def evaluate(*args, **kwargs)
31
- evaluate_non_fancy(*args, **kwargs)
39
+ super(*args, **kwargs)
32
40
  rescue Exception
33
41
  FancyIrb.register_error_capturer!
34
42
  raise
35
43
  end
36
44
  end
37
45
  end
46
+
47
+ module IRB
48
+ class Irb
49
+ prepend FancyIrb::IrbExtCommon
50
+
51
+ if IRB::VERSION < "1.8.2"
52
+ prepend FancyIrb::IrbExtPromptLegacy
53
+ else
54
+ prepend FancyIrb::IrbExtPrompt
55
+ end
56
+ end
57
+
58
+ class Context
59
+ prepend FancyIrb::ContextExt
60
+ end
61
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FancyIrb
4
- VERSION = '2.0.0'
4
+ VERSION = '2.1.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fancy_irb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-07 00:00:00.000000000 Z
11
+ date: 2023-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paint
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubygems_version: 3.4.4
143
+ rubygems_version: 3.4.21
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: Colors and rockets in IRB