Import upstream version 0.8.1+git20220812.1.e5a234c
Debian Janitor
1 year, 4 months ago
0 | |
### Are you in the right place?
|
1 | |
* For issues or feature requests file a GitHub issue in this repository
|
2 | |
* For general questions or discussion post in [Gitter](https://gitter.im/piotrmurach/tty)
|
3 | |
|
4 | |
### Describe the problem
|
5 | |
A brief description of the issue/feature.
|
6 | |
|
7 | |
### Steps to reproduce the problem
|
8 | |
```
|
9 | |
Your code here to reproduce the issue
|
10 | |
```
|
11 | |
|
12 | |
### Actual behaviour
|
13 | |
What happened? This could be a description, log output, error raised etc...
|
14 | |
|
15 | |
### Expected behaviour
|
16 | |
What did you expect to happen?
|
17 | |
|
18 | |
### Describe your environment
|
19 | |
|
20 | |
* OS version:
|
21 | |
* Ruby version:
|
22 | |
* TTY::Screen version:
|
.github/PULL_REQUEST_TEMPLATE.md
less
more
0 | |
### Describe the change
|
1 | |
What does this Pull Request do?
|
2 | |
|
3 | |
### Why are we doing this?
|
4 | |
Any related context as to why is this is a desirable change.
|
5 | |
|
6 | |
### Benefits
|
7 | |
How will the library improve?
|
8 | |
|
9 | |
### Drawbacks
|
10 | |
Possible drawbacks applying this change.
|
11 | |
|
12 | |
### Requirements
|
13 | |
Put an X between brackets on each line if you have done the item:
|
14 | |
[] Tests written & passing locally?
|
15 | |
[] Code style checked?
|
16 | |
[] Rebased with `master` branch?
|
17 | |
[] Documentaion updated?
|
0 | |
/.bundle/
|
1 | |
/.yardoc
|
2 | |
/Gemfile.lock
|
3 | |
/_yardoc/
|
4 | |
/coverage/
|
5 | |
/doc/
|
6 | |
/pkg/
|
7 | |
/spec/reports/
|
8 | |
/tmp/
|
9 | |
*.bundle
|
10 | |
*.so
|
11 | |
*.o
|
12 | |
*.a
|
13 | |
mkmf.log
|
|
0 |
AllCops:
|
|
1 |
NewCops: enable
|
|
2 |
|
|
3 |
Layout/LineLength:
|
|
4 |
Max: 80
|
|
5 |
|
0 | 6 |
Lint/AssignmentInCondition:
|
1 | 7 |
Enabled: false
|
2 | 8 |
|
|
6 | 12 |
Metrics/BlockLength:
|
7 | 13 |
CountComments: true
|
8 | 14 |
Max: 25
|
9 | |
ExcludedMethods: []
|
|
15 |
IgnoredMethods: []
|
10 | 16 |
Exclude:
|
11 | 17 |
- "spec/**/*"
|
12 | 18 |
|
|
15 | 21 |
|
16 | 22 |
Metrics/CyclomaticComplexity:
|
17 | 23 |
Enabled: false
|
18 | |
|
19 | |
Metrics/LineLength:
|
20 | |
Max: 80
|
21 | 24 |
|
22 | 25 |
Metrics/MethodLength:
|
23 | 26 |
Max: 20
|
0 | |
---
|
1 | |
language: ruby
|
2 | |
before_install: "gem install bundler -v '< 2.0'"
|
3 | |
script: "bundle exec rake ci"
|
4 | |
rvm:
|
5 | |
- 2.0
|
6 | |
- 2.1
|
7 | |
- 2.2
|
8 | |
- 2.3
|
9 | |
- 2.4
|
10 | |
- 2.5
|
11 | |
- 2.6
|
12 | |
- 2.7
|
13 | |
- ruby-head
|
14 | |
- jruby-9.2.11.1
|
15 | |
- jruby-head
|
16 | |
- truffleruby
|
17 | |
matrix:
|
18 | |
allow_failures:
|
19 | |
- rvm: ruby-head
|
20 | |
- rvm: jruby-head
|
21 | |
- rvm: jruby-9.2.11.1
|
22 | |
- rvm: truffleruby
|
23 | |
fast_finish: true
|
24 | |
branches:
|
25 | |
only: master
|
0 | 0 |
# Change log
|
|
1 |
|
|
2 |
## [v0.8.2] - unreleased
|
|
3 |
|
|
4 |
### Fixed
|
|
5 |
* Fix ioctl call test to stub terminal size encoding for big-endian systems
|
1 | 6 |
|
2 | 7 |
## [v0.8.1] - 2020-07-17
|
3 | 8 |
|
|
135 | 140 |
### Fixed
|
136 | 141 |
* Fix bug with screen detection from_io_console by @luxflux
|
137 | 142 |
|
|
143 |
[v0.8.2]: https://github.com/piotrmurach/tty-screen/compare/v0.8.1...v0.8.2
|
138 | 144 |
[v0.8.1]: https://github.com/piotrmurach/tty-screen/compare/v0.8.0...v0.8.1
|
139 | 145 |
[v0.8.0]: https://github.com/piotrmurach/tty-screen/compare/v0.7.1...v0.8.0
|
140 | 146 |
[v0.7.1]: https://github.com/piotrmurach/tty-screen/compare/v0.7.0...v0.7.1
|
1 | 1 |
|
2 | 2 |
gemspec
|
3 | 3 |
|
4 | |
gem "coveralls", "~> 0.8.22"
|
5 | |
gem "simplecov", "~> 0.16.1"
|
|
4 |
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.5.0")
|
|
5 |
gem "coveralls_reborn", "~> 0.22.0"
|
|
6 |
gem "simplecov", "~> 0.21.0"
|
|
7 |
end
|
|
8 |
gem "json", "2.4.1" if RUBY_VERSION == "2.0.0"
|
6 | 9 |
gem "yardstick", "~> 0.9.9"
|
7 | |
if RUBY_VERSION.split(".")[1].to_i > 0 && !(/jruby/ =~ RUBY_ENGINE)
|
|
10 |
|
|
11 |
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.1.0") &&
|
|
12 |
!(/jruby/ =~ RUBY_ENGINE)
|
8 | 13 |
gem "rspec-benchmark", "~> 0.6.0"
|
9 | 14 |
end
|
10 | |
if RUBY_VERSION.split(".")[1].to_i > 3 && !(/jruby/ =~ RUBY_ENGINE)
|
|
15 |
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.4.0") &&
|
|
16 |
!(/jruby/ =~ RUBY_ENGINE)
|
11 | 17 |
gem "io-console"
|
12 | 18 |
end
|
0 | |
Copyright (c) 2014 Piotr Murach
|
|
0 |
Copyright (c) 2014 Piotr Murach (piotrmurach.com)
|
1 | 1 |
|
2 | 2 |
MIT License
|
3 | 3 |
|
0 | 0 |
<div align="center">
|
1 | |
<a href="https://piotrmurach.github.io/tty" target="_blank"><img width="130" src="https://github.com/piotrmurach/tty/raw/master/images/tty.png" alt="tty logo" /></a>
|
|
1 |
<a href="https://ttytoolkit.org"><img width="130" src="https://github.com/piotrmurach/tty/raw/master/images/tty.png" alt="TTY Toolkit logo"/></a>
|
2 | 2 |
</div>
|
3 | 3 |
|
4 | 4 |
# TTY::Screen [![Gitter](https://badges.gitter.im/Join%20Chat.svg)][gitter]
|
5 | 5 |
|
6 | 6 |
[![Gem Version](https://badge.fury.io/rb/tty-screen.svg)][gem]
|
7 | |
[![Build Status](https://secure.travis-ci.org/piotrmurach/tty-screen.svg?branch=master)][travis]
|
|
7 |
[![Actions CI](https://github.com/piotrmurach/tty-screen/workflows/CI/badge.svg?branch=master)][gh_actions_ci]
|
8 | 8 |
[![Build status](https://ci.appveyor.com/api/projects/status/myjv8kahk1iwrlha?svg=true)][appveyor]
|
9 | 9 |
[![Code Climate](https://codeclimate.com/github/piotrmurach/tty-screen/badges/gpa.svg)][codeclimate]
|
10 | 10 |
[![Coverage Status](https://coveralls.io/repos/piotrmurach/tty-screen/badge.svg)][coverage]
|
|
12 | 12 |
|
13 | 13 |
[gitter]: https://gitter.im/piotrmurach/tty
|
14 | 14 |
[gem]: http://badge.fury.io/rb/tty-screen
|
15 | |
[travis]: http://travis-ci.org/piotrmurach/tty-screen
|
|
15 |
[gh_actions_ci]: https://github.com/piotrmurach/tty-screen/actions?query=workflow%3ACI
|
16 | 16 |
[appveyor]: https://ci.appveyor.com/project/piotrmurach/tty-screen
|
17 | 17 |
[codeclimate]: https://codeclimate.com/github/piotrmurach/tty-screen
|
18 | 18 |
[coverage]: https://coveralls.io/r/piotrmurach/tty-screen
|
0 | 0 |
---
|
|
1 |
skip_commits:
|
|
2 |
files:
|
|
3 |
- "bin/**"
|
|
4 |
- "*.md"
|
1 | 5 |
install:
|
2 | 6 |
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
|
3 | 7 |
- ruby --version
|
0 | 0 |
# frozen_string_literal: true
|
1 | 1 |
|
2 | |
if ENV['COVERAGE'] || ENV['TRAVIS']
|
3 | |
require 'simplecov'
|
4 | |
require 'coveralls'
|
|
2 |
if ENV["COVERAGE"] == "true"
|
|
3 |
require "simplecov"
|
|
4 |
require "coveralls"
|
5 | 5 |
|
6 | 6 |
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
7 | 7 |
SimpleCov::Formatter::HTMLFormatter,
|
|
9 | 9 |
])
|
10 | 10 |
|
11 | 11 |
SimpleCov.start do
|
12 | |
command_name 'spec'
|
13 | |
add_filter 'spec'
|
|
12 |
command_name "spec"
|
|
13 |
add_filter "spec"
|
14 | 14 |
end
|
15 | 15 |
end
|
16 | 16 |
|
17 | |
require 'tty-screen'
|
|
17 |
require "tty-screen"
|
18 | 18 |
|
19 | 19 |
RSpec.configure do |config|
|
20 | 20 |
config.expect_with :rspec do |expectations|
|
|
33 | 33 |
config.warnings = true
|
34 | 34 |
|
35 | 35 |
if config.files_to_run.one?
|
36 | |
config.default_formatter = 'doc'
|
|
36 |
config.default_formatter = "doc"
|
37 | 37 |
end
|
38 | 38 |
|
39 | 39 |
config.profile_examples = 2
|
5 | 5 |
[100, 200]
|
6 | 6 |
end
|
7 | 7 |
|
|
8 |
def big_endian?
|
|
9 |
[1].pack("S") == [1].pack("n")
|
|
10 |
end
|
|
11 |
|
8 | 12 |
def ioctl(control, buf)
|
9 | |
buf.replace("3\x00\xD3\x00\xF2\x04\xCA\x02\x00")
|
|
13 |
little_endian = "3\x00\xD3\x00\xF2\x04\xCA\x02\x00"
|
|
14 |
big_endian = "\x003\x00\xD3\x04\xF2\x02\xCA"
|
|
15 |
buf.replace(big_endian? ? big_endian : little_endian)
|
10 | 16 |
0
|
11 | 17 |
end
|
12 | 18 |
end
|