tty-screen 0.6.1 → 0.6.2

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: 0340d9961a71554c2a8a5cdef40f5c76bc56ec15
4
- data.tar.gz: 63571f14e4a0bb74cb6f7812cf4893d9437c48de
3
+ metadata.gz: 13ab3e4f54a6a88eadd469eaf26d752bd4c8cfad
4
+ data.tar.gz: c3110f1d2d7fefa2996fed29fae0245b4094d5ad
5
5
  SHA512:
6
- metadata.gz: 676e18ee572125b044a3a570c9921e0012c6c9b091782e55d11306fc99aa1fecc99c5b9782d5deee0ec3d1d9f2071669e5712d111c55856a856480d882a16249
7
- data.tar.gz: 222b3b7e8fb05fbc737d587710039b93e65f8a4257cf3e4f329694bb7ad4d6920e4a63e58cae94c0b502f70b7a1e204cded0b454d960a449b3bef412dda71b8f
6
+ metadata.gz: 8a713c42dbb3f64ab6c1063141c812592687f28e9620641b17a4882c1a123c1b4b5f3089371ffca5c1e8db68255d23631ce9eae788b0136ec52bb5593598c27d
7
+ data.tar.gz: dac5190985f60f3049f41db637ee83802ed0fd996c7c266ed2d2affc766dcd3520cc1e594b08cf1301a02e6d1088bd0c5ecc7f818550e1aa2cf9f23dfb64cc1c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change log
2
2
 
3
+ ## [v0.6.2] - 2017-11-04
4
+
5
+ ### Fixed
6
+ * Fix #size_from_java to provide size only for non-zero values
7
+ * Fix #size_from_ioctl to provide size only for non-zero values
8
+
3
9
  ## [v0.6.1] - 2017-10-29
4
10
 
5
11
  ### Fixed
@@ -76,6 +82,7 @@
76
82
  ### Fixed
77
83
  * Fix bug with screen detection from_io_console by @luxflux
78
84
 
85
+ [v0.6.2]: https://github.com/peter-murach/tty-screen/compare/v0.6.1...v0.6.2
79
86
  [v0.6.1]: https://github.com/peter-murach/tty-screen/compare/v0.6.0...v0.6.1
80
87
  [v0.6.0]: https://github.com/peter-murach/tty-screen/compare/v0.5.1...v0.6.0
81
88
  [v0.5.1]: https://github.com/peter-murach/tty-screen/compare/v0.5.0...v0.5.1
data/lib/tty/screen.rb CHANGED
@@ -112,7 +112,8 @@ module TTY
112
112
  require 'java'
113
113
  java_import 'jline.TerminalFactory'
114
114
  terminal = TerminalFactory.get
115
- [terminal.get_height, terminal.get_width]
115
+ size = [terminal.get_height, terminal.get_width]
116
+ return size if nonzero_column?(size[1])
116
117
  rescue
117
118
  warn 'failed to import java terminal package' if verbose
118
119
  end
@@ -160,7 +161,7 @@ module TTY
160
161
  buffer = ([0] * format.size).pack(format)
161
162
  if ioctl?(TIOCGWINSZ, buffer) || ioctl?(TIOCGWINSZ_PPC, buffer)
162
163
  rows, cols, = buffer.unpack(format)[0..1]
163
- return [rows, cols]
164
+ return [rows, cols] if nonzero_column?(cols)
164
165
  end
165
166
  end
166
167
  module_function :size_from_ioctl
data/lib/tty/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module TTY
2
2
  module Screen
3
- VERSION = "0.6.1"
3
+ VERSION = "0.6.2"
4
4
  end # Screen
5
5
  end # TTY
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tty-screen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Murach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-29 00:00:00.000000000 Z
11
+ date: 2017-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler