rdp-rb-readline 0.2.0 → 0.2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -3
- data/lib/rbreadline.rb +10 -9
- metadata +19 -9
data/Rakefile
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'rake/packagetask'
|
2
2
|
require 'rake/testtask'
|
3
|
-
require 'lib/rbreadline'
|
4
3
|
|
5
4
|
$:.unshift File.join(File.dirname(__FILE__), 'lib')
|
6
5
|
require 'readline'
|
@@ -20,10 +19,9 @@ Rake::TestTask.new do |t|
|
|
20
19
|
t.verbose = true
|
21
20
|
end
|
22
21
|
|
23
|
-
|
24
22
|
require 'jeweler'
|
25
23
|
Jeweler::Tasks.new do |s|
|
26
|
-
s.version =
|
24
|
+
s.version = version
|
27
25
|
s.name = "rdp-rb-readline"
|
28
26
|
s.summary = "Pure Ruby readline"
|
29
27
|
s.email = "rogerdpack@gmail.com"
|
data/lib/rbreadline.rb
CHANGED
@@ -15,7 +15,7 @@ module RbReadline
|
|
15
15
|
|
16
16
|
RL_LIBRARY_VERSION = "5.2"
|
17
17
|
RL_READLINE_VERSION = 0x0502
|
18
|
-
RB_READLINE_VERSION = "0.2.0"
|
18
|
+
RB_READLINE_VERSION = "0.2.0.1"
|
19
19
|
|
20
20
|
EOF = "\xFF"
|
21
21
|
ESC = "\C-["
|
@@ -2478,7 +2478,7 @@ module RbReadline
|
|
2478
2478
|
@rl_outstream ||= $stdout
|
2479
2479
|
|
2480
2480
|
# Bind _rl_in_stream and _rl_out_stream immediately. These values
|
2481
|
-
# may change, but
|
2481
|
+
# may change, but hey may also be used before readline_internal ()
|
2482
2482
|
# is called.
|
2483
2483
|
@_rl_in_stream = @rl_instream
|
2484
2484
|
@_rl_out_stream = @rl_outstream
|
@@ -4276,6 +4276,7 @@ module RbReadline
|
|
4276
4276
|
# Cygwin will look like Windows, but we want to treat it like a Posix OS:
|
4277
4277
|
raise LoadError, "Cygwin is a Posix OS." if RUBY_PLATFORM =~ /\bcygwin\b/i
|
4278
4278
|
raise LoadError, "Not Windows" if RUBY_PLATFORM !~ /mswin|mingw/
|
4279
|
+
raise LoadError, "Using file I/O for windows" if $rb_readline_use_file_io_on_windows
|
4279
4280
|
|
4280
4281
|
if RUBY_VERSION < '1.9.1'
|
4281
4282
|
require 'Win32API'
|
@@ -4285,10 +4286,10 @@ module RbReadline
|
|
4285
4286
|
DLL = {}
|
4286
4287
|
TYPEMAP = {"0" => DL::TYPE_VOID, "S" => DL::TYPE_VOIDP, "I" => DL::TYPE_LONG}
|
4287
4288
|
|
4288
|
-
def initialize(dllname, func, import, export = "0")
|
4289
|
+
def initialize(dllname, func, import, export = "0", calltype = :stdcall)
|
4289
4290
|
@proto = [import].join.tr("VPpNnLlIi", "0SSI").sub(/^(.)0*$/, '\1')
|
4290
4291
|
handle = DLL[dllname] ||= DL.dlopen(dllname)
|
4291
|
-
@func = DL::CFunc.new(handle[func], TYPEMAP[export.tr("VPpNnLlIi", "0SSI")], func)
|
4292
|
+
@func = DL::CFunc.new(handle[func], TYPEMAP[export.tr("VPpNnLlIi", "0SSI")], func, calltype)
|
4292
4293
|
end
|
4293
4294
|
|
4294
4295
|
def call(*args)
|
@@ -4348,7 +4349,7 @@ module RbReadline
|
|
4348
4349
|
@encoding = "N"
|
4349
4350
|
end
|
4350
4351
|
|
4351
|
-
def rl_getc(stream)
|
4352
|
+
def rl_getc(stream) # windows only here
|
4352
4353
|
c = @getch.Call
|
4353
4354
|
alt = (@GetKeyState.call(VK_LMENU) & 0x80) != 0
|
4354
4355
|
if c==0 || c==0xE0
|
@@ -4380,7 +4381,7 @@ module RbReadline
|
|
4380
4381
|
@encoding = "N"
|
4381
4382
|
end
|
4382
4383
|
|
4383
|
-
def rl_getc(stream)
|
4384
|
+
def rl_getc(stream) # linux
|
4384
4385
|
begin
|
4385
4386
|
c = stream.read(1)
|
4386
4387
|
rescue Errno::EINTR
|
@@ -4399,7 +4400,7 @@ module RbReadline
|
|
4399
4400
|
end
|
4400
4401
|
end
|
4401
4402
|
|
4402
|
-
if
|
4403
|
+
if RUBY_VERSION >= '1.9'
|
4403
4404
|
@encoding = "X" # ruby 1.9.x or greater
|
4404
4405
|
@encoding_name = Encoding.default_external.to_s
|
4405
4406
|
end
|
@@ -4430,7 +4431,7 @@ module RbReadline
|
|
4430
4431
|
|
4431
4432
|
else
|
4432
4433
|
|
4433
|
-
if (c=rl_get_char()).nil?
|
4434
|
+
if (c=rl_get_char()).nil? # do we have one cached?
|
4434
4435
|
c = send(@rl_getc_function,@rl_instream)
|
4435
4436
|
end
|
4436
4437
|
end
|
@@ -6117,7 +6118,7 @@ module RbReadline
|
|
6117
6118
|
next
|
6118
6119
|
end
|
6119
6120
|
# Call the application-specific function to tell us whether
|
6120
|
-
|
6121
|
+
# this word break character is quoted and should be skipped.
|
6121
6122
|
if (@rl_char_is_quoted_p && found_quote!=0 &&
|
6122
6123
|
send(@rl_char_is_quoted_p,@rl_line_buffer, @rl_point))
|
6123
6124
|
next
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdp-rb-readline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.2.0.1
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- ""
|
@@ -9,19 +15,21 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
18
|
+
date: 2010-04-28 00:00:00 -06:00
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: jeweler
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
25
|
requirements:
|
21
26
|
- - ">="
|
22
27
|
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
23
30
|
version: "0"
|
24
|
-
|
31
|
+
type: :development
|
32
|
+
version_requirements: *id001
|
25
33
|
description:
|
26
34
|
email: rogerdpack@gmail.com
|
27
35
|
executables: []
|
@@ -59,18 +67,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
67
|
requirements:
|
60
68
|
- - ">="
|
61
69
|
- !ruby/object:Gem::Version
|
70
|
+
segments:
|
71
|
+
- 0
|
62
72
|
version: "0"
|
63
|
-
version:
|
64
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
74
|
requirements:
|
66
75
|
- - ">="
|
67
76
|
- !ruby/object:Gem::Version
|
77
|
+
segments:
|
78
|
+
- 0
|
68
79
|
version: "0"
|
69
|
-
version:
|
70
80
|
requirements: []
|
71
81
|
|
72
82
|
rubyforge_project:
|
73
|
-
rubygems_version: 1.3.
|
83
|
+
rubygems_version: 1.3.6
|
74
84
|
signing_key:
|
75
85
|
specification_version: 3
|
76
86
|
summary: Pure Ruby readline
|