tty-reader 0.3.0 → 0.4.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
- SHA1:
3
- metadata.gz: c03f74e7241085592fa20639a1e611fcc67236e0
4
- data.tar.gz: 4e86e58a736ac624efcbb11bd4d4d09a7e80e7ed
2
+ SHA256:
3
+ metadata.gz: d01c5aa8afa041b5ceae747d42f8e94a0fb5dd63dc19f6cff8e9165caa4b014b
4
+ data.tar.gz: b37800731d9ea2f8c25658d2d8e37069b7a253fa2229214603b79e165ece3ede
5
5
  SHA512:
6
- metadata.gz: ce215884478b45022b5e44a0f464906880dedcfb059f8f265ac6a016a41a622385ef2c899bb370c8f63d3417fac4ebcfb9ac284d819e7e97220c3ad0d52ee8bf
7
- data.tar.gz: 7bf7f7e083acfefef98c5806f54c4e14398d286cb7e926f79a41ef7b4216f77d3d312074d1703a306bd4b280bccccc8e17ceb648d37e1419fada48aac10ab868
6
+ metadata.gz: e64edab17527852f8fe1caba07554adbcc9040b1cd56472c23d4b0648215bc7fcf1ad159c6cd5de6dcd79e4606b9f199da2b461ade1ed5519f3f27f3038d6189
7
+ data.tar.gz: f68401fc9bcc6e9227e58562b02cf20e4ee1a88614f87299acdcd374105daf80de4bdcce4d6dfbc12dc131139b44716070050b55f7127e2a963904f8f0a7006f
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TTY
4
4
  class Reader
5
- VERSION = '0.3.0'.freeze
5
+ VERSION = '0.4.0'.freeze
6
6
  end # Reader
7
7
  end # TTY
data/tty-reader.gemspec CHANGED
@@ -13,9 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://piotrmurach.github.io/tty"
14
14
  spec.license = "MIT"
15
15
 
16
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
- f.match(%r{^(test|spec|features)/})
18
- end
16
+ spec.files = Dir["README.md", "LICENSE.txt", "Rakefile", "lib/**/*.rb", "bin/**", "examples/**/*.rb", "tasks/**", "tty-reader.gemspec"]
19
17
  spec.bindir = "exe"
20
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
19
  spec.require_paths = ["lib"]
@@ -24,7 +22,7 @@ Gem::Specification.new do |spec|
24
22
 
25
23
  spec.add_dependency "wisper", "~> 2.0.0"
26
24
  spec.add_dependency "tty-screen", "~> 0.6.4"
27
- spec.add_dependency "tty-cursor", "~> 0.5.0"
25
+ spec.add_dependency "tty-cursor", "~> 0.6.0"
28
26
 
29
27
  spec.add_development_dependency "bundler", ">= 1.5.0", "< 2.0"
30
28
  spec.add_development_dependency "rake", "~> 12.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tty-reader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Murach
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-29 00:00:00.000000000 Z
11
+ date: 2018-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: wisper
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.5.0
47
+ version: 0.6.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.5.0
54
+ version: 0.6.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -109,18 +109,9 @@ executables: []
109
109
  extensions: []
110
110
  extra_rdoc_files: []
111
111
  files:
112
- - ".gitignore"
113
- - ".rspec"
114
- - ".travis.yml"
115
- - CHANGELOG.md
116
- - CODE_OF_CONDUCT.md
117
- - Gemfile
118
112
  - LICENSE.txt
119
113
  - README.md
120
114
  - Rakefile
121
- - appveyor.yml
122
- - benchmarks/speed_read_char.rb
123
- - benchmarks/speed_read_line.rb
124
115
  - bin/console
125
116
  - bin/setup
126
117
  - examples/keypress.rb
@@ -163,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
154
  version: '0'
164
155
  requirements: []
165
156
  rubyforge_project:
166
- rubygems_version: 2.5.1
157
+ rubygems_version: 2.7.3
167
158
  signing_key:
168
159
  specification_version: 4
169
160
  summary: A set of methods for processing keyboard input in character, line and multiline
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
-
11
- # rspec failure tracking
12
- .rspec_status
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --color
2
- --require spec_helper
3
- --warnings
data/.travis.yml DELETED
@@ -1,26 +0,0 @@
1
- ---
2
- language: ruby
3
- sudo: false
4
- cache: bundler
5
- before_install: "gem update bundler"
6
- bundler_args: --without tools
7
- script: "bundle exec rake ci"
8
- rvm:
9
- - 2.0.0
10
- - 2.1.10
11
- - 2.2.9
12
- - 2.3.6
13
- - 2.4.3
14
- - 2.5.0
15
- - ruby-head
16
- - jruby-9.1.1.0
17
- - jruby-head
18
- matrix:
19
- allow_failures:
20
- - rvm: ruby-head
21
- - rvm: jruby-head
22
- fast_finish: true
23
- branches:
24
- only: master
25
- notifications:
26
- email: false
data/CHANGELOG.md DELETED
@@ -1,38 +0,0 @@
1
- # Change log
2
-
3
- ## [v0.3.0] - 2018-04-29
4
-
5
- ### Added
6
- * Add Reader#unsubscribe to allow stop listening to local key events
7
-
8
- ### Changed
9
- * Change Reader#subscribe to allow to listening for key events only inside a block
10
- * Change to group xterm keys for navigation
11
-
12
- ## [v0.2.0] - 2018-01-01
13
-
14
- ### Added
15
- * Add home & end keys support in #read_line
16
- * Add tty-screen & tty-cursor dependencies
17
-
18
- ### Changed
19
- * Change Codes to Keys and inverse keys lookup to allow for different system keys matching same name.
20
- * Change Reader#initialize to only accept options and make input and output options as well.
21
- * Change #read_line to print newline character in noecho mode
22
- * Change Reader::Line to include prompt prefix
23
- * Change Reader#initialize to only accept options in place of positional arguments
24
- * Change Reader to expose history options
25
-
26
- ### Fixed
27
- * Fix issues with recognising :home & :end keys on different terminals
28
- * Fix #read_line to work with strings spanning multiple screen widths and allow copy-pasting a long string without repeating prompt
29
- * Fix backspace keystroke in cooked mode
30
- * Fix history to only save lines in echo mode
31
-
32
- ## [v0.1.0] - 2017-08-30
33
-
34
- * Initial implementation and release
35
-
36
- [v0.3.0]: https://github.com/piotrmurach/tty-reader/compare/v0.2.0...v0.3.0
37
- [v0.2.0]: https://github.com/piotrmurach/tty-reader/compare/v0.1.0...v0.2.0
38
- [v0.1.0]: https://github.com/piotrmurach/tty-reader/compare/v0.1.0
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at [email]. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,20 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- gemspec
6
-
7
- group :test do
8
- gem 'benchmark-ips', '~> 2.7.2'
9
- gem 'simplecov', '~> 0.14.1'
10
- gem 'coveralls', '~> 0.8.21'
11
- end
12
-
13
- group :tools do
14
- gem 'byebug', platform: :mri
15
- end
16
-
17
- group :metrics do
18
- gem 'yard', '~> 0.9.12'
19
- gem 'yardstick', '~> 0.9.9'
20
- end
data/appveyor.yml DELETED
@@ -1,23 +0,0 @@
1
- ---
2
- install:
3
- - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
4
- - ruby --version
5
- - gem --version
6
- - bundle install
7
- build: off
8
- test_script:
9
- - bundle exec rake ci
10
- environment:
11
- matrix:
12
- - ruby_version: "200"
13
- - ruby_version: "200-x64"
14
- - ruby_version: "21"
15
- - ruby_version: "21-x64"
16
- - ruby_version: "22"
17
- - ruby_version: "22-x64"
18
- - ruby_version: "23"
19
- - ruby_version: "23-x64"
20
- - ruby_version: "24"
21
- - ruby_version: "24-x64"
22
- - ruby_version: "25"
23
- - ruby_version: "25-x64"
@@ -1,34 +0,0 @@
1
- require 'benchmark/ips'
2
- require 'tty-reader'
3
-
4
- input = StringIO.new("a")
5
- output = StringIO.new
6
- $stdin = input
7
- reader = TTY::Reader.new(input, output)
8
-
9
- Benchmark.ips do |x|
10
- x.report('getc') do
11
- input.rewind
12
- $stdin.getc
13
- end
14
-
15
- x.report('read_char') do
16
- input.rewind
17
- reader.read_char
18
- end
19
-
20
- x.compare!
21
- end
22
-
23
- # v0.1.0
24
- #
25
- # Calculating -------------------------------------
26
- # getc 52462 i/100ms
27
- # read_char 751 i/100ms
28
- # -------------------------------------------------
29
- # getc 2484819.4 (±4.1%) i/s - 12433494 in 5.013438s
30
- # read_char 7736.4 (±2.9%) i/s - 39052 in 5.052628s
31
- #
32
- # Comparison:
33
- # getc: 2484819.4 i/s
34
- # read_char: 7736.4 i/s - 321.19x slower
@@ -1,34 +0,0 @@
1
- require 'benchmark/ips'
2
- require 'tty-reader'
3
-
4
- input = StringIO.new("abc\n")
5
- output = StringIO.new
6
- $stdin = input
7
- reader = TTY::Reader.new(input, output)
8
-
9
- Benchmark.ips do |x|
10
- x.report('gets') do
11
- input.rewind
12
- $stdin.gets
13
- end
14
-
15
- x.report('read_line') do
16
- input.rewind
17
- reader.read_line
18
- end
19
-
20
- x.compare!
21
- end
22
-
23
- # v0.1.0
24
- #
25
- # Calculating -------------------------------------
26
- # gets 51729 i/100ms
27
- # read_line 164 i/100ms
28
- # -------------------------------------------------
29
- # gets 1955255.2 (±3.7%) i/s - 9776781 in 5.008004s
30
- # read_line 1215.1 (±33.1%) i/s - 5248 in 5.066569s
31
- #
32
- # Comparison:
33
- # gets: 1955255.2 i/s
34
- # read_line: 1215.1 i/s - 1609.19x slower