arika-ruby-termios 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
data/test/test0.rb ADDED
@@ -0,0 +1,29 @@
1
+ require 'termios'
2
+
3
+ def dump_termios(tio, banner)
4
+ puts banner
5
+ puts " ispeed = #{Termios::BAUDS[tio.ispeed]}, ospeed = #{Termios::BAUDS[tio.ospeed]}"
6
+ ["iflag", "oflag", "cflag", "lflag"].each do |x|
7
+ flag = tio.send(x)
8
+ flags = []
9
+ eval("Termios::#{x.upcase}S").each do |f, sym|
10
+ flags << sym.to_s if flag & f != 0
11
+ end
12
+ puts " #{x} = #{flags.sort.join(' | ')}"
13
+ end
14
+ print " cc ="
15
+ cc = tio.cc
16
+ cc.each_with_index do |x, idx|
17
+ print " #{Termios::CCINDEX[idx]}=#{x}" if Termios::CCINDEX.include?(idx)
18
+ end
19
+ puts
20
+ end
21
+
22
+ tio = Termios::getattr($stdin)
23
+ dump_termios(tio, "STDIN:")
24
+ Termios::setattr($stdin, Termios::TCSANOW, tio)
25
+ dump_termios(tio, "STDIN:")
26
+
27
+ puts
28
+ puts " pid = #{$$}"
29
+ puts "pgrp = #{Termios::getpgrp($stdin)}"
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: arika-ruby-termios
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.5
5
+ platform: ruby
6
+ authors:
7
+ - akira yamada
8
+ autorequire:
9
+ bindir: false
10
+ cert_chain: []
11
+
12
+ date: 2009-02-05 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Termios module is simple wrapper of termios(3). It can be included into IO-family classes and can extend IO-family objects. In addition, the methods can use as module function.
17
+ email: akira@arika.org
18
+ executables: []
19
+
20
+ extensions:
21
+ - extconf.rb
22
+ extra_rdoc_files:
23
+ - README
24
+ - ChangeLog
25
+ files:
26
+ - README
27
+ - ChangeLog
28
+ - test/test0.rb
29
+ - lib/termios.rb
30
+ - examples/secret_input1.rb
31
+ - examples/modem_check2.rb
32
+ - examples/modem_check0.rb
33
+ - examples/secret_input2.rb
34
+ - examples/modem_check1.rb
35
+ - termios.c
36
+ has_rdoc: true
37
+ homepage: http://arika.org/ruby/termios
38
+ post_install_message:
39
+ rdoc_options:
40
+ - --title
41
+ - ruby-termios documentation
42
+ - --charset
43
+ - utf-8
44
+ - --opname
45
+ - index.html
46
+ - --line-numbers
47
+ - --main
48
+ - README
49
+ - --inline-source
50
+ - --exclude
51
+ - ^(examples|extras)/
52
+ require_paths:
53
+ - lib
54
+ - .
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: "0"
60
+ version:
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: "0"
66
+ version:
67
+ requirements: []
68
+
69
+ rubyforge_project: termios
70
+ rubygems_version: 1.2.0
71
+ signing_key:
72
+ specification_version: 2
73
+ summary: a simple wrapper of termios(3)
74
+ test_files: []
75
+