irb 1.3.8.pre.8 → 1.3.8.pre.9

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: 7ed4a45cab62de9a8ac9717098e2d0bc128de0a655108ebf750a955766a21090
4
- data.tar.gz: c81a0bd1f1b05d40d3497920658abb9dae24ddceb6b41afac425eb426f43ef34
3
+ metadata.gz: dc37bc2cdd7bf77d09704fb22c31aec464fc7aa391f2bc6a6619d8549bd0cd5d
4
+ data.tar.gz: 20b8157c7167ccf5b30fef3d4b8340c3d1a316a59c742c968d0e62e0bd5010d7
5
5
  SHA512:
6
- metadata.gz: 31a8eca68eec86d0f056824f30b0e788c64ca381cb79ee503c0bdd3bd44cc9a0502ce2d00a3dabc53d45b861243fd592293928cca05ae1919ccf89bcc8e4110b
7
- data.tar.gz: a03bc92766aeb696c03d6a33113564f2649799323b1eceb6526d4abf32b0c38921aba3c1876a51c84533b3e98a2d19729354208760275f80e7169e21d651bcd1
6
+ metadata.gz: 9783aa13399d0eddb2e67cf3aa51760cfde1cc76f7b59d78158e83746359511e46824034d29f07181ffc91a51901bb6202562b8eab950649c0082f58295809d0
7
+ data.tar.gz: f2a27869c90d81a93497515c38da52c0e19c113a308c95c264b863fb8edc9e1f96f558343bbe4bfe47b6a527ce4eaa98757380b700626d9f445f12b994b296d2
data/irb.gemspec CHANGED
@@ -36,5 +36,5 @@ Gem::Specification.new do |spec|
36
36
 
37
37
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5")
38
38
 
39
- spec.add_dependency "reline", ">= 0.2.8.pre.8"
39
+ spec.add_dependency "reline", ">= 0.2.8.pre.9"
40
40
  end
@@ -38,16 +38,44 @@ module IRB
38
38
 
39
39
  BASIC_WORD_BREAK_CHARACTERS = " \t\n`><=;|&{("
40
40
 
41
+ def self.absolute_path?(p) # TODO Remove this method after 2.6 EOL.
42
+ if File.respond_to?(:absolute_path?)
43
+ File.absolute_path?(p)
44
+ else
45
+ if File.absolute_path(p) == p
46
+ true
47
+ else
48
+ false
49
+ end
50
+ end
51
+ end
52
+
53
+ def self.retrieve_gem_and_system_load_path
54
+ gem_paths = Gem::Specification.latest_specs(true).map { |s|
55
+ s.require_paths.map { |p|
56
+ if absolute_path?(p)
57
+ p
58
+ else
59
+ File.join(s.full_gem_path, p)
60
+ end
61
+ }
62
+ }.flatten
63
+ (gem_paths + $LOAD_PATH).uniq.sort
64
+ end
65
+
41
66
  def self.retrieve_files_to_require_from_load_path
42
- @@files_from_load_path ||= $LOAD_PATH.flat_map { |path|
67
+ @@files_from_load_path ||= retrieve_gem_and_system_load_path.map { |path|
43
68
  begin
44
69
  Dir.glob("**/*.{rb,#{RbConfig::CONFIG['DLEXT']}}", base: path)
45
70
  rescue Errno::ENOENT
46
71
  []
47
72
  end
48
- }.uniq.map { |path|
49
- path.sub(/\.(rb|#{RbConfig::CONFIG['DLEXT']})\z/, '')
50
- }
73
+ }.inject([]) { |result, names|
74
+ shortest, *rest = names.map{ |n| n.sub(/\.(rb|#{RbConfig::CONFIG['DLEXT']})\z/, '') }.sort
75
+ result.unshift(shortest) if shortest
76
+ result.concat(rest)
77
+ result
78
+ }.uniq
51
79
  end
52
80
 
53
81
  def self.retrieve_files_to_require_relative_from_current_dir
data/lib/irb/ruby-lex.rb CHANGED
@@ -708,6 +708,9 @@ class RubyLex
708
708
  while i < tokens.size
709
709
  t = tokens[i]
710
710
  case t[1]
711
+ when *end_type.last
712
+ start_token.pop
713
+ end_type.pop
711
714
  when :on_tstring_beg
712
715
  start_token << t
713
716
  end_type << [:on_tstring_end, :on_label_end]
@@ -715,10 +718,14 @@ class RubyLex
715
718
  start_token << t
716
719
  end_type << :on_regexp_end
717
720
  when :on_symbeg
718
- acceptable_single_tokens = %i{on_ident on_const on_op on_cvar on_ivar on_gvar on_kw on_int}
719
- if (i + 1) < tokens.size and acceptable_single_tokens.all?{ |st| tokens[i + 1][1] != st }
720
- start_token << t
721
- end_type << :on_tstring_end
721
+ acceptable_single_tokens = %i{on_ident on_const on_op on_cvar on_ivar on_gvar on_kw on_int on_backtick}
722
+ if (i + 1) < tokens.size
723
+ if acceptable_single_tokens.all?{ |st| tokens[i + 1][1] != st }
724
+ start_token << t
725
+ end_type << :on_tstring_end
726
+ else
727
+ i += 1
728
+ end
722
729
  end
723
730
  when :on_backtick
724
731
  start_token << t
@@ -729,9 +736,6 @@ class RubyLex
729
736
  when :on_heredoc_beg
730
737
  start_token << t
731
738
  end_type << :on_heredoc_end
732
- when *end_type.last
733
- start_token.pop
734
- end_type.pop
735
739
  end
736
740
  i += 1
737
741
  end
data/lib/irb/version.rb CHANGED
@@ -11,7 +11,7 @@
11
11
  #
12
12
 
13
13
  module IRB # :nodoc:
14
- VERSION = "1.3.8.pre.8"
14
+ VERSION = "1.3.8.pre.9"
15
15
  @RELEASE_VERSION = VERSION
16
- @LAST_UPDATE_DATE = "2021-09-06"
16
+ @LAST_UPDATE_DATE = "2021-09-10"
17
17
  end
data/lib/irb/workspace.rb CHANGED
@@ -12,6 +12,7 @@
12
12
 
13
13
  require "delegate"
14
14
 
15
+ IRB::TOPLEVEL_BINDING = binding
15
16
  module IRB # :nodoc:
16
17
  class WorkSpace
17
18
  # Creates a new workspace.
@@ -57,6 +58,8 @@ EOF
57
58
  __FILE__,
58
59
  __LINE__ - 3)
59
60
  when 4 # binding is a copy of TOPLEVEL_BINDING (default)
61
+ # Note that this will typically be IRB::TOPLEVEL_BINDING
62
+ # This is to avoid RubyGems' local variables (see issue #17623)
60
63
  @binding = TOPLEVEL_BINDING.dup
61
64
  end
62
65
  end
data/lib/irb.rb CHANGED
@@ -669,6 +669,8 @@ module IRB
669
669
  lines = lines.reverse if order == :bottom
670
670
  lines.map{ |l| l + "\n" }.join
671
671
  }
672
+ # The "<top (required)>" in "(irb)" may be the top level of IRB so imitate the main object.
673
+ message = message.gsub(/\(irb\):(?<num>\d+):in `<(?<frame>top \(required\))>'/) { "(irb):#{$~[:num]}:in `<main>'" }
672
674
  puts message
673
675
  end
674
676
  print "Maybe IRB bug!\n" if irb_bug
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.8.pre.8
4
+ version: 1.3.8.pre.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keiju ISHITSUKA
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-06 00:00:00.000000000 Z
11
+ date: 2021-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reline
15
+ prerelease: false
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
18
  - - ">="
18
19
  - !ruby/object:Gem::Version
19
- version: 0.2.8.pre.8
20
+ version: 0.2.8.pre.9
20
21
  type: :runtime
21
- prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.8.pre.8
26
+ version: 0.2.8.pre.9
27
27
  description: Interactive Ruby command-line tool for REPL (Read Eval Print Loop).
28
28
  email:
29
29
  - keiju@ruby-lang.org
@@ -97,7 +97,7 @@ licenses:
97
97
  - Ruby
98
98
  - BSD-2-Clause
99
99
  metadata: {}
100
- post_install_message:
100
+ post_install_message:
101
101
  rdoc_options: []
102
102
  require_paths:
103
103
  - lib
@@ -112,8 +112,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  - !ruby/object:Gem::Version
113
113
  version: 1.3.1
114
114
  requirements: []
115
- rubygems_version: 3.2.22
116
- signing_key:
115
+ rubygems_version: 3.1.4
116
+ signing_key:
117
117
  specification_version: 4
118
118
  summary: Interactive Ruby command-line tool for REPL (Read Eval Print Loop).
119
119
  test_files: []