diff -Nru ruby-tty-screen-0.7.1/appveyor.yml ruby-tty-screen-0.8.1/appveyor.yml --- ruby-tty-screen-0.7.1/appveyor.yml 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/appveyor.yml 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,25 @@ +--- +install: + - SET PATH=C:\Ruby%ruby_version%\bin;%PATH% + - ruby --version + - gem --version + - bundle install +build: off +test_script: + - bundle exec rake ci +environment: + matrix: + - ruby_version: "200" + - ruby_version: "200-x64" + - ruby_version: "21" + - ruby_version: "21-x64" + - ruby_version: "22" + - ruby_version: "22-x64" + - ruby_version: "23" + - ruby_version: "23-x64" + - ruby_version: "24" + - ruby_version: "24-x64" + - ruby_version: "25" + - ruby_version: "25-x64" + - ruby_version: "26" + - ruby_version: "26-x64" diff -Nru ruby-tty-screen-0.7.1/bin/console ruby-tty-screen-0.8.1/bin/console --- ruby-tty-screen-0.7.1/bin/console 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/bin/console 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +require "bundler/setup" +require "tty/screen" + +# You can add fixtures and/or initialization code here to make experimenting +# with your gem easier. You can also use a different console, if you like. + +# (If you use this, don't forget to add pry to your Gemfile!) +# require "pry" +# Pry.start + +require "irb" +IRB.start(__FILE__) diff -Nru ruby-tty-screen-0.7.1/bin/setup ruby-tty-screen-0.8.1/bin/setup --- ruby-tty-screen-0.7.1/bin/setup 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/bin/setup 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + +bundle install + +# Do any other automated setup that you need to do here diff -Nru ruby-tty-screen-0.7.1/CHANGELOG.md ruby-tty-screen-0.8.1/CHANGELOG.md --- ruby-tty-screen-0.7.1/CHANGELOG.md 2020-02-13 05:56:57.000000000 +0000 +++ ruby-tty-screen-0.8.1/CHANGELOG.md 2020-07-17 11:56:21.000000000 +0000 @@ -1,5 +1,30 @@ # Change log +## [v0.8.1] - 2020-07-17 + +### Fixed +* Fix name resolution with TTY::File by Alexey Nikitin (@tank-bohr) + +## [v0.8.0] - 2020-05-28 + +### Added +* Add #windows? platform check +* Add #command_exist? to see if an executable exists before running it +* Add performance tests + +### Changed +* Change #jruby? method to hoist within module +* Change #size_from_win_api to check only on windows platform and + hoist definition within module +* Change #size_from_java to hoist within module +* Change #size_from_ioctl to: + * check solaris-like system + * scan all streams to see if any attached to a terminal + * hoist definition within module +* Change #size_from_io_console to perform check on JRuby as well +* Change #size_from_readline to attempt to load readline gem +* Change #run_command to execute command directly without sub shell or temp files + ## [v0.7.1] - 2020-02-02 ### Changed @@ -111,6 +136,8 @@ ### Fixed * Fix bug with screen detection from_io_console by @luxflux +[v0.8.1]: https://github.com/piotrmurach/tty-screen/compare/v0.8.0...v0.8.1 +[v0.8.0]: https://github.com/piotrmurach/tty-screen/compare/v0.7.1...v0.8.0 [v0.7.1]: https://github.com/piotrmurach/tty-screen/compare/v0.7.0...v0.7.1 [v0.7.0]: https://github.com/piotrmurach/tty-screen/compare/v0.6.5...v0.7.0 [v0.6.5]: https://github.com/piotrmurach/tty-screen/compare/v0.6.4...v0.6.5 diff -Nru ruby-tty-screen-0.7.1/CODE_OF_CONDUCT.md ruby-tty-screen-0.8.1/CODE_OF_CONDUCT.md --- ruby-tty-screen-0.7.1/CODE_OF_CONDUCT.md 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/CODE_OF_CONDUCT.md 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +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. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +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. + +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. + +## Scope + +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. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at piotr@piotrmurach.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and 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. + +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. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff -Nru ruby-tty-screen-0.7.1/debian/changelog ruby-tty-screen-0.8.1/debian/changelog --- ruby-tty-screen-0.7.1/debian/changelog 2020-03-09 22:32:16.000000000 +0000 +++ ruby-tty-screen-0.8.1/debian/changelog 2022-06-03 21:20:32.000000000 +0000 @@ -1,3 +1,34 @@ +ruby-tty-screen (0.8.1-2) unstable; urgency=medium + + * Team upload + + [ Simon Chopin ] + * d/p/test-endianness.patch: cherry-picked to fix autopkgtests on big-endian + architectures, e.g. s390x (Closes: #1012204, LP: #1976464) + + [ Cédric Boutillier ] + * Bump Standards-Version to 4.6.1 (no changes needed) + + -- Cédric Boutillier Fri, 03 Jun 2022 23:20:32 +0200 + +ruby-tty-screen (0.8.1-1) unstable; urgency=low + + * Team upload. + + [ Debian Janitor ] + * Set field Upstream-Contact in debian/copyright. + * Remove obsolete fields Contact, Name from debian/upstream/metadata (already + present in machine-readable debian/copyright). + * Bump debhelper from old 12 to 13. + * Update standards version to 4.5.1, no changes needed. + + [ Athos Ribeiro ] + * New upstream version 0.8.1 + * Update standards version to 4.6.0 + * Run test suite + + -- Athos Ribeiro Thu, 21 Oct 2021 16:12:06 -0300 + ruby-tty-screen (0.7.1-2) unstable; urgency=medium * Source-only reupload to help with initial migration. diff -Nru ruby-tty-screen-0.7.1/debian/control ruby-tty-screen-0.8.1/debian/control --- ruby-tty-screen-0.7.1/debian/control 2020-03-09 22:32:16.000000000 +0000 +++ ruby-tty-screen-0.8.1/debian/control 2022-06-03 21:20:32.000000000 +0000 @@ -1,11 +1,13 @@ Source: ruby-tty-screen Section: ruby Priority: optional -Maintainer: Debian Ruby Extras Maintainers +Maintainer: Debian Ruby Team Uploaders: Gabriel Filion , -Build-Depends: debhelper-compat (= 12), +Build-Depends: debhelper-compat (= 13), gem2deb (>= 1), -Standards-Version: 4.5.0 + rake, + ruby-rspec, +Standards-Version: 4.6.1 Vcs-Git: https://salsa.debian.org/ruby-team/ruby-tty-screen.git Vcs-Browser: https://salsa.debian.org/ruby-team/ruby-tty-screen Homepage: https://ttytoolkit.org diff -Nru ruby-tty-screen-0.7.1/debian/copyright ruby-tty-screen-0.8.1/debian/copyright --- ruby-tty-screen-0.7.1/debian/copyright 2020-03-09 22:32:16.000000000 +0000 +++ ruby-tty-screen-0.8.1/debian/copyright 2022-06-03 21:20:32.000000000 +0000 @@ -1,6 +1,7 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: tty-screen Source: https://ttytoolkit.org +Upstream-Contact: https://github.com/piotrmurach/tty-screen/issues Files: * Copyright: 2014 Piotr Murach diff -Nru ruby-tty-screen-0.7.1/debian/patches/series ruby-tty-screen-0.8.1/debian/patches/series --- ruby-tty-screen-0.7.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/debian/patches/series 2022-06-03 21:20:32.000000000 +0000 @@ -0,0 +1 @@ +test-endianness.patch diff -Nru ruby-tty-screen-0.7.1/debian/patches/test-endianness.patch ruby-tty-screen-0.8.1/debian/patches/test-endianness.patch --- ruby-tty-screen-0.7.1/debian/patches/test-endianness.patch 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/debian/patches/test-endianness.patch 2022-06-03 21:20:32.000000000 +0000 @@ -0,0 +1,59 @@ +From dba351b178ae06b56985cc77a291918a0fc4aff4 Mon Sep 17 00:00:00 2001 +From: Piotr Murach +Date: Mon, 16 Aug 2021 22:13:27 +0200 +Origin: upstream, https://github.com/piotrmurach/tty-screen/commit/dba351b178ae06b56985cc77a291918a0fc4aff4 +Applied-upstream: on master branch, presumably part of upcoming 0.8.2 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ruby-tty-screen/+bug/1976464 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1012204 +Subject: [PATCH] Fix ioctl call test to stub terminal size encoding for + big-endian systems + +Fixes #13 +--- + CHANGELOG.md | 6 ++++++ + spec/unit/screen_spec.rb | 8 +++++++- + 2 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG.md b/CHANGELOG.md +index 91dd6ab..0f369bd 100644 +--- a/CHANGELOG.md ++++ b/CHANGELOG.md +@@ -1,5 +1,10 @@ + # Change log + ++## [v0.8.2] - unreleased ++ ++### Fixed ++* Fix ioctl call test to stub terminal size encoding for big-endian systems ++ + ## [v0.8.1] - 2020-07-17 + + ### Fixed +@@ -136,6 +141,7 @@ + ### Fixed + * Fix bug with screen detection from_io_console by @luxflux + ++[v0.8.2]: https://github.com/piotrmurach/tty-screen/compare/v0.8.1...v0.8.2 + [v0.8.1]: https://github.com/piotrmurach/tty-screen/compare/v0.8.0...v0.8.1 + [v0.8.0]: https://github.com/piotrmurach/tty-screen/compare/v0.7.1...v0.8.0 + [v0.7.1]: https://github.com/piotrmurach/tty-screen/compare/v0.7.0...v0.7.1 +diff --git a/spec/unit/screen_spec.rb b/spec/unit/screen_spec.rb +index 3666a3c..de78ff3 100644 +--- a/spec/unit/screen_spec.rb ++++ b/spec/unit/screen_spec.rb +@@ -6,8 +6,14 @@ def winsize + [100, 200] + end + ++ def big_endian? ++ [1].pack("S") == [1].pack("n") ++ end ++ + def ioctl(control, buf) +- buf.replace("3\x00\xD3\x00\xF2\x04\xCA\x02\x00") ++ little_endian = "3\x00\xD3\x00\xF2\x04\xCA\x02\x00" ++ big_endian = "\x003\x00\xD3\x04\xF2\x02\xCA" ++ buf.replace(big_endian? ? big_endian : little_endian) + 0 + end + end diff -Nru ruby-tty-screen-0.7.1/debian/ruby-tests.rake ruby-tty-screen-0.8.1/debian/ruby-tests.rake --- ruby-tty-screen-0.7.1/debian/ruby-tests.rake 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/debian/ruby-tests.rake 2022-06-03 21:20:32.000000000 +0000 @@ -0,0 +1,10 @@ +require 'gem2deb/rake/spectask' + +Gem2Deb::Rake::RSpecTask.new do |spec| + spec.pattern = './spec/**/*_spec.rb' + # skip the perf tests due to mising test dependencies + spec.exclude_pattern = [ + './spec/perf/size_spec.rb', + ].join ',' +end + diff -Nru ruby-tty-screen-0.7.1/debian/upstream/metadata ruby-tty-screen-0.8.1/debian/upstream/metadata --- ruby-tty-screen-0.7.1/debian/upstream/metadata 2020-03-09 22:32:16.000000000 +0000 +++ ruby-tty-screen-0.8.1/debian/upstream/metadata 2022-06-03 21:20:32.000000000 +0000 @@ -3,7 +3,5 @@ Bug-Database: https://github.com/piotrmurach/tty-screen/issues Bug-Submit: https://github.com/piotrmurach/tty-screen/issues Changelog: https://github.com/piotrmurach/tty-screen/tags -Contact: https://github.com/piotrmurach/tty-screen/issues -Name: tty-screen Repository: https://github.com/piotrmurach/tty-screen.git Repository-Browse: https://github.com/piotrmurach/tty-screen diff -Nru ruby-tty-screen-0.7.1/.editorconfig ruby-tty-screen-0.8.1/.editorconfig --- ruby-tty-screen-0.7.1/.editorconfig 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/.editorconfig 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,9 @@ +root = true + +[*.rb] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true diff -Nru ruby-tty-screen-0.7.1/Gemfile ruby-tty-screen-0.8.1/Gemfile --- ruby-tty-screen-0.7.1/Gemfile 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/Gemfile 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,13 @@ +source "https://rubygems.org" + +gemspec + +gem "coveralls", "~> 0.8.22" +gem "simplecov", "~> 0.16.1" +gem "yardstick", "~> 0.9.9" +if RUBY_VERSION.split(".")[1].to_i > 0 && !(/jruby/ =~ RUBY_ENGINE) + gem "rspec-benchmark", "~> 0.6.0" +end +if RUBY_VERSION.split(".")[1].to_i > 3 && !(/jruby/ =~ RUBY_ENGINE) + gem "io-console" +end diff -Nru ruby-tty-screen-0.7.1/.github/FUNDING.yml ruby-tty-screen-0.8.1/.github/FUNDING.yml --- ruby-tty-screen-0.7.1/.github/FUNDING.yml 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/.github/FUNDING.yml 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1 @@ +github: piotrmurach diff -Nru ruby-tty-screen-0.7.1/.github/ISSUE_TEMPLATE.md ruby-tty-screen-0.8.1/.github/ISSUE_TEMPLATE.md --- ruby-tty-screen-0.7.1/.github/ISSUE_TEMPLATE.md 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/.github/ISSUE_TEMPLATE.md 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,23 @@ +### Are you in the right place? +* For issues or feature requests file a GitHub issue in this repository +* For general questions or discussion post in [Gitter](https://gitter.im/piotrmurach/tty) + +### Describe the problem +A brief description of the issue/feature. + +### Steps to reproduce the problem +``` +Your code here to reproduce the issue +``` + +### Actual behaviour +What happened? This could be a description, log output, error raised etc... + +### Expected behaviour +What did you expect to happen? + +### Describe your environment + +* OS version: +* Ruby version: +* TTY::Screen version: diff -Nru ruby-tty-screen-0.7.1/.github/PULL_REQUEST_TEMPLATE.md ruby-tty-screen-0.8.1/.github/PULL_REQUEST_TEMPLATE.md --- ruby-tty-screen-0.7.1/.github/PULL_REQUEST_TEMPLATE.md 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/.github/PULL_REQUEST_TEMPLATE.md 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,18 @@ +### Describe the change +What does this Pull Request do? + +### Why are we doing this? +Any related context as to why is this is a desirable change. + +### Benefits +How will the library improve? + +### Drawbacks +Possible drawbacks applying this change. + +### Requirements +Put an X between brackets on each line if you have done the item: +[] Tests written & passing locally? +[] Code style checked? +[] Rebased with `master` branch? +[] Documentaion updated? diff -Nru ruby-tty-screen-0.7.1/.gitignore ruby-tty-screen-0.8.1/.gitignore --- ruby-tty-screen-0.7.1/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/.gitignore 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,14 @@ +/.bundle/ +/.yardoc +/Gemfile.lock +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ +*.bundle +*.so +*.o +*.a +mkmf.log diff -Nru ruby-tty-screen-0.7.1/lib/tty/screen/version.rb ruby-tty-screen-0.8.1/lib/tty/screen/version.rb --- ruby-tty-screen-0.7.1/lib/tty/screen/version.rb 2020-02-13 05:56:57.000000000 +0000 +++ ruby-tty-screen-0.8.1/lib/tty/screen/version.rb 2020-07-17 11:56:21.000000000 +0000 @@ -2,6 +2,6 @@ module TTY module Screen - VERSION = "0.7.1" + VERSION = "0.8.1" end # Screen end # TTY diff -Nru ruby-tty-screen-0.7.1/lib/tty/screen.rb ruby-tty-screen-0.8.1/lib/tty/screen.rb --- ruby-tty-screen-0.7.1/lib/tty/screen.rb 2020-02-13 05:56:57.000000000 +0000 +++ ruby-tty-screen-0.8.1/lib/tty/screen.rb 2020-07-17 11:56:21.000000000 +0000 @@ -1,6 +1,11 @@ -# fronzen_string_literal: true +# frozen_string_literal: true -require_relative 'screen/version' +begin + require "rbconfig" +rescue LoadError +end + +require_relative "screen/version" module TTY # Used for detecting screen properties @@ -13,6 +18,22 @@ private_class_method(name) end + case (defined?(::RbConfig) ? ::RbConfig::CONFIG["host_os"] : ::RUBY_PLATFORM) + when /mswin|msys|mingw|cygwin|bccwin|wince|emc/ + def windows?; true end + else + def windows?; false end + end + module_function :windows? + + case (defined?(::RbConfig) ? ::RbConfig::CONFIG["ruby_install_name"] : ::RUBY_ENGINE) + when /jruby/ + def jruby?; true end + else + def jruby?; false end + end + module_function :jruby? + # Default terminal size # # @api public @@ -22,10 +43,11 @@ @output = $stderr class << self + # Holds the environment variables + # @api public attr_accessor :env # Specifies an output stream - # # @api public attr_accessor :output end @@ -33,20 +55,20 @@ # Get terminal rows and columns # # @return [Array[Integer, Integer]] - # return rows & columns + # return rows and columns # # @api public - def size - size = size_from_java - size ||= size_from_win_api - size ||= size_from_ioctl - size ||= size_from_io_console - size ||= size_from_readline - size ||= size_from_tput - size ||= size_from_stty - size ||= size_from_env - size ||= size_from_ansicon - size || DEFAULT_SIZE + def size(verbose: false) + size_from_java(verbose: verbose) || + size_from_win_api(verbose: verbose) || + size_from_ioctl || + size_from_io_console(verbose: verbose) || + size_from_readline(verbose: verbose) || + size_from_tput || + size_from_stty || + size_from_env || + size_from_ansicon || + size_from_default end module_function :size @@ -70,35 +92,49 @@ module_function :rows module_function :lines - STDOUT_HANDLE = 0xFFFFFFF5 + # Default size for the terminal + # + # @return [Array[Integer, Integer]] + # + # @api private + def size_from_default + DEFAULT_SIZE + end + module_function :size_from_default # Determine terminal size with a Windows native API # # @return [nil, Array[Integer, Integer]] # # @api private - def size_from_win_api(verbose: nil) - require 'fiddle' + if windows? + STDOUT_HANDLE = 0xFFFFFFF5 - kernel32 = Fiddle::Handle.new('kernel32') - get_std_handle = Fiddle::Function.new(kernel32['GetStdHandle'], - [-Fiddle::TYPE_INT], Fiddle::TYPE_INT) - get_console_buffer_info = Fiddle::Function.new( - kernel32['GetConsoleScreenBufferInfo'], - [Fiddle::TYPE_LONG, Fiddle::TYPE_VOIDP], Fiddle::TYPE_INT) - - format = 'SSSSSssssSS' - buffer = ([0] * format.size).pack(format) - stdout_handle = get_std_handle.(STDOUT_HANDLE) - - get_console_buffer_info.(stdout_handle, buffer) - _, _, _, _, _, left, top, right, bottom, = buffer.unpack(format) - size = [bottom - top + 1, right - left + 1] - return size if nonzero_column?(size[1] - 1) - rescue LoadError - warn 'no native fiddle module found' if verbose - rescue Fiddle::DLError - # non windows platform or no kernel32 lib + def size_from_win_api(verbose: false) + require "fiddle" unless defined?(Fiddle) + + kernel32 = Fiddle::Handle.new("kernel32") + get_std_handle = Fiddle::Function.new(kernel32["GetStdHandle"], + [-Fiddle::TYPE_INT], Fiddle::TYPE_INT) + get_console_buffer_info = Fiddle::Function.new( + kernel32["GetConsoleScreenBufferInfo"], + [Fiddle::TYPE_LONG, Fiddle::TYPE_VOIDP], Fiddle::TYPE_INT) + + format = "SSSSSssssSS" + buffer = ([0] * format.size).pack(format) + stdout_handle = get_std_handle.(STDOUT_HANDLE) + + get_console_buffer_info.(stdout_handle, buffer) + _, _, _, _, _, left, top, right, bottom, = buffer.unpack(format) + size = [bottom - top + 1, right - left + 1] + return size if nonzero_column?(size[1] - 1) + rescue LoadError + warn "no native fiddle module found" if verbose + rescue Fiddle::DLError + # non windows platform or no kernel32 lib + end + else + def size_from_win_api(verbose: false); nil end end module_function :size_from_win_api @@ -107,15 +143,19 @@ # @return [nil, Array[Integer, Integer]] # # @api private - def size_from_java(verbose: nil) - return unless jruby? - require 'java' - java_import 'jline.TerminalFactory' - terminal = TerminalFactory.get - size = [terminal.get_height, terminal.get_width] - return size if nonzero_column?(size[1]) - rescue - warn 'failed to import java terminal package' if verbose + if jruby? + def size_from_java(verbose: false) + require "java" + + java_import "jline.TerminalFactory" + terminal = TerminalFactory.get + size = [terminal.get_height, terminal.get_width] + return size if nonzero_column?(size[1]) + rescue + warn "failed to import java terminal package" if verbose + end + else + def size_from_java(verbose: false); nil end end module_function :size_from_java @@ -128,62 +168,75 @@ # @return [nil, Array[Integer, Integer]] # # @api private - def size_from_io_console(verbose: nil) - return if jruby? - require 'io/console' - - begin - if @output.tty? && IO.method_defined?(:winsize) - size = @output.winsize - size if nonzero_column?(size[1]) - end - rescue Errno::EOPNOTSUPP - # no support for winsize on output - end + def size_from_io_console(verbose: false) + require "io/console" unless IO.method_defined?(:winsize) + + return unless @output.tty? && @output.respond_to?(:winsize) + + size = @output.winsize + size if nonzero_column?(size[1]) + rescue Errno::EOPNOTSUPP + # no support for winsize on output rescue LoadError - warn 'no native io/console support or io-console gem' if verbose + warn "no native io/console support or io-console gem" if verbose end module_function :size_from_io_console - TIOCGWINSZ = 0x5413 - TIOCGWINSZ_PPC = 0x40087468 + if !jruby? && @output.respond_to?(:ioctl) + TIOCGWINSZ = 0x5413 # linux + TIOCGWINSZ_PPC = 0x40087468 # macos, freedbsd, netbsd, openbsd + TIOCGWINSZ_SOL = 0x5468 # solaris - # Read terminal size from Unix ioctl - # - # @return [nil, Array[Integer, Integer]] - # - # @api private - def size_from_ioctl - return if jruby? - return unless @output.respond_to?(:ioctl) - - format = 'SSSS' - buffer = ([0] * format.size).pack(format) - if ioctl?(TIOCGWINSZ, buffer) || ioctl?(TIOCGWINSZ_PPC, buffer) - rows, cols, = buffer.unpack(format)[0..1] - return [rows, cols] if nonzero_column?(cols) + # Read terminal size from Unix ioctl + # + # @return [nil, Array[Integer, Integer]] + # + # @api private + def size_from_ioctl + format = "SSSS" + buffer = ([0] * format.size).pack(format) + + if ioctl?(TIOCGWINSZ, buffer) || + ioctl?(TIOCGWINSZ_PPC, buffer) || + ioctl?(TIOCGWINSZ_SOL, buffer) + + rows, cols, = buffer.unpack(format)[0..1] + return [rows, cols] if nonzero_column?(cols) + end end - end - module_function :size_from_ioctl - # Check if ioctl can be called and the device is attached to terminal - # - # @api private - def ioctl?(control, buf) - @output.ioctl(control, buf) >= 0 - rescue SystemCallError - false + # Check if ioctl can be called and any of the streams is + # attached to a terminal. + # + # @return [Boolean] + # True if any of the streams is attached to a terminal, false otherwise. + # + # @api private + def ioctl?(control, buf) + ($stdout.ioctl(control, buf) >= 0) || + ($stdin.ioctl(control, buf) >= 0) || + ($stderr.ioctl(control, buf) >= 0) + rescue SystemCallError + false + end + module_function :ioctl? + else + def size_from_ioctl; nil end end - module_function :ioctl? + module_function :size_from_ioctl # Detect screen size using Readline # # @api private - def size_from_readline - if defined?(Readline) && Readline.respond_to?(:get_screen_size) - size = Readline.get_screen_size - size if nonzero_column?(size[1]) - end + def size_from_readline(verbose: false) + require "readline" unless defined?(::Readline) + + return unless ::Readline.respond_to?(:get_screen_size) + + size = ::Readline.get_screen_size + size if nonzero_column?(size[1]) + rescue LoadError + warn "no readline gem" if verbose rescue NotImplementedError end module_function :size_from_readline @@ -192,11 +245,13 @@ # # @api private def size_from_tput - return unless @output.tty? - lines = run_command('tput', 'lines').to_i - cols = run_command('tput', 'cols').to_i - [lines, cols] if nonzero_column?(lines) - rescue IOError, SystemCallError + return unless @output.tty? && command_exist?("tput") + + lines = run_command("tput", "lines") + return unless lines + + cols = run_command("tput", "cols") + [lines.to_i, cols.to_i] if nonzero_column?(lines) end module_function :size_from_tput @@ -204,12 +259,13 @@ # # @api private def size_from_stty - return unless @output.tty? - out = run_command('stty', 'size') + return unless @output.tty? && command_exist?("stty") + + out = run_command("stty", "size") return unless out + size = out.split.map(&:to_i) size if nonzero_column?(size[1]) - rescue IOError, SystemCallError end module_function :size_from_stty @@ -224,8 +280,9 @@ # # @api private def size_from_env - return unless @env['COLUMNS'] =~ /^\d+$/ - size = [(@env['LINES'] || @env['ROWS']).to_i, @env['COLUMNS'].to_i] + return unless @env["COLUMNS"] =~ /^\d+$/ + + size = [(@env["LINES"] || @env["ROWS"]).to_i, @env["COLUMNS"].to_i] size if nonzero_column?(size[1]) end module_function :size_from_env @@ -234,24 +291,34 @@ # # @api private def size_from_ansicon - return unless @env['ANSICON'] =~ /\((.*)x(.*)\)/ + return unless @env["ANSICON"] =~ /\((.*)x(.*)\)/ + size = [$2, $1].map(&:to_i) size if nonzero_column?(size[1]) end module_function :size_from_ansicon + # Check if command exists + # + # @return [Boolean] + # + # @api private + def command_exist?(command) + exts = env.fetch("PATHEXT", "").split(::File::PATH_SEPARATOR) + env.fetch("PATH", "").split(::File::PATH_SEPARATOR).any? do |dir| + file = ::File.join(dir, command) + ::File.exist?(file) || exts.any? { |ext| ::File.exist?("#{file}#{ext}") } + end + end + private_module_function :command_exist? + # Runs command silently capturing the output # # @api private def run_command(*args) - require 'tempfile' - out = Tempfile.new('tty-screen') - result = system(*args, out: out.path, err: File::NULL) - return if result.nil? - out.rewind - out.read - ensure - out.close if out + %x(#{args.join(" ")}) + rescue IOError, SystemCallError + nil end private_module_function :run_command @@ -264,10 +331,5 @@ column.to_i > 0 end private_module_function :nonzero_column? - - def jruby? - RbConfig::CONFIG['ruby_install_name'] == 'jruby' - end - private_module_function :jruby? end # Screen end # TTY diff -Nru ruby-tty-screen-0.7.1/Rakefile ruby-tty-screen-0.8.1/Rakefile --- ruby-tty-screen-0.7.1/Rakefile 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/Rakefile 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,8 @@ +require "bundler/gem_tasks" + +FileList["tasks/**/*.rake"].each(&method(:import)) + +desc "Run all specs" +task ci: %w[ spec ] + +task default: :spec diff -Nru ruby-tty-screen-0.7.1/README.md ruby-tty-screen-0.8.1/README.md --- ruby-tty-screen-0.7.1/README.md 2020-02-13 05:56:57.000000000 +0000 +++ ruby-tty-screen-0.8.1/README.md 2020-07-17 11:56:21.000000000 +0000 @@ -1,5 +1,5 @@
- tty logo + tty logo
# TTY::Screen [![Gitter](https://badges.gitter.im/Join%20Chat.svg)][gitter] @@ -19,7 +19,7 @@ [coverage]: https://coveralls.io/r/piotrmurach/tty-screen [inchpages]: http://inch-ci.org/github/piotrmurach/tty-screen -> Terminal screen size detection which works on Linux, OS X and Windows/Cygwin platforms and supports MRI, JRuby and Rubinius interpreters. +> Terminal screen size detection which works on Linux, OS X and Windows/Cygwin platforms and supports MRI, JRuby, TruffleRuby and Rubinius interpreters. **TTY::Screen** provides independent terminal screen size detection component for [TTY](https://github.com/piotrmurach/tty) toolkit. diff -Nru ruby-tty-screen-0.7.1/.rspec ruby-tty-screen-0.8.1/.rspec --- ruby-tty-screen-0.7.1/.rspec 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/.rspec 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,4 @@ +--format documentation +--color +--require spec_helper +--warnings diff -Nru ruby-tty-screen-0.7.1/.rubocop.yml ruby-tty-screen-0.8.1/.rubocop.yml --- ruby-tty-screen-0.7.1/.rubocop.yml 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/.rubocop.yml 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,48 @@ +Lint/AssignmentInCondition: + Enabled: false + +Metrics/AbcSize: + Max: 30 + +Metrics/BlockLength: + CountComments: true + Max: 25 + ExcludedMethods: [] + Exclude: + - "spec/**/*" + +Metrics/ClassLength: + Max: 1500 + +Metrics/CyclomaticComplexity: + Enabled: false + +Metrics/LineLength: + Max: 80 + +Metrics/MethodLength: + Max: 20 + +Naming/BinaryOperatorParameterName: + Enabled: false + +Style/AsciiComments: + Enabled: false + +Style/LambdaCall: + SupportedStyles: + - call + - braces + +Style/StringLiterals: + EnforcedStyle: double_quotes + +Style/TrivialAccessors: + Enabled: false + +# { ... } for multi-line blocks is okay +Style/BlockDelimiters: + Enabled: false + +Style/CommentedKeyword: + Enabled: false diff -Nru ruby-tty-screen-0.7.1/spec/perf/size_spec.rb ruby-tty-screen-0.8.1/spec/perf/size_spec.rb --- ruby-tty-screen-0.7.1/spec/perf/size_spec.rb 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/spec/perf/size_spec.rb 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require "io/console" +require "rspec-benchmark" + +RSpec.describe TTY::Screen, ".size" do + include RSpec::Benchmark::Matchers + + it "detectes size 13x slower than io-console" do + expect { + TTY::Screen.size + }.to perform_slower_than { + IO.console.winsize + }.at_most(13).times + end + + it "performs at least 28K i/s" do + expect { TTY::Screen.size }.to perform_at_least(28_000).ips + end + + it "allocates at most 10 objects" do + expect { TTY::Screen.size }.to perform_allocation(10).objects + end +end diff -Nru ruby-tty-screen-0.7.1/spec/spec_helper.rb ruby-tty-screen-0.8.1/spec/spec_helper.rb --- ruby-tty-screen-0.7.1/spec/spec_helper.rb 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/spec/spec_helper.rb 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +if ENV['COVERAGE'] || ENV['TRAVIS'] + require 'simplecov' + require 'coveralls' + + SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter + ]) + + SimpleCov.start do + command_name 'spec' + add_filter 'spec' + end +end + +require 'tty-screen' + +RSpec.configure do |config| + config.expect_with :rspec do |expectations| + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + config.mock_with :rspec do |mocks| + mocks.verify_partial_doubles = true + end + + # Limits the available syntax to the non-monkey patched syntax that is recommended. + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + if config.files_to_run.one? + config.default_formatter = 'doc' + end + + config.profile_examples = 2 + + config.order = :random + + Kernel.srand config.seed +end diff -Nru ruby-tty-screen-0.7.1/spec/unit/screen_spec.rb ruby-tty-screen-0.8.1/spec/unit/screen_spec.rb --- ruby-tty-screen-0.7.1/spec/unit/screen_spec.rb 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/spec/unit/screen_spec.rb 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,274 @@ +require "delegate" + +RSpec.describe TTY::Screen do + class Output < SimpleDelegator + def winsize + [100, 200] + end + + def ioctl(control, buf) + buf.replace("3\x00\xD3\x00\xF2\x04\xCA\x02\x00") + 0 + end + end + + let(:output) { Output.new(StringIO.new("", "w+")) } + + subject(:screen) { described_class } + + describe "#size" do + it "correctly falls through choices" do + old_output = screen.output + screen.output = StringIO.new + + { + size_from_java: nil, + size_from_win_api: nil, + size_from_ioctl: nil, + size_from_io_console: [51, 280], + size_from_readline: nil + }.each do |size_method, result| + allow(screen).to receive(size_method) { result } + end + + expect(screen.size).to eq([51, 280]) + expect(screen).to have_received(:size_from_java) + expect(screen).to have_received(:size_from_win_api) + expect(screen).to have_received(:size_from_ioctl) + expect(screen).to_not have_received(:size_from_readline) + + screen.output = old_output + end + end + + describe "#size_from_win_api" do + it "doesn't check size on non-windows platform", unless: TTY::Screen.windows? do + expect(screen.size_from_win_api).to eq(nil) + end + end + + describe "#size_from_java" do + it "doesn't import java on non-jruby platform", unless: TTY::Screen.jruby? do + expect(screen.size_from_java).to eq(nil) + end + + it "imports java library on jruby", if: TTY::Screen.jruby? do + class << screen + def java_import(*args); end + end + terminal = double(:terminal, get_height: 51, get_width: 211) + factory = double(:factory, get: terminal) + stub_const("TTY::Screen::TerminalFactory", factory) + + allow(screen).to receive(:jruby?).and_return(true) + allow(screen).to receive(:require).with("java").and_return(true) + allow(screen).to receive(:java_import) + + expect(screen.size_from_java).to eq([51, 211]) + end + end + + describe "#size_from_io_console" do + it "calcualtes the size" do + old_output = screen.output + screen.output = StringIO.new + + allow(IO).to receive(:method_defined?).with(:winsize) { true } + allow(screen.output).to receive(:tty?) { true } + allow(screen.output).to receive(:respond_to?) { true } + allow(screen.output).to receive(:winsize) { [100, 200] } + + expect(screen.size_from_io_console).to eq([100, 200]) + expect(screen.output).to have_received(:winsize) + + screen.output = old_output + end + + it "doesn't calculate size if io/console not available" do + allow(IO).to receive(:method_defined?).with(:winsize).and_return(false) + allow(screen).to receive(:require).with("io/console").and_raise(LoadError) + + expect(screen.size_from_io_console).to eq(nil) + end + + it "doesn't calculate size if it is run without a console" do + allow(IO).to receive(:method_defined?).with(:winsize) { true } + allow(screen).to receive(:require).with("io/console") { true } + allow(screen.output).to receive(:tty?) { true } + allow(screen.output).to receive(:respond_to?).with(:winsize) { false } + + expect(screen.size_from_io_console).to eq(nil) + end + end + + describe "#size_from_ioctl" do + def replace_streams(*streams) + originals = [$stdout, $stdin, $stderr] + $stdout, $stdin, $stderr = output, output, output + yield + ensure + $stdout, $stdin, $stderr = *originals + end + + it "reads terminal size", unless: TTY::Screen.windows? || TTY::Screen.jruby? do + replace_streams do + expect(screen.size_from_ioctl).to eq([51, 211]) + end + end + + it "skips reading on jruby", if: TTY::Screen.jruby? do + expect(screen.size_from_ioctl).to eq(nil) + end + end + + describe "#size_from_tput" do + it "doesn't run command if outside of terminal" do + allow(screen.output).to receive(:tty?).and_return(false) + expect(screen.size_from_tput).to eq(nil) + end + + it "doesn't run command if not available" do + allow(screen).to receive(:command_exist?).and_return(false) + expect(screen.size_from_tput).to eq(nil) + end + + it "runs tput commands" do + allow(screen.output).to receive(:tty?).and_return(true) + allow(screen).to receive(:command_exist?).with("tput").and_return(true) + allow(screen).to receive(:run_command).with("tput", "lines").and_return(51) + allow(screen).to receive(:run_command).with("tput", "cols").and_return(280) + + expect(screen.size_from_tput).to eq([51, 280]) + end + + it "doesn't return zero size" do + allow(screen.output).to receive(:tty?).and_return(true) + allow(screen).to receive(:command_exist?).with("tput").and_return(true) + allow(screen).to receive(:run_command).with("tput", "lines").and_return(0) + allow(screen).to receive(:run_command).with("tput", "cols").and_return(0) + + expect(screen.size_from_tput).to eq(nil) + end + end + + describe "#size_from_stty" do + it "doesn't run command if outside of terminal" do + allow(screen.output).to receive(:tty?).and_return(false) + expect(screen.size_from_stty).to eq(nil) + end + + it "doesn't run command if not available" do + allow(screen).to receive(:command_exist?).and_return(false) + expect(screen.size_from_stty).to eq(nil) + end + + it "runs stty commands" do + allow(screen.output).to receive(:tty?).and_return(true) + allow(screen).to receive(:command_exist?).with("stty").and_return(true) + allow(screen).to receive(:run_command).with("stty", "size").and_return("51 280") + + expect(screen.size_from_stty).to eq([51, 280]) + end + + it "doesn't return zero size" do + allow(screen.output).to receive(:tty?).and_return(true) + allow(screen).to receive(:command_exist?).with("stty").and_return(true) + allow(screen).to receive(:run_command).with("stty", "size").and_return("0 0") + + expect(screen.size_from_stty).to eq(nil) + end + end + + describe "#size_from_env" do + it "doesn't calculate size without COLUMNS key" do + old_env = screen.env + screen.env = {"COLUMNS" => nil} + expect(screen.size_from_env).to eq(nil) + screen.env = old_env + end + + it "extracts lines and columns from environment" do + old_env = screen.env + screen.env = {"COLUMNS" => "280", "LINES" => "51"} + expect(screen.size_from_env).to eq([51, 280]) + screen.env = old_env + end + + it "doesn't return zero size" do + old_env = screen.env + screen.env = {"COLUMNS" => "0", "LINES" => "0"} + expect(screen.size_from_env).to eq(nil) + screen.env = old_env + end + end + + describe "#size_from_ansicon" do + it "doesn't calculate size without ANSICON key" do + old_env = screen.env + screen.env = {"ANSICON" => nil} + expect(screen.size_from_ansicon).to eq(nil) + screen.env = old_env + end + + it "extracts lines and columns from environment" do + old_env = screen.env + screen.env = {"ANSICON" => "(280x51)"} + expect(screen.size_from_ansicon).to eq([51, 280]) + screen.env = old_env + end + + it "doesn't return zero size" do + old_env = screen.env + screen.env = {"ANSICON" => "(0x0)"} + expect(screen.size_from_ansicon).to eq(nil) + screen.env = old_env + end + end + + describe "#size_from_default" do + it "suggests default terminal size" do + [:size_from_java, + :size_from_win_api, + :size_from_ioctl, + :size_from_io_console, + :size_from_readline, + :size_from_tput, + :size_from_stty, + :size_from_env, + :size_from_ansicon].each do |method| + allow(screen).to receive(method).and_return(nil) + end + expect(screen.size).to eq([27, 80]) + end + end + + describe "#width" do + it "calcualtes screen width" do + allow(screen).to receive(:size).and_return([51, 280]) + + expect(screen.width).to eq(280) + end + + it "aliases width to columns and cols" do + allow(screen).to receive(:size).and_return([51, 280]) + + expect(screen.columns).to eq(280) + expect(screen.cols).to eq(280) + end + end + + describe "#height" do + it "calcualtes screen height" do + allow(screen).to receive(:size).and_return([51, 280]) + + expect(screen.height).to eq(51) + end + + it "aliases width to rows and lines" do + allow(screen).to receive(:size).and_return([51, 280]) + + expect(screen.rows).to eq(51) + expect(screen.lines).to eq(51) + end + end +end diff -Nru ruby-tty-screen-0.7.1/tasks/console.rake ruby-tty-screen-0.8.1/tasks/console.rake --- ruby-tty-screen-0.7.1/tasks/console.rake 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/tasks/console.rake 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +desc "Load gem inside irb console" +task :console do + require "irb" + require "irb/completion" + require_relative "../lib/tty-screen" + ARGV.clear + IRB.start +end +task :c => :console diff -Nru ruby-tty-screen-0.7.1/tasks/coverage.rake ruby-tty-screen-0.8.1/tasks/coverage.rake --- ruby-tty-screen-0.7.1/tasks/coverage.rake 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/tasks/coverage.rake 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +desc "Measure code coverage" +task :coverage do + begin + original, ENV["COVERAGE"] = ENV["COVERAGE"], "true" + Rake::Task["spec"].invoke + ensure + ENV["COVERAGE"] = original + end +end diff -Nru ruby-tty-screen-0.7.1/tasks/spec.rake ruby-tty-screen-0.8.1/tasks/spec.rake --- ruby-tty-screen-0.7.1/tasks/spec.rake 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/tasks/spec.rake 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +begin + require "rspec/core/rake_task" + + desc "Run all specs" + RSpec::Core::RakeTask.new(:spec) do |task| + task.pattern = "spec/{unit,integration}{,/*/**}/*_spec.rb" + end + + namespace :spec do + desc "Run unit specs" + RSpec::Core::RakeTask.new(:unit) do |task| + task.pattern = "spec/unit{,/*/**}/*_spec.rb" + end + + desc "Run integration specs" + RSpec::Core::RakeTask.new(:integration) do |task| + task.pattern = "spec/integration{,/*/**}/*_spec.rb" + end + + desc "Run performance specs" + RSpec::Core::RakeTask.new(:perf) do |task| + task.pattern = "spec/perf{,/*/**}/*_spec.rb" + end + end + +rescue LoadError + %w[spec spec:unit spec:integration spec:perf].each do |name| + task name do + $stderr.puts "In order to run #{name}, do `gem install rspec`" + end + end +end diff -Nru ruby-tty-screen-0.7.1/.travis.yml ruby-tty-screen-0.8.1/.travis.yml --- ruby-tty-screen-0.7.1/.travis.yml 1970-01-01 00:00:00.000000000 +0000 +++ ruby-tty-screen-0.8.1/.travis.yml 2020-07-17 11:56:21.000000000 +0000 @@ -0,0 +1,26 @@ +--- +language: ruby +before_install: "gem install bundler -v '< 2.0'" +script: "bundle exec rake ci" +rvm: + - 2.0 + - 2.1 + - 2.2 + - 2.3 + - 2.4 + - 2.5 + - 2.6 + - 2.7 + - ruby-head + - jruby-9.2.11.1 + - jruby-head + - truffleruby +matrix: + allow_failures: + - rvm: ruby-head + - rvm: jruby-head + - rvm: jruby-9.2.11.1 + - rvm: truffleruby + fast_finish: true +branches: + only: master diff -Nru ruby-tty-screen-0.7.1/tty-screen.gemspec ruby-tty-screen-0.8.1/tty-screen.gemspec --- ruby-tty-screen-0.7.1/tty-screen.gemspec 2020-02-13 05:56:57.000000000 +0000 +++ ruby-tty-screen-0.8.1/tty-screen.gemspec 2020-07-17 11:56:21.000000000 +0000 @@ -1,26 +1,31 @@ -######################################################### -# This file has been automatically generated by gem2tgz # -######################################################### -# -*- encoding: utf-8 -*- -# stub: tty-screen 0.7.1 ruby lib +# frozen_string_literal: true -Gem::Specification.new do |s| - s.name = "tty-screen".freeze - s.version = "0.7.1" +require_relative "lib/tty/screen/version" - s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= - s.metadata = { "allowed_push_host" => "https://rubygems.org", "bug_tracker_uri" => "https://github.com/piotrmurach/tty-screen/issues", "changelog_uri" => "https://github.com/piotrmurach/tty-screen/blob/master/CHANGELOG.md", "documentation_uri" => "https://www.rubydoc.info/gems/tty-screen", "homepage_uri" => "https://ttytoolkit.org", "source_code_uri" => "https://github.com/piotrmurach/tty-screen" } if s.respond_to? :metadata= - s.require_paths = ["lib".freeze] - s.authors = ["Piotr Murach".freeze] - s.bindir = "exe".freeze - s.date = "2020-02-02" - s.description = "Terminal screen size detection which works on Linux, OS X and Windows/Cygwin platforms and supports MRI, JRuby and Rubinius interpreters.".freeze - s.email = ["piotr@piotrmurach.com".freeze] - s.extra_rdoc_files = ["CHANGELOG.md".freeze, "README.md".freeze] - s.files = ["CHANGELOG.md".freeze, "LICENSE.txt".freeze, "README.md".freeze, "lib/tty-screen.rb".freeze, "lib/tty/screen.rb".freeze, "lib/tty/screen/version.rb".freeze] - s.homepage = "https://ttytoolkit.org".freeze - s.licenses = ["MIT".freeze] - s.required_ruby_version = Gem::Requirement.new(">= 2.0.0".freeze) - s.rubygems_version = "2.7.6.2".freeze - s.summary = "Terminal screen size detection which works on Linux, OS X and Windows/Cygwin platforms and supports MRI, JRuby and Rubinius interpreters.".freeze +Gem::Specification.new do |spec| + spec.name = "tty-screen" + spec.version = TTY::Screen::VERSION + spec.authors = ["Piotr Murach"] + spec.email = ["piotr@piotrmurach.com"] + spec.summary = %q{Terminal screen size detection which works on Linux, OS X and Windows/Cygwin platforms and supports MRI, JRuby, TruffleRuby and Rubinius interpreters.} + spec.description = %q{Terminal screen size detection which works on Linux, OS X and Windows/Cygwin platforms and supports MRI, JRuby, TruffleRuby and Rubinius interpreters.} + spec.homepage = "https://ttytoolkit.org" + spec.license = "MIT" + if spec.respond_to?(:metadata=) + spec.metadata = { + "allowed_push_host" => "https://rubygems.org", + "bug_tracker_uri" => "https://github.com/piotrmurach/tty-screen/issues", + "changelog_uri" => "https://github.com/piotrmurach/tty-screen/blob/master/CHANGELOG.md", + "documentation_uri" => "https://www.rubydoc.info/gems/tty-screen", + "homepage_uri" => spec.homepage, + "source_code_uri" => "https://github.com/piotrmurach/tty-screen" + } + end + spec.files = Dir["lib/**/*"] + spec.extra_rdoc_files = ["README.md", "CHANGELOG.md", "LICENSE.txt"] + spec.require_paths = ["lib"] + spec.required_ruby_version = Gem::Requirement.new(">= 2.0.0") + + spec.add_development_dependency "rake" + spec.add_development_dependency "rspec", ">= 3.0" end