ruby-termios 0.9.6

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,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-termios
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.6
5
+ platform: ruby
6
+ authors:
7
+ - akira yamada
8
+ autorequire:
9
+ bindir: false
10
+ cert_chain: []
11
+
12
+ date: 2009-08-28 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: |
17
+ Termios module is simple wrapper of termios(3). It can be included into
18
+ IO-family classes and can extend IO-family objects. In addition, the methods
19
+ can use as module function.
20
+
21
+ email: akira@arika.org
22
+ executables: []
23
+
24
+ extensions:
25
+ - extconf.rb
26
+ extra_rdoc_files:
27
+ - README
28
+ - ChangeLog
29
+ files:
30
+ - README
31
+ - ChangeLog
32
+ - test/test0.rb
33
+ - lib/termios.rb
34
+ - examples/secret_input1.rb
35
+ - examples/modem_check2.rb
36
+ - examples/modem_check0.rb
37
+ - examples/secret_input2.rb
38
+ - examples/modem_check1.rb
39
+ - termios.c
40
+ has_rdoc: true
41
+ homepage: http://arika.org/ruby/termios
42
+ licenses: []
43
+
44
+ post_install_message:
45
+ rdoc_options:
46
+ - --title
47
+ - ruby-termios documentation
48
+ - --charset
49
+ - utf-8
50
+ - --opname
51
+ - index.html
52
+ - --line-numbers
53
+ - --main
54
+ - README
55
+ - --inline-source
56
+ - --exclude
57
+ - ^(examples|extras)/
58
+ require_paths:
59
+ - lib
60
+ - .
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: "0"
66
+ version:
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: "0"
72
+ version:
73
+ requirements: []
74
+
75
+ rubyforge_project: termios
76
+ rubygems_version: 1.3.5
77
+ signing_key:
78
+ specification_version: 2
79
+ summary: a simple wrapper of termios(3)
80
+ test_files: []
81
+