highline 1.2.9 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/LICENSE +1 -1
- data/lib/highline.rb +1 -1
- data/lib/highline/system_extensions.rb +10 -5
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
Below is a complete listing of changes for each revision of HighLine.
|
4
4
|
|
5
|
+
== 1.4.0
|
6
|
+
|
7
|
+
* Made the code grabbing terminal size a little more cross-platform by
|
8
|
+
adding support for Solaris. (patch by Ronald Braswell and Coey Minear)
|
9
|
+
|
5
10
|
== 1.2.9
|
6
11
|
|
7
12
|
* Additional work on the backspacing issue. (patch by Jeremy Hinegardner)
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= License Terms
|
2
2
|
|
3
|
-
Distributed under the user's choice of the GPL[http://www.gnu.org/
|
3
|
+
Distributed under the user's choice of the {GPL Version 2}[http://www.gnu.org/licenses/old-licenses/gpl-2.0.html] (see COPYING for details) or the
|
4
4
|
{Ruby software license}[http://www.ruby-lang.org/en/LICENSE.txt] by
|
5
5
|
James Edward Gray II and Greg Brown.
|
6
6
|
|
data/lib/highline.rb
CHANGED
@@ -20,7 +20,7 @@ class HighLine
|
|
20
20
|
# Cygwin will look like Windows, but we want to treat it like a Posix OS:
|
21
21
|
raise LoadError, "Cygwin is a Posix OS." if RUBY_PLATFORM =~ /\bcygwin\b/i
|
22
22
|
|
23
|
-
require "Win32API"
|
23
|
+
require "Win32API" # See if we're on Windows.
|
24
24
|
|
25
25
|
CHARACTER_MODE = "Win32API" # For Debugging purposes only.
|
26
26
|
|
@@ -53,9 +53,9 @@ class HighLine
|
|
53
53
|
left, top, right, bottom, maxx, maxy = buf.unpack(format)
|
54
54
|
return right - left + 1, bottom - top + 1
|
55
55
|
end
|
56
|
-
rescue LoadError
|
56
|
+
rescue LoadError # If we're not on Windows try...
|
57
57
|
begin
|
58
|
-
require "termios"
|
58
|
+
require "termios" # Unix, first choice.
|
59
59
|
|
60
60
|
CHARACTER_MODE = "termios" # For Debugging purposes only.
|
61
61
|
|
@@ -78,7 +78,7 @@ class HighLine
|
|
78
78
|
Termios.setattr(input, Termios::TCSANOW, old_settings)
|
79
79
|
end
|
80
80
|
end
|
81
|
-
rescue LoadError
|
81
|
+
rescue LoadError # If our first choice fails, default.
|
82
82
|
CHARACTER_MODE = "stty" # For Debugging purposes only.
|
83
83
|
|
84
84
|
#
|
@@ -118,7 +118,12 @@ class HighLine
|
|
118
118
|
|
119
119
|
# A Unix savvy method to fetch the console columns, and rows.
|
120
120
|
def terminal_size
|
121
|
-
|
121
|
+
if /solaris/ =~ RUBY_PLATFORM and
|
122
|
+
`stty` =~ /\brows = (\d+).*\bcolumns = (\d+)/
|
123
|
+
[$2, $1].map { |c| x.to_i }
|
124
|
+
else
|
125
|
+
`stty size`.split.map { |x| x.to_i }.reverse
|
126
|
+
end
|
122
127
|
end
|
123
128
|
end
|
124
129
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: highline
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.
|
7
|
-
date: 2007-
|
6
|
+
version: 1.4.0
|
7
|
+
date: 2007-08-07 00:00:00 -05:00
|
8
8
|
summary: HighLine is a high-level command-line IO library.
|
9
9
|
require_paths:
|
10
10
|
- lib
|