Codebase list ruby-tty-screen / 84f6541
Import upstream version 0.8.1+git20220812.1.e5a234c Debian Janitor 1 year, 4 months ago
13 changed file(s) with 45 addition(s) and 102 deletion(s). Raw diff Collapse all Expand all
+0
-1
.github/FUNDING.yml less more
0 github: piotrmurach
+0
-23
.github/ISSUE_TEMPLATE.md less more
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:
+0
-18
.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
-14
.gitignore less more
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
06 Lint/AssignmentInCondition:
17 Enabled: false
28
612 Metrics/BlockLength:
713 CountComments: true
814 Max: 25
9 ExcludedMethods: []
15 IgnoredMethods: []
1016 Exclude:
1117 - "spec/**/*"
1218
1521
1622 Metrics/CyclomaticComplexity:
1723 Enabled: false
18
19 Metrics/LineLength:
20 Max: 80
2124
2225 Metrics/MethodLength:
2326 Max: 20
+0
-26
.travis.yml less more
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
00 # 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
16
27 ## [v0.8.1] - 2020-07-17
38
135140 ### Fixed
136141 * Fix bug with screen detection from_io_console by @luxflux
137142
143 [v0.8.2]: https://github.com/piotrmurach/tty-screen/compare/v0.8.1...v0.8.2
138144 [v0.8.1]: https://github.com/piotrmurach/tty-screen/compare/v0.8.0...v0.8.1
139145 [v0.8.0]: https://github.com/piotrmurach/tty-screen/compare/v0.7.1...v0.8.0
140146 [v0.7.1]: https://github.com/piotrmurach/tty-screen/compare/v0.7.0...v0.7.1
11
22 gemspec
33
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"
69 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)
813 gem "rspec-benchmark", "~> 0.6.0"
914 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)
1117 gem "io-console"
1218 end
0 Copyright (c) 2014 Piotr Murach
0 Copyright (c) 2014 Piotr Murach (piotrmurach.com)
11
22 MIT License
33
00 <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>
22 </div>
33
44 # TTY::Screen [![Gitter](https://badges.gitter.im/Join%20Chat.svg)][gitter]
55
66 [![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]
88 [![Build status](https://ci.appveyor.com/api/projects/status/myjv8kahk1iwrlha?svg=true)][appveyor]
99 [![Code Climate](https://codeclimate.com/github/piotrmurach/tty-screen/badges/gpa.svg)][codeclimate]
1010 [![Coverage Status](https://coveralls.io/repos/piotrmurach/tty-screen/badge.svg)][coverage]
1212
1313 [gitter]: https://gitter.im/piotrmurach/tty
1414 [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
1616 [appveyor]: https://ci.appveyor.com/project/piotrmurach/tty-screen
1717 [codeclimate]: https://codeclimate.com/github/piotrmurach/tty-screen
1818 [coverage]: https://coveralls.io/r/piotrmurach/tty-screen
00 ---
1 skip_commits:
2 files:
3 - "bin/**"
4 - "*.md"
15 install:
26 - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
37 - ruby --version
00 # frozen_string_literal: true
11
2 if ENV['COVERAGE'] || ENV['TRAVIS']
3 require 'simplecov'
4 require 'coveralls'
2 if ENV["COVERAGE"] == "true"
3 require "simplecov"
4 require "coveralls"
55
66 SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
77 SimpleCov::Formatter::HTMLFormatter,
99 ])
1010
1111 SimpleCov.start do
12 command_name 'spec'
13 add_filter 'spec'
12 command_name "spec"
13 add_filter "spec"
1414 end
1515 end
1616
17 require 'tty-screen'
17 require "tty-screen"
1818
1919 RSpec.configure do |config|
2020 config.expect_with :rspec do |expectations|
3333 config.warnings = true
3434
3535 if config.files_to_run.one?
36 config.default_formatter = 'doc'
36 config.default_formatter = "doc"
3737 end
3838
3939 config.profile_examples = 2
55 [100, 200]
66 end
77
8 def big_endian?
9 [1].pack("S") == [1].pack("n")
10 end
11
812 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)
1016 0
1117 end
1218 end