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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4f4d133f9c4b1b125c72e46f6fc975765bdfc84
4
- data.tar.gz: 7d4998a8f1e72d332dabf336d3c18d5dc3fc046a
3
+ metadata.gz: '03240235936a20a5408ecd9162d0633b81f75d5c'
4
+ data.tar.gz: 0e5e19408057351bdd835f84d8f4256627a84fd3
5
5
  SHA512:
6
- metadata.gz: 804e9995ed300252cd50c0afdbd102d92c32b50e72a1264d264e7beeaba04acd76425d2e219411402ae558fcc529f43162f83100d6d2f5628027efdc6160db50
7
- data.tar.gz: 923e4575825fac2d9862daf90742100e0cafe14519142424ef6408806f7a5c069a691a2d26ee183b4a521d6279f393e9b8ebdab9086ccf64db0d825e3b94cbfe
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
- As contributors and maintainers of this project, and in the interest of
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
- We are committed to making participation in this project a harassment-free
9
- experience for everyone, regardless of level of experience, gender, gender
10
- identity and expression, sexual orientation, disability, personal appearance,
11
- body size, race, ethnicity, age, religion, or nationality.
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
- * Personal attacks
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 other's private information, such as physical or electronic
20
- addresses, without explicit permission
21
- * Other unethical or unprofessional conduct
22
-
23
- Project maintainers have the right and responsibility to remove, edit, or
24
- reject comments, commits, code, wiki edits, issues, and other contributions
25
- that are not aligned to this Code of Conduct, or to ban temporarily or
26
- permanently any contributor for other behaviors that they deem inappropriate,
27
- threatening, offensive, or harmful.
28
-
29
- By adopting this Code of Conduct, project maintainers commit themselves to
30
- fairly and consistently applying these principles to every aspect of managing
31
- this project. Project maintainers who do not follow or enforce the Code of
32
- Conduct may be permanently removed from the project team.
33
-
34
- This code of conduct applies both within project spaces and in public spaces
35
- when an individual is representing the project or its community.
36
-
37
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
- reported by contacting a project maintainer at peter.c.camilleri@gmail.com. All
39
- complaints will be reviewed and investigated and will result in a response that
40
- is deemed necessary and appropriate to the circumstances. Maintainers are
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/3/0/
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 generates one of these exceptions.
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
- end
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
@@ -16,10 +16,7 @@ module MiniReadline
16
16
  #The class used to manipulate console i/o on a low level.
17
17
  class RawTerm
18
18
 
19
- #Carriage return
20
19
  CARRIAGE_RETURN = "\x0D"
21
-
22
- #Bell
23
20
  BELL = "\x07"
24
21
 
25
22
  #Output a string
@@ -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
@@ -23,7 +23,6 @@ module MiniReadline
23
23
  #The sleep interval waiting for a key to be pressed.
24
24
  WAIT_SLEEP = 0.02
25
25
 
26
- #Carriage return
27
26
  CARRIAGE_RETURN = "\x0D"
28
27
 
29
28
  #The magic number for standard out.
@@ -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!
@@ -1,4 +1,4 @@
1
1
  module MiniReadline
2
2
  #The current version of the mini_readline gem.
3
- VERSION = "0.8.0"
3
+ VERSION = "0.8.1"
4
4
  end
@@ -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(RuntimeError) {edit.readline(opts)}
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(RuntimeError) {edit.readline(opts)}
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(RuntimeError) {edit.readline(opts)}
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.0
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-07-18 00:00:00.000000000 Z
11
+ date: 2018-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake