mini_readline 0.4.3 → 0.4.4

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: 690b9bbc91ea51c6f3753328add583414e64c663
4
- data.tar.gz: f6bea7f3247fb1d4dd25f5301cbf7032f99450ac
3
+ metadata.gz: db8aa24f1ed018cec50cc765e15f78f71ebf758b
4
+ data.tar.gz: 5a406cc60483ba9cf5c627fc92e38dc990020e94
5
5
  SHA512:
6
- metadata.gz: a292430aceb3661ec178644b875da9cac5535d579274b98d0df0f7bc202971bd1be3ea5d3d04970bbaebb0a14cc6c4f5dbd0a2ee7938e4f9d3cad01b4a36c1df
7
- data.tar.gz: a561bdc27dde745ad4dc4dc1c27e642291a65f6b2b661e4aca0fa722b64a11bb7d515771d2455aab3033846ae57a162b98e4d662bdba94c15494d47246ceddbb
6
+ metadata.gz: da8564e26c87549546c8b9587314207b8ddf45b69aec4aaa4df8f450cc65ec56aa105cd384a7709561a267c4ea7402d0a7e9cfeb7019c26b13a39bc7bab58969
7
+ data.tar.gz: b757e1df30e8991b94072c7ad01732a6cad72b27b909d8e338980e9d36bfa95b7476f8b472ba95eec8e71e202a674f55cdee8292a386cb66208a45041ddb77b6
data/README.md CHANGED
@@ -41,7 +41,9 @@ Go to end | End, Pad End | End, Ctrl-E
41
41
  Previous History | Up Arrow, Pad Up | Up Arrow, Ctrl-R
42
42
  Next History | Down Arrow, Pad Down | Down Arrow
43
43
  Erase Left | Backspace, Ctrl-H | Backspace, Ctrl-H
44
+ Erase All Left | | Ctrl-U
44
45
  Erase Right | Delete, Ctrl-Backspace | Delete, Ctrl-Backspace
46
+ Erase All Right | | Ctrl-K
45
47
  Erase All | Escape | Ctrl-L
46
48
  Auto-complete | Tab, Ctrl-I | Tab, Ctrl-I
47
49
  End of Input | Ctrl-Z | Alt-z
@@ -46,10 +46,12 @@ module MiniReadline
46
46
  #The Backspace key
47
47
  MAP["\x7F"] = [:delete_left]
48
48
  MAP["\x08"] = [:delete_left]
49
+ MAP["\x15"] = [:delete_all_left]
49
50
 
50
51
  #The Delete keys
51
52
  MAP["\x1F"] = [:delete_right]
52
53
  MAP["\e[3~"] = [:delete_right]
54
+ MAP["\x0B"] = [:delete_all_right]
53
55
 
54
56
  #Auto-completion.
55
57
  MAP["\t"] = [:auto_complete]
@@ -15,7 +15,9 @@ require_relative 'edit/go_home'
15
15
  require_relative 'edit/go_end'
16
16
 
17
17
  require_relative 'edit/delete_left'
18
+ require_relative 'edit/delete_all_left'
18
19
  require_relative 'edit/delete_right'
20
+ require_relative 'edit/delete_all_right'
19
21
  require_relative 'edit/cancel'
20
22
 
21
23
  require_relative 'edit/previous_history'
@@ -0,0 +1,19 @@
1
+ # coding: utf-8
2
+
3
+ #* read_line/window/edit/delete_left.rb - Process :delete_left
4
+ module MiniReadline
5
+
6
+ #* read_line/window/edit/delete_all_left.rb - Process :delete_all_left
7
+ class Edit
8
+
9
+ #The delete to the left command
10
+ def delete_all_left(_keyboard_args)
11
+ if @edit_posn > 0
12
+ @edit_buffer = @edit_buffer[@edit_posn..-1]
13
+ @edit_posn = 0
14
+ else
15
+ @term.beep
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,18 @@
1
+ # coding: utf-8
2
+
3
+ #* read_line/window/edit/delete_all_right.rb - Process :delete_all_right
4
+ module MiniReadline
5
+
6
+ #* read_line/window/edit/delete_right.rb - Process :delete_right
7
+ class Edit
8
+
9
+ #The delete to the right
10
+ def delete_all_right(_keyboard_args)
11
+ if @edit_posn < self.length
12
+ @edit_buffer = @edit_buffer[0...@edit_posn]
13
+ else
14
+ @term.beep
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,4 +1,4 @@
1
1
  module MiniReadline
2
2
  #The current version of the mini_readline gem.
3
- VERSION = "0.4.3"
3
+ VERSION = "0.4.4"
4
4
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = '>=1.9.3'
27
27
 
28
28
  spec.add_development_dependency "minitest", ">= 5.7"
29
- spec.add_development_dependency "minitest_visible", ">= 0.1.0"
29
+ spec.add_development_dependency "minitest_visible", ">= 0.1.1"
30
30
  spec.add_development_dependency "bundler", "~> 1.11"
31
31
  spec.add_development_dependency "rake", "~> 10.0"
32
32
  end
data/sire.rb CHANGED
@@ -6,6 +6,10 @@ require 'pp'
6
6
  if ARGV[0] == 'old'
7
7
  require 'readline'
8
8
  $old = true
9
+
10
+ class MiniReadlineEOI < StandardError
11
+ end
12
+
9
13
  puts "\nOption(old). Loaded the standard readline gem. Version #{Readline::VERSION}"
10
14
  elsif ARGV[0] == 'local'
11
15
  require './lib/mini_readline'
@@ -98,7 +102,6 @@ class SIRE
98
102
  unless $old
99
103
  MiniReadline::BASE_OPTIONS[:auto_complete] = true
100
104
  MiniReadline::BASE_OPTIONS[:eoi_detect] = true
101
- MiniReadline::BASE_OPTIONS[:debug] = true
102
105
  end
103
106
 
104
107
  puts
@@ -111,7 +114,7 @@ class SIRE
111
114
 
112
115
  puts "\n\n"
113
116
 
114
- rescue StandardError, Interrupt => e
117
+ rescue MiniReadlineEOI, Interrupt => e
115
118
  puts "\n"
116
119
  end
117
120
 
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.3
4
+ version: 0.4.4
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-03-23 00:00:00.000000000 Z
11
+ date: 2016-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.0
33
+ version: 0.1.1
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.0
40
+ version: 0.1.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -100,6 +100,8 @@ files:
100
100
  - lib/mini_readline/read_line/edit/auto_complete/file_folder_source.rb
101
101
  - lib/mini_readline/read_line/edit/auto_complete/quoted_file_folder_source.rb
102
102
  - lib/mini_readline/read_line/edit/cancel.rb
103
+ - lib/mini_readline/read_line/edit/delete_all_left.rb
104
+ - lib/mini_readline/read_line/edit/delete_all_right.rb
103
105
  - lib/mini_readline/read_line/edit/delete_left.rb
104
106
  - lib/mini_readline/read_line/edit/delete_right.rb
105
107
  - lib/mini_readline/read_line/edit/edit_window.rb