irb 1.3.8.pre.2 → 1.3.8.pre.6

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: 6917cc502c36eee80046354a84e97d8584ab167edc657871f04c7f7a70491601
4
- data.tar.gz: 3dedb3a1d6fab3a6cafd09a033ae76f6bbf982e18a886390dbb90b1c91d12180
3
+ metadata.gz: 06b92bc1578697f4b6e2b861b6c30acd6fa0c90abe522d32c61b50575564e3d2
4
+ data.tar.gz: 3723d32bd956638ace71443964cd4d7658874bdb4332d9384be27785668ff787
5
5
  SHA512:
6
- metadata.gz: 6a273f5107f23d828fdf485c5c58b110f6e066f3b020dacf5e7c7d8d751eb57e4e573f4026eb7be0494125d6a2665e1a1a13c53400ac50358645cfcec34e49f5
7
- data.tar.gz: d7f30a0664d8adec1656348706c02b8ceca27194a01f6de760b9f39c051e98eccb1891bd84cf3add8dbef7575023c877b47f9301274e80af6a776f83e77071ee
6
+ metadata.gz: 9eb5a314af921a15b7bb04812f83d90ddbf7bb8bbd22ec2ef8591bd796d12999d4921df8eaf7076bd7d721ce0998c9c3ddbafcdc1e732e009244812694d8703f
7
+ data.tar.gz: 7772cb563cdbfd9b13e69dd0f2e3665a559983d95a5dbd5e51bf8624a2c8ed10983d6e29a6468b92743a686a3dcf1441b32c42c58f70e5e8634a93144370e232
data/Gemfile CHANGED
@@ -1,15 +1,13 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
3
  gemspec
6
4
 
7
5
  group :development do
8
- gem "bundler"
9
6
  is_unix = RUBY_PLATFORM =~ /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i
10
7
  is_truffleruby = RUBY_DESCRIPTION =~ /truffleruby/
11
8
  gem 'vterm', '>= 0.0.5' if is_unix && ENV['WITH_VTERM']
12
9
  gem 'yamatanooroti', '>= 0.0.6'
13
10
  gem "rake"
14
11
  gem "stackprof" if is_unix && !is_truffleruby
12
+ gem "test-unit"
15
13
  end
data/Rakefile CHANGED
@@ -4,14 +4,23 @@ require "rake/testtask"
4
4
  Rake::TestTask.new(:test) do |t|
5
5
  t.libs << "test" << "test/lib"
6
6
  t.libs << "lib"
7
+ t.ruby_opts << "-rhelper"
7
8
  t.test_files = FileList["test/irb/test_*.rb"]
8
9
  end
9
10
 
10
11
  Rake::TestTask.new(:test_yamatanooroti) do |t|
11
- t.libs << 'test'
12
+ t.libs << 'test' << "test/lib"
12
13
  t.libs << 'lib'
13
14
  #t.loader = :direct
15
+ t.ruby_opts << "-rhelper"
14
16
  t.pattern = 'test/irb/yamatanooroti/test_*.rb'
15
17
  end
16
18
 
19
+ task :sync_tool do
20
+ require 'fileutils'
21
+ FileUtils.cp "../ruby/tool/lib/core_assertions.rb", "./test/lib"
22
+ FileUtils.cp "../ruby/tool/lib/envutil.rb", "./test/lib"
23
+ FileUtils.cp "../ruby/tool/lib/find_executable.rb", "./test/lib"
24
+ end
25
+
17
26
  task :default => :test
data/doc/irb/irb.rd.ja CHANGED
@@ -40,15 +40,18 @@ irbの使い方は, Rubyさえ知っていればいたって簡単です. 基本
40
40
  irb.rb [options] file_name opts
41
41
  options:
42
42
  -f ~/.irbrc を読み込まない.
43
- -m bcモード(分数, 行列の計算ができる)
44
43
  -d $DEBUG をtrueにする(ruby -d と同じ)
45
- -Kc ruby -Kcと同じ
46
44
  -r load-module ruby -r と同じ.
47
- --verbose これから実行する行を表示する(デフォルト)
48
- --noverbose これから実行する行を表示しない
49
- --echo 実行結果を表示する(デフォルト)
50
- --noecho 実行結果を表示しない
51
- --inspect 結果出力にinspectを用いる(bcモード以外はデフォルト).
45
+ -I path $LOAD_PATH に path を追加する.
46
+ -U ruby -U と同じ.
47
+ -E enc ruby -E と同じ.
48
+ -w ruby -w と同じ.
49
+ -W[level=2] ruby -W と同じ.
50
+ --context-mode n 新しいワークスペースを作成した時に関連する Binding
51
+ オブジェクトの作成方法を 0 から 3 のいずれかに設定する.
52
+ --echo 実行結果を表示する(デフォルト).
53
+ --noecho 実行結果を表示しない.
54
+ --inspect 結果出力にinspectを用いる.
52
55
  --noinspect 結果出力にinspectを用いない.
53
56
  --singleline シングルラインエディタを利用する.
54
57
  --nosingleline シングルラインエディタを利用しない. デフォルトの動
@@ -62,19 +65,24 @@ irbの使い方は, Rubyさえ知っていればいたって簡単です. 基本
62
65
  --prompt-mode prompt-mode
63
66
  プロンプトモードを切替えます. 現在定義されているプ
64
67
  ロンプトモードは, default, simple, xmp, inf-rubyが
65
- 用意されています. デフォルトはdefaultプロンプトモー
66
- ドになっています.
67
-
68
+ 用意されています.
68
69
  --inf-ruby-mode emacsのinf-ruby-mode用のプロンプト表示を行なう. 特
69
70
  に指定がない限り, ラインエディタは使わなくなる.
70
71
  --simple-prompt
71
72
  非常にシンプルなプロンプトを用いるモードです.
72
73
  --noprompt プロンプト表示を行なわない.
74
+ --single-irb irb 中で self を実行して得られるオブジェクトをサ
75
+ ブ irb と共有する.
73
76
  --tracer コマンド実行時にトレースを行なう.
74
77
  --back-trace-limit n
75
78
  バックトレース表示をバックトレースの頭から n, 後ろ
76
79
  からnだけ行なう. デフォルトは16
77
- -v, --version irbのバージョンを表示する
80
+
81
+ --verbose 詳細なメッセージを出力する.
82
+ --noverbose 詳細なメッセージを出力しない(デフォルト).
83
+ -v, --version irbのバージョンを表示する.
84
+ -h, --help irb のヘルプを表示する.
85
+ -- 以降のコマンドライン引数をオプションとして扱わない.
78
86
 
79
87
  = コンフィギュレーション
80
88
 
@@ -139,12 +147,12 @@ PROMPT_I, PROMPT_N, PROMPT_S, PROMPT_Cは, フォーマットを指定します.
139
147
 
140
148
  例えば, デフォルトのプロンプトモードは:
141
149
 
142
- IRB.conf[:PROMPT_MODE][:DEFAULT] = {
150
+ IRB.conf[:PROMPT][:DEFAULT] = {
143
151
  :PROMPT_I => "%N(%m):%03n:%i> ",
144
152
  :PROMPT_N => "%N(%m):%03n:%i> ",
145
153
  :PROMPT_S => "%N(%m):%03n:%i%l ",
146
154
  :PROMPT_C => "%N(%m):%03n:%i* ",
147
- :RETURN => "%s\n"
155
+ :RETURN => "=> %s\n"
148
156
  }
149
157
 
150
158
  となっています.
@@ -376,7 +384,7 @@ rubyでは, 以下のプログラムはエラーになります.
376
384
  パイルしてローカル変数を決定するからです. それに対し, irbは実行可能に
377
385
  なる(式が閉じる)と自動的に評価しているからです. 上記の例では,
378
386
 
379
- evel "foo = 0"
387
+ eval "foo = 0"
380
388
 
381
389
  を行なった時点で評価を行ない, その時点で変数が定義されるため, 次式で
382
390
  変数fooは定義されているからです.
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.3"
39
+ spec.add_dependency "reline", ">= 0.2.8.pre.6"
40
40
  end
@@ -315,12 +315,19 @@ module IRB
315
315
  end
316
316
 
317
317
  else
318
- candidates = eval("methods | private_methods | local_variables | instance_variables | self.class.constants", bind).collect{|m| m.to_s}
319
- candidates |= ReservedWords
320
-
321
318
  if doc_namespace
322
- candidates.find{ |i| i == input }
319
+ vars = eval("local_variables | instance_variables", bind).collect{|m| m.to_s}
320
+ perfect_match_var = vars.find{|m| m.to_s == input}
321
+ if perfect_match_var
322
+ eval("#{perfect_match_var}.class.name", bind)
323
+ else
324
+ candidates = eval("methods | private_methods | local_variables | instance_variables | self.class.constants", bind).collect{|m| m.to_s}
325
+ candidates |= ReservedWords
326
+ candidates.find{ |i| i == input }
327
+ end
323
328
  else
329
+ candidates = eval("methods | private_methods | local_variables | instance_variables | self.class.constants", bind).collect{|m| m.to_s}
330
+ candidates |= ReservedWords
324
331
  candidates.grep(/^#{Regexp.quote(input)}/)
325
332
  end
326
333
  end
@@ -322,15 +322,18 @@ module IRB
322
322
  if just_cursor_moving and completion_journey_data.nil?
323
323
  return nil
324
324
  end
325
- cursor_pos_to_render, result, pointer = context.pop(3)
326
- return nil if result.nil? or pointer.nil?
325
+ cursor_pos_to_render, result, pointer, autocomplete_dialog = context.pop(4)
326
+ return nil if result.nil? or pointer.nil? or pointer < 0
327
327
  name = result[pointer]
328
+ name = IRB::InputCompletor.retrieve_completion_data(name, doc_namespace: true)
328
329
 
329
330
  driver = RDoc::RI::Driver.new
330
331
  begin
331
332
  name = driver.expand_name(name)
332
333
  rescue RDoc::RI::Driver::NotFoundError
333
334
  return nil
335
+ rescue
336
+ return nil # unknown error
334
337
  end
335
338
  doc = nil
336
339
  used_for_class = false
@@ -347,14 +350,20 @@ module IRB
347
350
  driver.add_method(doc, name)
348
351
  rescue RDoc::RI::Driver::NotFoundError
349
352
  doc = nil
353
+ rescue
354
+ return nil # unknown error
350
355
  end
351
356
  end
352
357
  return nil if doc.nil?
358
+ width = 40
353
359
  formatter = RDoc::Markup::ToAnsi.new
354
- formatter.width = 40
355
- str = doc.accept(formatter)
360
+ formatter.width = width
361
+ contents = doc.accept(formatter).split("\n")
356
362
 
357
- [Reline::CursorPos.new(cursor_pos_to_render.x + 40, cursor_pos_to_render.y + pointer), str.split("\n"), nil, '49']
363
+ x = cursor_pos_to_render.x + autocomplete_dialog.width
364
+ x = autocomplete_dialog.column - width if x + width >= screen_width
365
+ y = cursor_pos_to_render.y
366
+ DialogRenderInfo.new(pos: Reline::CursorPos.new(x, y), contents: contents, width: width, bg_color: '49')
358
367
  }
359
368
 
360
369
  # Reads the next line from this input method.
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.2"
14
+ VERSION = "1.3.8.pre.6"
15
15
  @RELEASE_VERSION = VERSION
16
- @LAST_UPDATE_DATE = "2021-08-30"
16
+ @LAST_UPDATE_DATE = "2021-09-02"
17
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.8.pre.2
4
+ version: 1.3.8.pre.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keiju ISHITSUKA
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-29 00:00:00.000000000 Z
11
+ date: 2021-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reline
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.8.pre.3
19
+ version: 0.2.8.pre.6
20
20
  type: :runtime
21
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.3
26
+ version: 0.2.8.pre.6
27
27
  description: Interactive Ruby command-line tool for REPL (Read Eval Print Loop).
28
28
  email:
29
29
  - keiju@ruby-lang.org