mini_readline 0.6.1 → 0.6.2

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
  SHA1:
3
- metadata.gz: 1c70c45ae03551c8cb61ccb5084d8693395d549e
4
- data.tar.gz: d536c61b39cd0271ec8a645962e269ca964a940e
3
+ metadata.gz: 69ab1aa8f3067beadb6cdb13347e21ed49a7ded9
4
+ data.tar.gz: e52f6ba38c806cbaf5ea2bdedb52eea35963238e
5
5
  SHA512:
6
- metadata.gz: 82d827399cbd449703f1114982b56a8355fc3c0d6ad88d5da03c9b5f9e4e51621bfe5b149ea273ca3cf24e44b734c7ec778451707008fb4c65e2875979701fe8
7
- data.tar.gz: bdd758d0fd384b8a4afb7c58ccc0f9570ab1e8f74b3dc41864070a6882992dc1bc0fb29ac329ddcfe7efaa262006ec14c2ea7f86b4a75c3681a8a0d46dc6e747
6
+ metadata.gz: 2388bc618f6a11c90b070926924a7397d52b33c0bad9d3bb6dad299d8afea6df9003c5c51641d908e733db68c0038ba82a59ef4332302201b0d4bfd435792da8
7
+ data.tar.gz: 168b2ce0f5d055d495ba8ff762a35f29e98484b6012b63d070962d1c0fe96435ccd6c98d43aeb098941df649f386db68fb33e7cdd1c74bd62c1c13cc59dd2975
data/README.md CHANGED
@@ -161,6 +161,16 @@ $force_alias_read_line_module = true
161
161
  require 'mini_readline'
162
162
  ```
163
163
 
164
+ ##### Limitations
165
+
166
+ All of the measures taken to ensure some backward compatibility with the
167
+ standard readline facility are only of limited effectiveness. Any program
168
+ that digs into the innards of the system gem will likely need at least some
169
+ porting to switch to the mini_readline gem.
170
+
171
+ For the most part, compatible mode exists to make that porting process an
172
+ easier one.
173
+
164
174
  ### Native Mode
165
175
 
166
176
  In native mode, instances of the Readline class are used to get user input.
data/bin/irbm CHANGED
@@ -4,7 +4,22 @@
4
4
  #
5
5
 
6
6
  require 'irb'
7
- $force_alias_read_line_module = true
8
7
  require 'mini_readline'
8
+
9
9
  puts "Starting an IRB console with mini_readline."
10
+ puts
11
+
12
+ module IRB
13
+ class ReadlineInputMethod < InputMethod
14
+
15
+ #Get a string from mini readline.
16
+ def gets
17
+ result = MiniReadline.readline(@prompt, true)
18
+ HISTORY.push(result) unless result.empty?
19
+ @line[@line_no += 1] = result
20
+ end
21
+
22
+ end
23
+ end
24
+
10
25
  IRB.start
data/irbt.rb CHANGED
@@ -2,20 +2,40 @@
2
2
  # An IRB + mini_readline Test bed
3
3
 
4
4
  require 'irb'
5
- $force_alias_read_line_module = true
6
5
 
7
6
  puts "Starting an IRB console with mini_readline test bed."
8
7
 
9
8
  if ARGV[0] == 'old'
9
+ puts "Using the standard readline gem: #{RbReadline::RB_READLINE_VERSION}"
10
+ no_patch = true
10
11
  ARGV.shift
11
12
  elsif ARGV[0] == 'local'
12
13
  require_relative 'lib/mini_readline'
13
- puts "mini_readline loaded locally: #{MiniReadline::VERSION}"
14
-
14
+ puts "Using mini_readline loaded locally: #{MiniReadline::VERSION}"
15
+ no_patch = false
15
16
  ARGV.shift
16
17
  else
17
18
  require 'mini_readline'
18
- puts "mini_readline loaded from gem: #{MiniReadline::VERSION}"
19
+ puts "Using mini_readline loaded from gem: #{MiniReadline::VERSION}"
20
+ no_patch = false
21
+ end
22
+
23
+ puts
24
+
25
+ #Hack irb to use mini_readline.
26
+ unless no_patch
27
+ module IRB
28
+ class ReadlineInputMethod < InputMethod
29
+
30
+ #Get a string from mini readline.
31
+ def gets
32
+ result = MiniReadline.readline(@prompt, true)
33
+ HISTORY.push(result) unless result.empty?
34
+ @line[@line_no += 1] = result
35
+ end
36
+
37
+ end
38
+ end
19
39
  end
20
40
 
21
41
  IRB.start
@@ -1,4 +1,4 @@
1
1
  module MiniReadline
2
2
  #The current version of the mini_readline gem.
3
- VERSION = "0.6.1"
3
+ VERSION = "0.6.2"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_readline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Camilleri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-26 00:00:00.000000000 Z
11
+ date: 2016-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest