fancy_irb 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/fancy_irb/terminal_info.rb +32 -19
- data/lib/fancy_irb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4f69cefc38fcb5d225c8afe57c4cbed73e2e1411c15806ed2df4f88947fa072
|
4
|
+
data.tar.gz: 1f3e2bf8dd492c48eb6e3a4b1ffd45be1f96e6f461bc6286b57c16d8b7de3ee1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60b03c1900ff6002a77e965d35eba6b1575d058c8e72efc3dc0272dca17929fb201fbae2e8a460c2059c85b2b602a9ff0a163b17610808fe51576617a6832abe
|
7
|
+
data.tar.gz: 22a9d9ffb6a8b8c0516be6fcd9ff038a0b84bb5319d6e0e6c4cdab059395f116926b09877e02de90759b8dbcfa0565f5717d774c8f95c15e12e1108416634a0f
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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 => "\
|
16
|
-
:rc => "\
|
17
|
-
:cuu1 => "\e[
|
18
|
-
:cuf1 => "\e[
|
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
|
data/lib/fancy_irb/version.rb
CHANGED