win32console 1.2.0-x86-mswin32-60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "Win32/Console"
4
+
5
+ include Win32::Console::Constants
6
+ a = Win32::Console.new(STD_OUTPUT_HANDLE)
7
+
8
+ puts <<'EOF'
9
+ This is a simple
10
+ test of test to grab
11
+ from the console.
12
+ Hopefully this will work
13
+ easily and merrily.
14
+ This is a simple
15
+ test of test to grab
16
+ from the console.
17
+ Hopefully this will work
18
+ easily and merrily.
19
+ This is a simple
20
+ test of test to grab
21
+ from the console.
22
+ Hopefully this will work
23
+ easily and merrily.
24
+ EOF
25
+
26
+ x1 = a.ReadChar(10,10,10)
27
+ x2 = a.ReadAttr(10,10,10)
28
+ x3 = a.ReadRect(10,10,20,10)
29
+ puts "ReadChar .#{x1}."
30
+ puts x2.class, x2.size
31
+ print "ReadAttr ."
32
+ for i in x2
33
+ print "#{i}|"
34
+ end
35
+ print "\nReadRect ."
36
+
37
+ i = 0
38
+ while i < x3.length-1
39
+ print "#{x3[i]}"
40
+ i += 2
41
+ end
42
+ print "\n "
43
+ i = 1
44
+ while i < x3.length-1
45
+ print "#{x3[i]}|"
46
+ i += 2
47
+ end
48
+ print "\n"
49
+
50
+ #puts "read=",x1
51
+ #print "Attributes:",x2
52
+
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "Win32/Console"
4
+
5
+
6
+ i = 0
7
+ begin
8
+ while i < 99
9
+ if i == 10
10
+ Win32::Console::GenerateCtrlEvent()
11
+ end
12
+ i = i.next
13
+ end
14
+ rescue Exception
15
+ end
16
+
17
+ puts "if i=10, then OK! i=#{i}"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "Win32/Console"
4
+
5
+ a = Win32::Console.new()
6
+
7
+ title = a.Title()
8
+ puts "Old title: \"#{title}\""
9
+
10
+ a.Title("This is a new title")
11
+ title = a.Title()
12
+ puts "I just changed the title to '#{title}'"
13
+
14
+ sleep(5)
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ require 'rubygems'
4
+ require 'term/ansicolor'
5
+ include Term::ANSIColor
6
+ rescue LoadError
7
+ puts "You need term-ansicolor gem installed to run this test"
8
+ puts "Please 'gem install term-ansicolor' and try again."
9
+ end
10
+
11
+ require "benchmark"
12
+ require "Win32/Console/ANSI"
13
+
14
+ Benchmark.bm do |x|
15
+ num = 100
16
+ x.report("#{num} times") {
17
+ 0.upto(num) {
18
+ print "\e[2J"
19
+
20
+ print red, bold, "Usage as constants:", reset, "\n"
21
+
22
+ print clear, "clear", reset, reset, "reset", reset,
23
+ bold, "bold", reset, dark, "dark", reset,
24
+ underscore, "underscore", reset, blink, "blink", reset,
25
+ negative, "negative", reset, concealed, "concealed", reset, "|\n",
26
+ black, "black", reset, red, "red", reset, green, "green", reset,
27
+ yellow, "yellow", reset, blue, "blue", reset, magenta, "magenta", reset,
28
+ cyan, "cyan", reset, white, "white", reset, "|\n",
29
+ on_black, "on_black", reset, on_red, "on_red", reset,
30
+ on_green, "on_green", reset, on_yellow, "on_yellow", reset,
31
+ on_blue, "on_blue", reset, on_magenta, "on_magenta", reset,
32
+ on_cyan, "on_cyan", reset, on_white, "on_white", reset, "|\n\n"
33
+ print "\e[s\e[20P.................."
34
+ }
35
+ }
36
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: win32console
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.0
5
+ platform: x86-mswin32-60
6
+ authors:
7
+ - Original Library by Gonzalo Garramuno, Gem by Justin Bailey
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-11-22 00:00:00 -02:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: "This gem packages Gonzalo Garramuno's Win32::Console project, and includes a compiled binary for speed. The Win32::Console project's home can be found at: http://rubyforge.org/projects/win32console The gem project can be found at http://rubyforge.org/projects/winconsole"
17
+ email: ggarra @nospam@ advancedsl.com.ar, jgbailey @nospan@ gmail.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README.txt
24
+ - README_GEM.txt
25
+ - INSTALL.txt
26
+ - HISTORY.txt
27
+ - HISTORY_GEM.txt
28
+ files:
29
+ - doc/Console.rdoc
30
+ - doc/Console_ANSI.rdoc
31
+ - ext/Console.cpp
32
+ - ext/extconf.rb
33
+ - lib/Win32/Console/ANSI.rb
34
+ - lib/Win32/Console/api.rb
35
+ - lib/Win32/Console/constants.rb
36
+ - lib/Win32/Console.rb
37
+ - lib/win32console.rb
38
+ - test/test_cursor.rb
39
+ - test/test_mouse.rb
40
+ - test/test_readinput.rb
41
+ - test/test_readoutput.rb
42
+ - test/test_sendevent.rb
43
+ - test/test_title.rb
44
+ - test/test_write.rb
45
+ - Rakefile
46
+ - README.txt
47
+ - README_GEM.txt
48
+ - INSTALL.txt
49
+ - HISTORY.txt
50
+ - HISTORY_GEM.txt
51
+ - lib/Console.so
52
+ has_rdoc: true
53
+ homepage: http://rubyforge.org/projects/winconsole
54
+ post_install_message:
55
+ rdoc_options:
56
+ - --title
57
+ - Win32Console Gem -- Gem for Win32::Console Project
58
+ - --main
59
+ - README_GEM.txt
60
+ - --line-numbers
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ version:
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ version:
75
+ requirements: []
76
+
77
+ rubyforge_project: http://rubyforge.org/projects/winconsole
78
+ rubygems_version: 1.3.1
79
+ signing_key:
80
+ specification_version: 2
81
+ summary: A library giving the Win32 console ANSI escape sequence support.
82
+ test_files: []
83
+