katakata_irb 0.1.11 → 0.1.12

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: 810109ee76180f61c9b3672a8def67d0a32d53ca23b2436c65575457b586bf68
4
- data.tar.gz: e17ff5c4e226d785031f2b433b35a8763a49e6a254420fcacf96507975dfa70b
3
+ metadata.gz: de309515e451688552ff4758e266ba13966dfef8e62601d0496e3dfc1df256c1
4
+ data.tar.gz: 9923f034c376e28156f7d4a8552f893a2d70546372f7feea0f0f04e5072d782a
5
5
  SHA512:
6
- metadata.gz: 47f0ea76bdf5a5599d219524346acca935b67d1ea73ed60d55887534bce442fffc8c483590b53cd84754c754b829551d837c38687282c497f2924c3ec616f0ff
7
- data.tar.gz: f3aec83bbee8f2e889fdcf31eecc85627972511bf1673894d7f45f8a6834e6b52212ec4beb1814e0e8ddd705cf39eb9370ba78ff395d288caadcaa07008ebed8
6
+ metadata.gz: 956de3a2a11d2ab1d877dbc832010fe501c18d1708dc9371e3d7dec9b0a158c66a6a05456660336e72b321662cae4ef764f2f0e065c4f7eab2f542262f59fe43
7
+ data.tar.gz: 2cc3a0e8829e6567fa34dd9a3218db03a8b51f5733392680b759810395aaab62ed2ca18c2fbc52f67c2608d6c0e6107c22e4546dcfc0c3aa8f055450ee8287f0
@@ -20,10 +20,10 @@ module KatakataIrb::Completor
20
20
  KatakataIrb::Completor.prev_analyze_result = result
21
21
  candidates = case result
22
22
  in [:require | :require_relative => method, name]
23
- if IRB.const_defined? :InputCompletor # IRB::VERSION <= 1.8.1
24
- path_completor = IRB::InputCompletor
25
- elsif IRB.const_defined? :RegexpCompletor # IRB::VERSION >= 1.8.2
23
+ if IRB.const_defined? :RegexpCompletor # IRB::VERSION >= 1.8.2
26
24
  path_completor = IRB::RegexpCompletor.new
25
+ elsif IRB.const_defined? :InputCompletor # IRB::VERSION <= 1.8.1
26
+ path_completor = IRB::InputCompletor
27
27
  end
28
28
  if !path_completor
29
29
  []
@@ -103,7 +103,16 @@ module KatakataIrb::Completor
103
103
  end
104
104
  end
105
105
 
106
- if IRB.const_defined? :InputCompletor # IRB::VERSION <= 1.8.1
106
+ if IRB.const_defined? :RegexpCompletor # IRB::VERSION >= 1.8.2
107
+ IRB::RegexpCompletor.class_eval do
108
+ define_method :completion_candidates do |preposing, target, postposing, bind:|
109
+ completion_proc.call(target, preposing, postposing)
110
+ end
111
+ define_method :doc_namespace do |_preposing, matched, _postposing, bind:|
112
+ doc_namespace_proc.call matched
113
+ end
114
+ end
115
+ elsif IRB.const_defined? :InputCompletor # IRB::VERSION <= 1.8.1
107
116
  IRB::InputCompletor::CompletionProc.define_singleton_method :call do |*args|
108
117
  completion_proc.call(*args)
109
118
  end
@@ -115,15 +124,6 @@ module KatakataIrb::Completor
115
124
  end
116
125
  end
117
126
  )
118
- elsif IRB.const_defined? :RegexpCompletor # IRB::VERSION >= 1.8.2
119
- IRB::RegexpCompletor.class_eval do
120
- define_method :completion_candidates do |preposing, target, postposing, bind:|
121
- completion_proc.call(target, preposing, postposing)
122
- end
123
- define_method :doc_namespace do |_preposing, matched, _postposing, bind:|
124
- doc_namespace_proc.call matched
125
- end
126
- end
127
127
  else
128
128
  puts 'Cannot activate katakata_irb'
129
129
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KatakataIrb
4
- VERSION = "0.1.11"
4
+ VERSION = "0.1.12"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katakata_irb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - tompng
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-12 00:00:00.000000000 Z
11
+ date: 2023-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: irb