mini_readline 0.4.8 → 0.5.0

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: edfef9b53b2018ba69c93716ab1901aa54c489fb
4
- data.tar.gz: 1d49861217c98222b569fc96d37014460d6665a8
3
+ metadata.gz: 51afb896300300688d6a75cf155988db14c54462
4
+ data.tar.gz: 3456c2ab788faa2a63ccfa0eafdbec96da32abf5
5
5
  SHA512:
6
- metadata.gz: 175ef7109e65697862da2000893278f8e51c6181a748982b9dd8b4a8dd09b291c86e5b6f204e110838c5587d9226f12cc07d04eb8c796ccd024c81c247d18eb1
7
- data.tar.gz: f3778b925a149e13bcaa9ecd80e10af9caad9cf2e1a985f23b8e0090e44442c6904ad5bcbecb0d14479ed45c0a94c239d16128f1cd0637d377bd8a42c8d14be4
6
+ metadata.gz: c857932bb2fbd1c7e67c90c4fe7c9ab03a0ba5ad6280a381ae8a19220c1119d46d45f6170affb0d7c9075193da8ff4eac86ffc8628589744a90e95c9e2d8be2b
7
+ data.tar.gz: 29dd823603021ade6cb5458011a0dc90f29dc8749702543cfc15fe7a30c94b525c8c919e1d4ae29cbf8e3d6caf5d7679e904251cf3a1fb4cc0804b07146c33b6
data/README.md CHANGED
@@ -11,19 +11,31 @@ irritating issues encountered when running under a Windows platform.
11
11
  The mini_readline gem is designed for use with MRI version 1.9.3 or later.
12
12
  The original readline tried to support older versions of Ruby.
13
13
 
14
+ **Note:** A pull request against the rb-readline project was submitted on
15
+ April 24, 2016. This fixes the outstanding issues with windows operation with
16
+ low risk to other platforms. However I do not much expect to come of this
17
+ effort. There are two year old pull request languishing away, so it looks like
18
+ support for the original rb-readline has ended. I will move forward with the
19
+ mini_readline gem as I can at least support my own code.
20
+
14
21
  ## Installation
22
+
15
23
  Add this line to your application's Gemfile:
16
24
 
17
25
  ```ruby
18
26
  gem 'mini_readline'
19
27
  ```
28
+
20
29
  And then execute:
21
30
 
22
31
  $ bundle
32
+
23
33
  Or install it yourself as:
24
34
 
25
35
  $ gem install mini_readline
26
36
 
37
+ The mini_readline gem itself is found at: ( https://rubygems.org/gems/mini_readline )
38
+
27
39
  ## Key Mappings
28
40
  The mini_readline gem supports a simple set of editing commands. These vary
29
41
  somewhat based on the system platform. The keyboard mappings (and alias
data/lib/mini_readline.rb CHANGED
@@ -21,10 +21,10 @@ module MiniReadline
21
21
  private_constant :NoHistory
22
22
 
23
23
  #The shared instance of Readline.
24
- @reader = Readline.new()
24
+ @reader = MiniReadline::Readline.new()
25
25
 
26
26
  #The (limited) compatibility module function.
27
- def self.readline(prompt, history = nil)
27
+ def self.readline(prompt = "", history = nil)
28
28
  @reader.readline(prompt: prompt, history: history)
29
29
  end
30
30
 
@@ -8,6 +8,7 @@ module MiniReadline
8
8
 
9
9
  #The insert_text command. We are DONE!
10
10
  def enter(_keyboard_args)
11
+ @edit_buffer << "\n"
11
12
  @working = false
12
13
  end
13
14
  end
@@ -1,4 +1,4 @@
1
1
  module MiniReadline
2
2
  #The current version of the mini_readline gem.
3
- VERSION = "0.4.8"
3
+ VERSION = "0.5.0"
4
4
  end
@@ -41,9 +41,9 @@ class MiniReadlineTester < Minitest::Test
41
41
  result = ''
42
42
 
43
43
  loop do
44
- result = edit.readline(prompt: ">", history: true)
44
+ result = edit.readline(prompt: ">", history: true).chomp
45
45
  puts result.inspect
46
- break unless result != 'quit'
46
+ break unless result != "quit"
47
47
  end
48
48
 
49
49
  assert_equal("quit", result)
@@ -58,9 +58,9 @@ class MiniReadlineTester < Minitest::Test
58
58
  result = ''
59
59
 
60
60
  loop do
61
- result = edit.readline(prompt: ">")
61
+ result = edit.readline(prompt: ">").chomp
62
62
  puts result.inspect
63
- break unless result != 'quit'
63
+ break unless result != "quit"
64
64
  end
65
65
 
66
66
  assert_equal("quit", result)
@@ -81,7 +81,7 @@ class MiniReadlineTester < Minitest::Test
81
81
  array_src: fruit)
82
82
 
83
83
  result = edit.readline(prompt: "\e[7mFruit:\e[0m ")
84
- assert(fruit.include?(result))
84
+ assert(fruit.include?(result.chomp))
85
85
  end
86
86
 
87
87
  def test_block_complete
@@ -99,7 +99,7 @@ class MiniReadlineTester < Minitest::Test
99
99
  array_src: lambda { fruit })
100
100
 
101
101
  result = edit.readline(prompt: "Fruit: ")
102
- assert(fruit.include?(result))
102
+ assert(fruit.include?(result.chomp))
103
103
  end
104
104
 
105
105
  def test_file_auto
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.4.8
4
+ version: 0.5.0
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-05-03 00:00:00.000000000 Z
11
+ date: 2016-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest