fancy_irb 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 739bfe501631f6fd5f4a78e6f92dda52bb41a8ac989d769a70cbdac26f6b547c
4
- data.tar.gz: eb804f9241bd2c9e7c63e1e71b4e0aa518b0498b8d090d86977870e8502136c5
3
+ metadata.gz: a4f69cefc38fcb5d225c8afe57c4cbed73e2e1411c15806ed2df4f88947fa072
4
+ data.tar.gz: 1f3e2bf8dd492c48eb6e3a4b1ffd45be1f96e6f461bc6286b57c16d8b7de3ee1
5
5
  SHA512:
6
- metadata.gz: a3f99a944370418ab561de7ca337fde9cf1384cd7b7041a7f6342175c1b732934e09f46ebe5d0bc43984b0f3909d7e0c6f9cabbf83abe5c7228af8758d4f5ce2
7
- data.tar.gz: d60a4522e55035980b9f50fc6d0bdd36d66fc7177ad23051803a69e9f7cf38a2e4000c12f733722c2b706a699e3297e6e18f56e6efc93c0ab8800f85446c81b3
6
+ metadata.gz: 60b03c1900ff6002a77e965d35eba6b1575d058c8e72efc3dc0272dca17929fb201fbae2e8a460c2059c85b2b602a9ff0a163b17610808fe51576617a6832abe
7
+ data.tar.gz: 22a9d9ffb6a8b8c0516be6fcd9ff038a0b84bb5319d6e0e6c4cdab059395f116926b09877e02de90759b8dbcfa0565f5717d774c8f95c15e12e1108416634a0f
@@ -1,5 +1,8 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.4.0
4
+ * Full support for non-ttys
5
+
3
6
  ## 1.3.0
4
7
  * Use `script` wrapper on linux in case we are not on a tty
5
8
 
@@ -4,32 +4,45 @@ module FancyIrb
4
4
  module TerminalInfo
5
5
  def self.lines
6
6
  STDOUT.winsize[0]
7
+ rescue Errno::ENOTTY
8
+ ENV['LINES'] || ENV['ROWS'] || 25
7
9
  end
8
10
 
9
11
  def self.cols
10
12
  STDOUT.winsize[1]
13
+ rescue Errno::ENOTTY
14
+ ENV['COLUMNS'] || 80
11
15
  end
12
16
 
13
- if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
17
+ begin
18
+ if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
19
+ TPUT = {
20
+ :sc => "\e[s",
21
+ :rc => "\e[u",
22
+ :cuu1 => "\e[1A",
23
+ :cuf1 => "\e[1C",
24
+ }
25
+ elsif RbConfig::CONFIG['host_os'] =~ /linux/
26
+ TPUT = {
27
+ :sc => `script -q -e -t /dev/null -c 'tput sc'`,
28
+ :rc => `script -q -e -t /dev/null -c 'tput rc'`,
29
+ :cuu1 => `script -q -e -t /dev/null -c 'tput cuu1'`,
30
+ :cuf1 => `script -q -e -t /dev/null -c 'tput cuf1'`,
31
+ }
32
+ else
33
+ TPUT = {
34
+ :sc => `tput sc`,
35
+ :rc => `tput rc`,
36
+ :cuu1 => `tput cuu1`,
37
+ :cuf1 => `tput cuf1`,
38
+ }
39
+ end
40
+ rescue Errno::ENOTTY
14
41
  TPUT = {
15
- :sc => "\e[s",
16
- :rc => "\e[u",
17
- :cuu1 => "\e[1A",
18
- :cuf1 => "\e[1C",
19
- }
20
- elsif RbConfig::CONFIG['host_os'] =~ /linux/
21
- TPUT = {
22
- :sc => `script -q -e -t /dev/null -c 'tput sc'`,
23
- :rc => `script -q -e -t /dev/null -c 'tput rc'`,
24
- :cuu1 => `script -q -e -t /dev/null -c 'tput cuu1'`,
25
- :cuf1 => `script -q -e -t /dev/null -c 'tput cuf1'`,
26
- }
27
- else
28
- TPUT = {
29
- :sc => `tput sc`,
30
- :rc => `tput rc`,
31
- :cuu1 => `tput cuu1`,
32
- :cuf1 => `tput cuf1`,
42
+ :sc => "\e7",
43
+ :rc => "\e8",
44
+ :cuu1 => "\e[A",
45
+ :cuf1 => "\e[C",
33
46
  }
34
47
  end
35
48
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FancyIrb
4
- VERSION = '1.3.0'
4
+ VERSION = '1.4.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fancy_irb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis