io-console 0.5.11-java → 0.7.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.document +4 -0
- data/lib/{io/console/ffi → ffi/io/console}/linux_console.rb +3 -1
- data/lib/{io/console/ffi → ffi/io/console}/native_console.rb +3 -3
- data/lib/ffi/io/console/version.rb +3 -0
- data/lib/{io/console/ffi → ffi/io}/console.rb +6 -5
- metadata +13 -11
- data/lib/io/console.rb +0 -5
- /data/lib/{io/console/ffi → ffi/io/console}/bsd_console.rb +0 -0
- /data/lib/{io/console/ffi → ffi/io/console}/common.rb +0 -0
- /data/lib/{io/console/ffi → ffi/io/console}/stty_console.rb +0 -0
- /data/lib/{io/console/ffi → ffi/io/console}/stub_console.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04e00fc2882d045d482efb00903a0546b330a73d95893e92667be4de4cd6d6cb
|
4
|
+
data.tar.gz: 18da261f918fdd309e6bc61746befd93b86e60733803c7f35957ff5b2d3babee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f04f40af8db7d89dc11cc16a6cd8be87c70bcfc62aef2c5728cbc1e820d9076fa741d345f22dc80370f609970279d3ab28a560ec394830937fb7a9e5584df9a
|
7
|
+
data.tar.gz: 95b66a4722edd2e29a5e102857738e610ce848e3e7bbf9f6614079b357726f70e510d606cb6dac10d48a9febf945ab414607bbf99cd40e4886f2e607306a4f14
|
data/.document
ADDED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'ffi'
|
2
2
|
|
3
|
-
|
3
|
+
unless FFI::Platform::ARCH =~ /i386|x86_64|powerpc64|aarch64|s390x/
|
4
|
+
raise LoadError.new("native console only supported on i386, x86_64, powerpc64, aarch64 and s390x")
|
5
|
+
end
|
4
6
|
|
5
7
|
module IO::LibC
|
6
8
|
extend FFI::Library
|
@@ -13,13 +13,13 @@ class IO
|
|
13
13
|
def ttymode
|
14
14
|
termios = LibC::Termios.new
|
15
15
|
if LibC.tcgetattr(self.fileno, termios) != 0
|
16
|
-
raise SystemCallError.new(path, FFI.errno)
|
16
|
+
raise SystemCallError.new(respond_to?(:path) ? path : "tcgetattr", FFI.errno)
|
17
17
|
end
|
18
18
|
|
19
19
|
if block_given?
|
20
20
|
yield tmp = termios.dup
|
21
21
|
if LibC.tcsetattr(self.fileno, LibC::TCSANOW, tmp) != 0
|
22
|
-
raise SystemCallError.new(path, FFI.errno)
|
22
|
+
raise SystemCallError.new(respond_to?(:path) ? path : "tcsetattr(TCSANOW)", FFI.errno)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
termios
|
@@ -32,7 +32,7 @@ class IO
|
|
32
32
|
block.call(self)
|
33
33
|
ensure
|
34
34
|
if orig_termios && LibC.tcsetattr(self.fileno, LibC::TCSANOW, orig_termios) != 0
|
35
|
-
raise SystemCallError.new(path, FFI.errno)
|
35
|
+
raise SystemCallError.new(respond_to?(:path) ? path : "tcsetattr(TCSANOW)", FFI.errno)
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -21,11 +21,12 @@
|
|
21
21
|
|
22
22
|
require 'rbconfig'
|
23
23
|
|
24
|
-
require_relative '
|
24
|
+
require_relative 'console/version'
|
25
|
+
require_relative 'console/common'
|
25
26
|
|
26
27
|
# If Windows, always use the stub version
|
27
28
|
if RbConfig::CONFIG['host_os'] =~ /(mswin)|(win32)|(ming)/
|
28
|
-
require_relative 'stub_console'
|
29
|
+
require_relative 'console/stub_console'
|
29
30
|
else
|
30
31
|
|
31
32
|
# If Linux or BSD, try to load the native version
|
@@ -33,7 +34,7 @@ else
|
|
33
34
|
begin
|
34
35
|
|
35
36
|
# Attempt to load the native Linux and BSD console logic
|
36
|
-
require_relative 'native_console'
|
37
|
+
require_relative 'console/native_console'
|
37
38
|
ready = true
|
38
39
|
|
39
40
|
rescue Exception => ex
|
@@ -48,7 +49,7 @@ else
|
|
48
49
|
if !ready
|
49
50
|
begin
|
50
51
|
|
51
|
-
require_relative 'stty_console'
|
52
|
+
require_relative 'console/stty_console'
|
52
53
|
ready = true
|
53
54
|
|
54
55
|
rescue Exception
|
@@ -61,7 +62,7 @@ else
|
|
61
62
|
|
62
63
|
# If still not ready, just use stubbed version
|
63
64
|
if !ready
|
64
|
-
require_relative 'stub_console'
|
65
|
+
require_relative 'console/stub_console'
|
65
66
|
end
|
66
67
|
|
67
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: io-console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Nobu Nakada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: add console capabilities to IO instances.
|
14
14
|
email: nobu@ruby-lang.org
|
@@ -16,16 +16,17 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- ".document"
|
19
20
|
- LICENSE.txt
|
20
21
|
- README.md
|
21
|
-
- lib/io/console.rb
|
22
|
-
- lib/io/console/
|
23
|
-
- lib/io/console/
|
24
|
-
- lib/io/console/
|
25
|
-
- lib/io/console/
|
26
|
-
- lib/io/console/
|
27
|
-
- lib/io/console/
|
28
|
-
- lib/io/console/
|
22
|
+
- lib/ffi/io/console.rb
|
23
|
+
- lib/ffi/io/console/bsd_console.rb
|
24
|
+
- lib/ffi/io/console/common.rb
|
25
|
+
- lib/ffi/io/console/linux_console.rb
|
26
|
+
- lib/ffi/io/console/native_console.rb
|
27
|
+
- lib/ffi/io/console/stty_console.rb
|
28
|
+
- lib/ffi/io/console/stub_console.rb
|
29
|
+
- lib/ffi/io/console/version.rb
|
29
30
|
- lib/io/console/size.rb
|
30
31
|
homepage: https://github.com/ruby/io-console
|
31
32
|
licenses:
|
@@ -36,6 +37,7 @@ metadata:
|
|
36
37
|
post_install_message:
|
37
38
|
rdoc_options: []
|
38
39
|
require_paths:
|
40
|
+
- lib/ffi
|
39
41
|
- lib
|
40
42
|
required_ruby_version: !ruby/object:Gem::Requirement
|
41
43
|
requirements:
|
@@ -48,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
50
|
- !ruby/object:Gem::Version
|
49
51
|
version: '0'
|
50
52
|
requirements: []
|
51
|
-
rubygems_version: 3.
|
53
|
+
rubygems_version: 3.5.0.dev
|
52
54
|
signing_key:
|
53
55
|
specification_version: 4
|
54
56
|
summary: Console interface
|
data/lib/io/console.rb
DELETED
File without changes
|
File without changes
|
File without changes
|
File without changes
|