Created
December 29, 2009 20:54
-
-
Save luislavena/265593 to your computer and use it in GitHub Desktop.
Test upcoming win32console gem with auto codepage adjustment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
echo [1m[31mred bold[0m | |
echo [0m[31mred regular[0m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require 'iconv' | |
require 'Win32/Console/ANSI' | |
mode = RUBY_VERSION < "1.9" ? 'rb' : 'rb:utf-8' | |
utf = File.open('utf8.feature', mode) { |f| f.read } | |
colors = File.open('printcol.bat', mode) { |f| f.read } | |
output_cp = Win32::Console::OutputCP() | |
puts "# iconv UTF8" | |
puts Iconv.iconv("cp#{output_cp}", 'utf-8', *utf) | |
puts "# colors" | |
puts Iconv.iconv("cp#{output_cp}", 'utf-8', *colors) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Característica: adición | |
Para evitar hacer errores tontos | |
Como un matemático idiota | |
Quiero saber la suma de los números | |
Esquema del escenario: Sumar dos números | |
Dado que he introducido <entrada_1> en la calculadora | |
Y que he introducido <entrada_2> en la calculadora | |
Cuando oprimo el <botón> | |
Entonces el resultado debe ser <resultado> en la pantalla | |
Ejemplos: | |
| entrada_1 | entrada_2 | botón | resultado | | |
| 20 | 30 | add | 50 | | |
| 2 | 5 | add | 7 | | |
| 0 | 40 | add | 40 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment