mini_readline 0.5.0 → 0.5.1

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
  SHA1:
3
- metadata.gz: 51afb896300300688d6a75cf155988db14c54462
4
- data.tar.gz: 3456c2ab788faa2a63ccfa0eafdbec96da32abf5
3
+ metadata.gz: ea73fa12d40056083fdc2ffe14834b6489aaf13b
4
+ data.tar.gz: fc7eeb12c81b535b75425ed0ababdc0338acc6ec
5
5
  SHA512:
6
- metadata.gz: c857932bb2fbd1c7e67c90c4fe7c9ab03a0ba5ad6280a381ae8a19220c1119d46d45f6170affb0d7c9075193da8ff4eac86ffc8628589744a90e95c9e2d8be2b
7
- data.tar.gz: 29dd823603021ade6cb5458011a0dc90f29dc8749702543cfc15fe7a30c94b525c8c919e1d4ae29cbf8e3d6caf5d7679e904251cf3a1fb4cc0804b07146c33b6
6
+ metadata.gz: a95b6e3e7651f35462c708d6ef366a59bb6e4956fbb97b073087613d9e4f4be1f08b9505737e96b3b5e72af6a220fcd4a1fe7159db08bd4e143ad90a3d2ceaf9
7
+ data.tar.gz: 332c84a05c1dd2ef3030dfe5be0864dab0e8b5b1b1703451526df120dc206daa0091206986416c229e34606231a9f7a049ba3c76cb92533e1a6b8bdefb5c0daf
@@ -40,6 +40,7 @@ module MiniReadline
40
40
 
41
41
  #A stub.
42
42
  def self.readline_attempted_completion_function(*_)
43
+ nil
43
44
  end
44
45
 
45
46
  end
@@ -49,8 +50,8 @@ begin
49
50
  old_stderr = $stderr
50
51
  $stderr = File.open(File::NULL, 'w')
51
52
 
52
- if !$no_alias_read_line_module&&($force_alias_read_line_module||!defined? Readline)
53
- Readline = MiniReadline
53
+ if !$no_alias_read_line_module && ($force_alias_read_line_module || !defined? Readline)
54
+ Readline = MiniReadline
54
55
  end
55
56
  ensure
56
57
  $stderr.close
@@ -14,6 +14,7 @@ module MiniReadline
14
14
  #Add a map entry
15
15
  def []=(index, value)
16
16
  process_non_terminals(index)
17
+ fail "Duplicate entry #{index.inspect}" if @map.has_key?(index)
17
18
  @map[index] = value
18
19
  end
19
20
 
@@ -60,7 +60,7 @@ module MiniReadline
60
60
  #Interact with the user
61
61
  def edit_process
62
62
  result = edit_loop
63
- @history.append_history(result)
63
+ @history.append_history(result.chomp)
64
64
  result
65
65
  end
66
66
 
@@ -45,6 +45,7 @@ module MiniReadline
45
45
 
46
46
  #Append a string to the history buffer if enabled.
47
47
  def append_history(str)
48
+ str = str.chomp
48
49
  return if @options[:no_blanks] && str.strip.empty?
49
50
  history.delete(str) if @options[:no_dups]
50
51
 
@@ -1,4 +1,4 @@
1
1
  module MiniReadline
2
2
  #The current version of the mini_readline gem.
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
@@ -24,6 +24,13 @@ class MiniReadlineTester < Minitest::Test
24
24
  refute_equal(MiniReadline::BASE_OPTIONS, edit.instance_options)
25
25
  end
26
26
 
27
+ def test_mapper_checking
28
+ MiniReadline::RawTerm::MAP["\xC0test"] = [:go_left]
29
+
30
+ assert_raises { MiniReadline::RawTerm::MAP["\xC0t"] = [:go_left] }
31
+ assert_raises { MiniReadline::RawTerm::MAP["\xC0test"] = [:go_left] }
32
+ end
33
+
27
34
  def test_platform_detection
28
35
  if (RUBY_PLATFORM =~ /\bcygwin\b/i) || (RUBY_PLATFORM !~ /mswin|mingw/)
29
36
  assert_equal(:other, MiniReadline::PLATFORM)
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.5.0
4
+ version: 0.5.1
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-06-18 00:00:00.000000000 Z
11
+ date: 2016-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest