mini_readline 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CODE_OF_CONDUCT.md +38 -41
- data/README.md +2 -4
- data/lib/mini_readline.rb +0 -8
- data/lib/mini_readline/exceptions.rb +11 -3
- data/lib/mini_readline/raw_term/ansi.rb +0 -3
- data/lib/mini_readline/raw_term/mapped_term/mapper.rb +2 -2
- data/lib/mini_readline/raw_term/windows.rb +0 -1
- data/lib/mini_readline/read_line.rb +2 -2
- data/lib/mini_readline/read_line/edit/cancel.rb +1 -1
- data/lib/mini_readline/version.rb +1 -1
- data/tests/mini_readline_tests.rb +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '03240235936a20a5408ecd9162d0633b81f75d5c'
|
4
|
+
data.tar.gz: 0e5e19408057351bdd835f84d8f4256627a84fd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 492cf0e29207d1daec3f523672aa8e33b6d157978b1cb949668862049312a5cdbb06a10dfa2b4c94d303568e435e419f7269f7b98ff2d75dbd496b71003c61ff
|
7
|
+
data.tar.gz: f4a29768fdf9de8ef867de94257d1978b168a39ef21bf150bc06845aeb339ad503a79fe00d65143da7c3728cb1d9790bcce680664e6a23c917e249e4db106de5
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,49 +1,46 @@
|
|
1
|
-
# Contributor Code of Conduct
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
2
|
|
3
|
-
|
4
|
-
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
-
contribute through reporting issues, posting feature requests, updating
|
6
|
-
documentation, submitting pull requests or patches, and other activities.
|
3
|
+
## Our Pledge
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
## Our Standards
|
8
|
+
|
9
|
+
Examples of behavior that contributes to creating a positive environment include:
|
10
|
+
|
11
|
+
* Using welcoming and inclusive language
|
12
|
+
* Being respectful of differing viewpoints and experiences
|
13
|
+
* Gracefully accepting constructive criticism
|
14
|
+
* Focusing on what is best for the community
|
15
|
+
* Showing empathy towards other community members
|
12
16
|
|
13
17
|
Examples of unacceptable behavior by participants include:
|
14
18
|
|
15
|
-
* The use of sexualized language or imagery
|
16
|
-
*
|
17
|
-
* Trolling or insulting/derogatory comments
|
19
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
20
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
18
21
|
* Public or private harassment
|
19
|
-
* Publishing
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
-
incident.
|
43
|
-
|
44
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
-
version 1.3.0, available at
|
46
|
-
[http://contributor-covenant.org/version/1/3/0/][version]
|
22
|
+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
23
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
24
|
+
|
25
|
+
## Our Responsibilities
|
26
|
+
|
27
|
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
28
|
+
|
29
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
30
|
+
|
31
|
+
## Scope
|
32
|
+
|
33
|
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
34
|
+
|
35
|
+
## Enforcement
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at peter.c.camilleri@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
38
|
+
|
39
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
40
|
+
|
41
|
+
## Attribution
|
42
|
+
|
43
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
47
44
|
|
48
45
|
[homepage]: http://contributor-covenant.org
|
49
|
-
[version]: http://contributor-covenant.org/version/1/
|
46
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/README.md
CHANGED
@@ -142,10 +142,7 @@ This feature was controlled by two global variables:
|
|
142
142
|
$force_alias_read_line_module
|
143
143
|
$no_alias_read_line_module
|
144
144
|
```
|
145
|
-
Note: Using these variables now
|
146
|
-
|
147
|
-
mini_readline: $force_alias_read_line_module is not supported.
|
148
|
-
mini_readline: $no_alias_read_line_module is not supported.
|
145
|
+
Note: Using these variables now has no effect whatsoever.
|
149
146
|
|
150
147
|
### Native Mode
|
151
148
|
|
@@ -429,6 +426,7 @@ Ruby | Win32 | Win64 | Cygwin | Linux | Mac
|
|
429
426
|
ruby 1.9.3p484 | Yes | Yes | ? | ? | ?
|
430
427
|
ruby 2.1.6p336 | Yes | ? | ? | ? | ?
|
431
428
|
ruby 2.2.3p173 | ? | ? | Yes | ? | ?
|
429
|
+
ruby 2.3.3p222 | ? | Yes | ? | ? | ?
|
432
430
|
jruby 9.1.5.0 | Mostly | ? | Planned | Planned | Planned
|
433
431
|
rubinius | N/A | N/A | N/A | Maybe | Maybe
|
434
432
|
|
data/lib/mini_readline.rb
CHANGED
@@ -28,11 +28,3 @@ module MiniReadline
|
|
28
28
|
end
|
29
29
|
|
30
30
|
end
|
31
|
-
|
32
|
-
if defined?($force_alias_read_line_module)
|
33
|
-
fail "mini_readline: $force_alias_read_line_module is not supported."
|
34
|
-
end
|
35
|
-
|
36
|
-
if defined?($no_alias_read_line_module)
|
37
|
-
fail "mini_readline: $no_alias_read_line_module is not supported."
|
38
|
-
end
|
@@ -1,5 +1,13 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
|
-
#The exception raised when an enabled EOI is detected in a readline operation.
|
4
|
-
class MiniReadlineEOI < StandardError
|
5
|
-
|
3
|
+
# The exception raised when an enabled EOI is detected in a readline operation.
|
4
|
+
class MiniReadlineEOI < StandardError; end
|
5
|
+
|
6
|
+
# The exception raised when the keyboard mapping is invalid.
|
7
|
+
class MiniReadlineKME < RuntimeError; end
|
8
|
+
|
9
|
+
# The exception raised when the prompt is too long to fit.
|
10
|
+
class MiniReadlinePLE < RuntimeError; end
|
11
|
+
|
12
|
+
# The exception raised when the secret entry mask is invalid.
|
13
|
+
class MiniReadlineSME < RuntimeError; end
|
@@ -14,7 +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
|
+
fail MiniReadlineKME, "Duplicate entry #{index.inspect}" if @map.has_key?(index)
|
18
18
|
@map[index] = value
|
19
19
|
end
|
20
20
|
|
@@ -33,7 +33,7 @@ module MiniReadline
|
|
33
33
|
|
34
34
|
index.chop.chars.each do |char|
|
35
35
|
seq << char
|
36
|
-
fail "Ambiguous entry #{index.inspect}" if @map.has_key?(seq) && @map[seq]
|
36
|
+
fail MiniReadlineKME, "Ambiguous entry #{index.inspect}" if @map.has_key?(seq) && @map[seq]
|
37
37
|
@map[seq] = false
|
38
38
|
end
|
39
39
|
end
|
@@ -82,14 +82,14 @@ module MiniReadline
|
|
82
82
|
def verify_prompt(prompt)
|
83
83
|
unless (@options[:window_width] - prompt.length) >
|
84
84
|
(@options[:scroll_step] * 2)
|
85
|
-
fail "Too long: #{prompt.inspect}"
|
85
|
+
fail MiniReadlinePLE, "Too long: #{prompt.inspect}"
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
89
|
#Verify the secret mask
|
90
90
|
def verify_mask(secret)
|
91
91
|
if secret && secret.length != 1
|
92
|
-
fail "Secret mask must be nil or a single character string."
|
92
|
+
fail MiniReadlineSME, "Secret mask must be nil or a single character string."
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#* read_line/window/edit/cancel.rb - Process :cancel
|
4
4
|
module MiniReadline
|
5
5
|
|
6
|
-
#* read_line/window/edit/cancel.rb - Process :cancel
|
6
|
+
#* read_line/window/edit/cancel.rb - Process :cancel - delete all text.
|
7
7
|
class Edit
|
8
8
|
|
9
9
|
#All right! Scrap all of this and start over!
|
@@ -27,8 +27,8 @@ class MiniReadlineTester < Minitest::Test
|
|
27
27
|
def test_mapper_checking
|
28
28
|
MiniReadline::RawTerm::MAP["\xC0test"] = [:go_left]
|
29
29
|
|
30
|
-
assert_raises { MiniReadline::RawTerm::MAP["\xC0t"] = [:go_left] }
|
31
|
-
assert_raises { MiniReadline::RawTerm::MAP["\xC0test"] = [:go_left] }
|
30
|
+
assert_raises(MiniReadlineKME) { MiniReadline::RawTerm::MAP["\xC0t"] = [:go_left] }
|
31
|
+
assert_raises(MiniReadlineKME) { MiniReadline::RawTerm::MAP["\xC0test"] = [:go_left] }
|
32
32
|
end
|
33
33
|
|
34
34
|
def test_platform_detection
|
@@ -195,17 +195,17 @@ class MiniReadlineTester < Minitest::Test
|
|
195
195
|
def test_prompt_verification
|
196
196
|
opts = {prompt: ">"*70}
|
197
197
|
edit = MiniReadline::Readline.new()
|
198
|
-
assert_raises(
|
198
|
+
assert_raises(MiniReadlinePLE) {edit.readline(opts)}
|
199
199
|
end
|
200
200
|
|
201
201
|
def test_mask_verification
|
202
202
|
opts = {prompt: ">", secret_mask: ""}
|
203
203
|
edit = MiniReadline::Readline.new()
|
204
|
-
assert_raises(
|
204
|
+
assert_raises(MiniReadlineSME) {edit.readline(opts)}
|
205
205
|
|
206
206
|
opts = {prompt: ">", secret_mask: "xx"}
|
207
207
|
edit = MiniReadline::Readline.new()
|
208
|
-
assert_raises(
|
208
|
+
assert_raises(MiniReadlineSME) {edit.readline(opts)}
|
209
209
|
end
|
210
210
|
|
211
211
|
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.8.
|
4
|
+
version: 0.8.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: 2018-
|
11
|
+
date: 2018-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|