rye 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/CHANGES.txt +7 -0
  2. data/README.rdoc +2 -0
  3. data/bin/rye +1 -0
  4. data/lib/rye.rb +8 -6
  5. data/lib/rye/box.rb +1 -1
  6. data/rye.gemspec +8 -47
  7. metadata +29 -52
  8. data/bin/try +0 -201
  9. data/lib/sys.rb +0 -302
  10. data/try/copying.rb +0 -18
  11. data/try/keys.rb +0 -141
  12. data/tst/10-key1 +0 -27
  13. data/tst/10-key1.pub +0 -1
  14. data/tst/10-key2 +0 -30
  15. data/tst/10-key2.pub +0 -1
  16. data/tst/10_keys_test.rb +0 -88
  17. data/tst/50_rset_test.rb +0 -54
  18. data/tst/60-file.mp3 +0 -0
  19. data/tst/60_rbox_transfer_test.rb +0 -53
  20. data/tst/70_rbox_env_test.rb +0 -19
  21. data/vendor/highline-1.5.1/CHANGELOG +0 -222
  22. data/vendor/highline-1.5.1/INSTALL +0 -35
  23. data/vendor/highline-1.5.1/LICENSE +0 -7
  24. data/vendor/highline-1.5.1/README +0 -63
  25. data/vendor/highline-1.5.1/Rakefile +0 -82
  26. data/vendor/highline-1.5.1/TODO +0 -6
  27. data/vendor/highline-1.5.1/examples/ansi_colors.rb +0 -38
  28. data/vendor/highline-1.5.1/examples/asking_for_arrays.rb +0 -18
  29. data/vendor/highline-1.5.1/examples/basic_usage.rb +0 -75
  30. data/vendor/highline-1.5.1/examples/color_scheme.rb +0 -32
  31. data/vendor/highline-1.5.1/examples/limit.rb +0 -12
  32. data/vendor/highline-1.5.1/examples/menus.rb +0 -65
  33. data/vendor/highline-1.5.1/examples/overwrite.rb +0 -19
  34. data/vendor/highline-1.5.1/examples/page_and_wrap.rb +0 -322
  35. data/vendor/highline-1.5.1/examples/password.rb +0 -7
  36. data/vendor/highline-1.5.1/examples/trapping_eof.rb +0 -22
  37. data/vendor/highline-1.5.1/examples/using_readline.rb +0 -17
  38. data/vendor/highline-1.5.1/lib/highline.rb +0 -758
  39. data/vendor/highline-1.5.1/lib/highline/color_scheme.rb +0 -120
  40. data/vendor/highline-1.5.1/lib/highline/compatibility.rb +0 -17
  41. data/vendor/highline-1.5.1/lib/highline/import.rb +0 -43
  42. data/vendor/highline-1.5.1/lib/highline/menu.rb +0 -395
  43. data/vendor/highline-1.5.1/lib/highline/question.rb +0 -463
  44. data/vendor/highline-1.5.1/lib/highline/system_extensions.rb +0 -193
  45. data/vendor/highline-1.5.1/setup.rb +0 -1360
  46. data/vendor/highline-1.5.1/test/tc_color_scheme.rb +0 -56
  47. data/vendor/highline-1.5.1/test/tc_highline.rb +0 -823
  48. data/vendor/highline-1.5.1/test/tc_import.rb +0 -54
  49. data/vendor/highline-1.5.1/test/tc_menu.rb +0 -429
  50. data/vendor/highline-1.5.1/test/ts_all.rb +0 -15
@@ -1,27 +0,0 @@
1
- -----BEGIN RSA PRIVATE KEY-----
2
- MIIEogIBAAKCAQEAzRTl7NX++irdkHdH68/JFu9EXimuih6wgfDn0cIC15isHons
3
- sxN5i7SuIDfP9zLc9QJWgfUyn0nsdOp5Di8KStvidlMnNeZUSA2YwjQUH++1z4z5
4
- bbjUixCBkn8Jv6uV+CxPeB3DFJKOrc1DKfkzf1oaUhEPPcfS78ZGM7fEW5wXX8zX
5
- OS0BnRvX9oTpQtypdm6vjcdZnW76eSudjJvk0yruV6UquEcud+RVNtJlM7uqgm2C
6
- EBhD18qxQINwTG0NFALYMaNzXKrAu6MSvk9uHof/nSk4V5IwBh+2fQAyvukpgmqv
7
- L5yYVm1mXGs4DwG9ukJ+PuGzh02sUKcGoc3yIwIBIwKCAQEAtaTLpeIcWetzyRkx
8
- ErC5bBXANiTrDJ7W2X2aIC9+3DbEVZAayn72oE+S6VYBV0pOrR9T73LGb9PCzfQ/
9
- VbSit1UKaM1OnXQ8BU3fEmikHElX47dglGHg0vFc0jYBUf5gQjXf/KyleJ8QqJE7
10
- fPKp9HRgdJLEW0qWQhYDqiZsFp6cEjaLPz1URDV3NQhc2zMa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MNecGVWQXNJrfYceQ9HyDKYC5OrRg=
27
- -----END RSA PRIVATE KEY-----
@@ -1 +0,0 @@
1
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzRTl7NX++irdkHdH68/JFu9EXimuih6wgfDn0cIC15isHonssxN5i7SuIDfP9zLc9QJWgfUyn0nsdOp5Di8KStvidlMnNeZUSA2YwjQUH++1z4z5bbjUixCBkn8Jv6uV+CxPeB3DFJKOrc1DKfkzf1oaUhEPPcfS78ZGM7fEW5wXX8zXOS0BnRvX9oTpQtypdm6vjcdZnW76eSudjJvk0yruV6UquEcud+RVNtJlM7uqgm2CEBhD18qxQINwTG0NFALYMaNzXKrAu6MSvk9uHof/nSk4V5IwBh+2fQAyvukpgmqvL5yYVm1mXGs4DwG9ukJ+PuGzh02sUKcGoc3yIw== delano@vanya.local
@@ -1,30 +0,0 @@
1
- -----BEGIN RSA PRIVATE KEY-----
2
- Proc-Type: 4,ENCRYPTED
3
- DEK-Info: DES-EDE3-CBC,A2D419194B51170A
4
-
5
- 5GWquKZfufjYD/dcjU7aZ8LauEQzJSF+o9pz8X1eeuqcJ8bc68tm7LtJP1kiPQcD
6
- vPsXCWYx3eXPSGBkYUqP0Ta6EqHRpoBnOSHKCurMMAYxrfWxECp7A6rkVALpFXR4
7
- UQcts+lAssdg15GqQnDJxDg2zQc5kiWb10NVu01kuuevLj+nqr/PC/os/vuFfPqG
8
- C+guJzmhaILqGSKNWkIuBS8lojjKHrJxyBcrLF0/yfTVPsA6TAQNRz9cDuzfnLvy
9
- HAcHKW/OgdJkoQ/D0sxEHRQLm/yqoyuxUs0vb0iQja4P1/qsjGJr6QYk2gUJETun
10
- hyvHtpUc+F059is2ezrl9RNkz1pbINp2Wz7QYVJy9NpYkI6ZieWANR4ZdrQcp0uQ
11
- lV7jS2w0UZelXe4jLFoM9sG4g28OMNZyFk+i49J74F5E8SBnYeupNoTb6Ujs7cMZ
12
- lVc47aTaT+2a/5TY043GSmo/vp18dN3Fp9u5Qu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2OqhfszpZ9nNXovw9OqqTjJ1AEf75fmfSnr4UmmUxVKHkmKTHI
29
- 3uQFtBl2ZDVctOS3vMAOQS8AlKL+u2RIt/d0LiX2jv8h4j1wg+i7Wg==
30
- -----END RSA PRIVATE KEY-----
@@ -1 +0,0 @@
1
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyWv+kF4ZZ5DzQNdXdkdoEdjeFfiQ59HxbD1WZVn6WQGAgydGR13A9X+g5eC7rNM/EAFdRaaUfgzGPh8O5ZwpuYEYfcYzDnjLlVXK0cXsGq/OUufUPcB2WaAzW8IjLFak51c92oHKrp3BPZPfFq3hTjUAgV9m8hFGTRustvkh1G+gXnuXTz/Bn9KS7kJMV6iWz5k6b4MzXaKO9S/CZxIw+VWt0F7MdIGiNfpvmPcXaAPpRiyDLpzXwrkU7eUphpK50iPSR2d1tIKtD/Jtr8PhAafzpZd6fXBK/L8/yufSFehSflMIg4BOdjk6xlC5ls9MLjbz+zZz9ZzXQg0xJ/JR6Q== delano@vanya.local
@@ -1,88 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- TEST_HOME = File.dirname(__FILE__)
4
- $:.unshift File.join(TEST_HOME, '..', 'lib')
5
-
6
- require 'rye'
7
-
8
- private_key_path = File.join(TEST_HOME, '10-key1')
9
- rpk = Rye::Key.from_file(private_key_path)
10
-
11
-
12
-
13
- puts "RYE::KEY PUBLIC KEY GOOD TIMES: #{private_key_path}", $/
14
- puts "1-2 should be the same. I don't understand why they are not."
15
- puts "3-6 should have identical key content (ignoring spaces and 'ssh-rsa')"
16
-
17
- # PKCS#1 RSAPublicKey* (PEM header: BEGIN RSA PUBLIC KEY)
18
- puts "[1] PEM encoded public key (via Rye::Key#public_key)"
19
- puts rpk.public_key.to_pem
20
- # -----BEGIN RSA PUBLIC KEY-----
21
- # MIIBCAKCAQEAzRTl7NX++irdkHdH68/JFu9EXimuih6wgfDn0cIC15isHonssxN5
22
- # i7SuIDfP9zLc9QJWgfUyn0nsdOp5Di8KStvidlMnNeZUSA2YwjQUH++1z4z5bbjU
23
- # ixCBkn8Jv6uV+CxPeB3DFJKOrc1DKfkzf1oaUhEPPcfS78ZGM7fEW5wXX8zXOS0B
24
- # nRvX9oTpQtypdm6vjcdZnW76eSudjJvk0yruV6UquEcud+RVNtJlM7uqgm2CEBhD
25
- # 18qxQINwTG0NFALYMaNzXKrAu6MSvk9uHof/nSk4V5IwBh+2fQAyvukpgmqvL5yY
26
- # Vm1mXGs4DwG9ukJ+PuGzh02sUKcGoc3yIwIBIw==
27
- # -----END RSA PUBLIC KEY-----
28
-
29
- # X.509 SubjectPublicKeyInfo** (PEM header: BEGIN PUBLIC KEY)
30
- puts $/, "[2] PEM encoded public key (via openssl rsa -in #{private_key_path} -pubout)"
31
- puts Rye.shell('openssl', "rsa -in #{private_key_path} -pubout")
32
- # -----BEGIN PUBLIC KEY-----
33
- # MIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEAzRTl7NX++irdkHdH68/J
34
- # Fu9EXimuih6wgfDn0cIC15isHonssxN5i7SuIDfP9zLc9QJWgfUyn0nsdOp5Di8K
35
- # StvidlMnNeZUSA2YwjQUH++1z4z5bbjUixCBkn8Jv6uV+CxPeB3DFJKOrc1DKfkz
36
- # f1oaUhEPPcfS78ZGM7fEW5wXX8zXOS0BnRvX9oTpQtypdm6vjcdZnW76eSudjJvk
37
- # 0yruV6UquEcud+RVNtJlM7uqgm2CEBhD18qxQINwTG0NFALYMaNzXKrAu6MSvk9u
38
- # Hof/nSk4V5IwBh+2fQAyvukpgmqvL5yYVm1mXGs4DwG9ukJ+PuGzh02sUKcGoc3y
39
- # IwIBIw==
40
- # -----END PUBLIC KEY-----
41
-
42
-
43
- puts $/, "[3] Base64 encoded"
44
- puts Base64.encode64(rpk.public_key.to_blob)
45
- # AAAAB3NzaC1yc2EAAAABIwAAAQEAzRTl7NX++irdkHdH68/JFu9EXimuih6w
46
- # gfDn0cIC15isHonssxN5i7SuIDfP9zLc9QJWgfUyn0nsdOp5Di8KStvidlMn
47
- # NeZUSA2YwjQUH++1z4z5bbjUixCBkn8Jv6uV+CxPeB3DFJKOrc1DKfkzf1oa
48
- # UhEPPcfS78ZGM7fEW5wXX8zXOS0BnRvX9oTpQtypdm6vjcdZnW76eSudjJvk
49
- # 0yruV6UquEcud+RVNtJlM7uqgm2CEBhD18qxQINwTG0NFALYMaNzXKrAu6MS
50
- # vk9uHof/nSk4V5IwBh+2fQAyvukpgmqvL5yYVm1mXGs4DwG9ukJ+PuGzh02s
51
- # UKcGoc3yIw==
52
-
53
- puts $/, "[4] Base64 encoded, SSH2 format (manual)"
54
- puts Base64.encode64(rpk.public_key.to_blob).strip.gsub(/[\r\n]/, '')
55
- # AAAAB3NzaC1yc2EAAAABIwAAAQEAzRTl7NX++irdkHdH68/JFu9EXimuih6wgfDn0cIC15isHonssxN5i7SuIDfP9zLc9QJWgfUyn0nsdOp5Di8KStvidlMnNeZUSA2YwjQUH++1z4z5bbjUixCBkn8Jv6uV+CxPeB3DFJKOrc1DKfkzf1oaUhEPPcfS78ZGM7fEW5wXX8zXOS0BnRvX9oTpQtypdm6vjcdZnW76eSudjJvk0yruV6UquEcud+RVNtJlM7uqgm2CEBhD18qxQINwTG0NFALYMaNzXKrAu6MSvk9uHof/nSk4V5IwBh+2fQAyvukpgmqvL5yYVm1mXGs4DwG9ukJ+PuGzh02sUKcGoc3yIw==
56
-
57
- puts $/, "[5] Base64 encoded, SSH2 format (via Rye::Key.public_key.to_ssh2)"
58
- puts rpk.public_key.to_ssh2
59
- # ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzRTl7NX++irdkHdH68/JFu9EXimuih6wgfDn0cIC15isHonssxN5i7SuIDfP9zLc9QJWgfUyn0nsdOp5Di8KStvidlMnNeZUSA2YwjQUH++1z4z5bbjUixCBkn8Jv6uV+CxPeB3DFJKOrc1DKfkzf1oaUhEPPcfS78ZGM7fEW5wXX8zXOS0BnRvX9oTpQtypdm6vjcdZnW76eSudjJvk0yruV6UquEcud+RVNtJlM7uqgm2CEBhD18qxQINwTG0NFALYMaNzXKrAu6MSvk9uHof/nSk4V5IwBh+2fQAyvukpgmqvL5yYVm1mXGs4DwG9ukJ+PuGzh02sUKcGoc3yIw==
60
-
61
- puts $/, "[6] Base64 encoded, SSH2 format (via ssh-keygen -y -f #{private_key_path})"
62
- puts Rye.shell('ssh-keygen', "-y -f #{private_key_path}")
63
- # ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzRTl7NX++irdkHdH68/JFu9EXimuih6wgfDn0cIC15isHonssxN5i7SuIDfP9zLc9QJWgfUyn0nsdOp5Di8KStvidlMnNeZUSA2YwjQUH++1z4z5bbjUixCBkn8Jv6uV+CxPeB3DFJKOrc1DKfkzf1oaUhEPPcfS78ZGM7fEW5wXX8zXOS0BnRvX9oTpQtypdm6vjcdZnW76eSudjJvk0yruV6UquEcud+RVNtJlM7uqgm2CEBhD18qxQINwTG0NFALYMaNzXKrAu6MSvk9uHof/nSk4V5IwBh+2fQAyvukpgmqvL5yYVm1mXGs4DwG9ukJ+PuGzh02sUKcGoc3yIw==
64
-
65
-
66
-
67
-
68
- __END__
69
-
70
- * http://cryptosys.net/pki/rsakeyformats.html
71
-
72
- Public key formats supported
73
-
74
- * PKCS#1 RSAPublicKey* (PEM header: BEGIN RSA PUBLIC KEY)
75
- * X.509 SubjectPublicKeyInfo** (PEM header: BEGIN PUBLIC KEY)
76
- * XML <RSAKeyValue>
77
-
78
- Encrypted private key format supported
79
-
80
- * PKCS#8 EncryptedPrivateKeyInfo** (PEM header: BEGIN ENCRYPTED PRIVATE KEY)
81
-
82
- Private key formats supported (unencrypted)
83
-
84
- * PKCS#1 RSAPrivateKey** (PEM header: BEGIN RSA PRIVATE KEY)
85
- * PKCS#8 PrivateKeyInfo* (PEM header: BEGIN PRIVATE KEY)
86
- * XML <RSAKeyPair> and <RSAKeyValue>
87
-
88
-
@@ -1,54 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- #
4
- # Usage: test/50_rye_test.rb
5
- #
6
-
7
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
8
-
9
- require 'benchmark'
10
- require 'rubygems'
11
- require 'stringio'
12
- require 'yaml'
13
- require 'rye'
14
-
15
-
16
- machine_key = {
17
- :host => 'localhost',
18
- :user => "delano",
19
- :key => '/proj/git/rudy/.rudy/key-test-app.private'
20
- }
21
-
22
- machine_pass = {
23
- :host => 'localhost',
24
- :user => 'delano',
25
- # :pass => 'pablo9001'
26
- }
27
-
28
- machine_local = {
29
- :host => "localhost"
30
- }
31
-
32
- rbox_key = Rye::Box.new(machine_key[:host], :user => machine_key[:user], :keys => machine_key[:key])
33
- rbox_pass = Rye::Box.new(machine_pass[:host], :user => machine_pass[:user], :password=> machine_pass[:pass])
34
- rbox_local = Rye::Box.new(machine_local[:host], :safe => false)
35
-
36
-
37
- rset_serial = Rye::Set.new("example", :parallel => false) #, :debug => STDOUT
38
- rset_parallel = Rye::Set.new("example", :parallel => true)
39
- rset_serial.add_boxes(rbox_key, rbox_local, rbox_pass)
40
- rset_parallel.add_boxes(rbox_key, rbox_local, rbox_pass)
41
-
42
- # The Rehersal will be slower because they'll include the connection time
43
- Benchmark.bmbm do |x|
44
- x.report('rbox: ') { puts "%10s:%s:%s" % [rbox_key.uname, rbox_local.uname, rbox_pass.uname] }
45
- x.report('rset-S:') { puts "%10s:%s:%s" % rset_serial.uname }
46
- x.report('rset-P:') { puts "%10s:%s:%s" % rset_parallel.uname }
47
- end
48
-
49
- # Parallel should obviously be faster here
50
- Benchmark.bmbm do |x|
51
- x.report('rbox: ') { puts "%10s:%s:%s" % [rbox_key.sleep(2), rbox_local.sleep(2), rbox_pass.sleep(2)] }
52
- x.report('rset-S:') { puts "%10s:%s:%s" % rset_serial.sleep(2) }
53
- x.report('rset-P:') { puts "%10s:%s:%s" % rset_parallel.sleep(2) }
54
- end
Binary file
@@ -1,53 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- #
4
- # Usage: test/60_rbox_upload_test.rb
5
- #
6
-
7
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
8
-
9
- require "rubygems"
10
- require "stringio"
11
- require "yaml"
12
- require "rye"
13
-
14
- tmpdir = Rye.sysinfo.tmpdir
15
-
16
- rbox = Rye::Box.new("localhost", :info => true)
17
- def rbox.rm(*args); cmd('rm', args); end
18
- rbox.rm(:r, :f, "#{tmpdir}/rye-upload") # Silently delete test dir
19
-
20
- # /tmp/rye-upload will be created if it doesn't exist
21
- rbox.upload("README.rdoc", "LICENSE.txt", "#{tmpdir}/rye-upload")
22
-
23
- # A single file can be renamed
24
- rbox.upload("README.rdoc", "#{tmpdir}/rye-upload/README-renamed")
25
-
26
- # StringIO objects can be sent as files
27
- applejack = StringIO.new
28
- applejack.puts "Delano: What's happening Applejack?"
29
- applejack.puts "Applejack: Just trying to get by."
30
- rbox.upload(applejack, "#{tmpdir}/rye-upload/applejack")
31
-
32
- rbox.upload("tst/60-file.mp3", "#{tmpdir}/rye-upload") # demonstrates
33
- rbox.upload("tst/60-file.mp3", "#{tmpdir}/rye-upload") # progress
34
- rbox.upload("tst/60-file.mp3", "#{tmpdir}/rye-upload") # bar
35
-
36
- puts "Content of /tmp/rye-upload"
37
- puts rbox.ls(:l, "#{tmpdir}/rye-upload")
38
-
39
- rbox.download("#{tmpdir}/rye-upload/README.rdoc",
40
- "#{tmpdir}/rye-upload/README-renamed", "#{tmpdir}/rye-download")
41
-
42
- # You can't download a StringIO object. This raises an exception:
43
- #rbox.download(applejack, "#{tmpdir}/rye-download/applejack")
44
- # But you can download _to_ a StringIO object
45
- applejack = StringIO.new
46
- rbox.download("#{tmpdir}/rye-upload/applejack", applejack)
47
-
48
- puts $/, "Content of /tmp/rye-download"
49
- puts rbox.ls(:l, "#{tmpdir}/rye-download")
50
-
51
- puts $/, "Content of applejack StringIO object"
52
- applejack.rewind
53
- puts applejack.read
@@ -1,19 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- #
4
- # Usage: test/70_rbox_env_test.rb
5
- #
6
-
7
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
8
-
9
- require "rubygems"
10
- require "stringio"
11
- require "yaml"
12
- require "rye"
13
-
14
- tmpdir = Rye.sysinfo.tmpdir
15
-
16
- rbox = Rye::Box.new("localhost", :info => true)
17
-
18
- puts rbox.getenv['HOME'] # slight delay while vars are fetched
19
- puts rbox.getenv['HOME'] # returned from memory
@@ -1,222 +0,0 @@
1
- = Change Log
2
-
3
- Below is a complete listing of changes for each revision of HighLine.
4
-
5
- == 1.5.1
6
-
7
- * Fixed the long standing echo true bug.
8
- (reported by Lauri Tuominen)
9
- * Improved Windows API calls to support the redirection of STDIN.
10
- (patch by Aaron Simmons)
11
- * Updated gem specification to avoid a deprecated call.
12
- * Made a minor documentation clarification about character mode support.
13
- * Worked around some API changes in Ruby's standard library in Ruby 1.9.
14
- (patch by Jake Benilov)
15
-
16
- == 1.5.0
17
-
18
- * Fixed a bug that would prevent Readline from showing all completions.
19
- (reported by Yaohan Chen)
20
- * Added the ability to pass a block to HighLine#agree().
21
- (patch by Yaohan Chen)
22
-
23
- == 1.4.0
24
-
25
- * Made the code grabbing terminal size a little more cross-platform by
26
- adding support for Solaris. (patch by Ronald Braswell and Coey Minear)
27
-
28
- == 1.2.9
29
-
30
- * Additional work on the backspacing issue. (patch by Jeremy Hinegardner)
31
- * Fixed Readline prompt bug. (patch by Jeremy Hinegardner)
32
-
33
- == 1.2.8
34
-
35
- * Fixed backspacing past the prompt and interrupting a prompt bugs.
36
- (patch by Jeremy Hinegardner)
37
-
38
- == 1.2.7
39
-
40
- * Fixed the stty indent bug.
41
- * Fixed the echo backspace bug.
42
- * Added HighLine::track_eof=() setting to work are threaded eof?() calls.
43
-
44
- == 1.2.6
45
-
46
- Patch by Jeremy Hinegardner:
47
-
48
- * Added ColorScheme support.
49
- * Added HighLine::Question.overwrite mode.
50
- * Various documentation fixes.
51
-
52
- == 1.2.5
53
-
54
- * Really fixed the bug I tried to fix in 1.2.4.
55
-
56
- == 1.2.4
57
-
58
- * Fixed a crash causing bug when using menus, reported by Patrick Hof.
59
-
60
- == 1.2.3
61
-
62
- * Treat Cygwin like a Posix OS, instead of a native Windows environment.
63
-
64
- == 1.2.2
65
-
66
- * Minor documentation corrections.
67
- * Applied Thomas Werschleiln's patch to fix termio buffering on Solaris.
68
- * Applied Justin Bailey's patch to allow canceling paged output.
69
- * Fixed a documentation bug in the description of character case settings.
70
- * Added a notice about termios in HighLine::Question#echo.
71
- * Finally working around the infamous "fast typing" bug
72
-
73
- == 1.2.1
74
-
75
- * Applied Justin Bailey's fix for the page_print() infinite loop bug.
76
- * Made a SystemExtensions module to expose OS level functionality other
77
- libraries may want to access.
78
- * Publicly exposed the get_character() method, per user requests.
79
- * Added terminal_size(), output_cols(), and output_rows() methods.
80
- * Added :auto setting for warp_at=() and page_at=().
81
-
82
- == 1.2.0
83
-
84
- * Improved RubyForge and gem spec project descriptions.
85
- * Added basic examples to README.
86
- * Added a VERSION constant.
87
- * Added support for hidden menu commands.
88
- * Added Object.or_ask() when using highline/import.
89
-
90
- == 1.0.4
91
-
92
- * Moved the HighLine project to Subversion.
93
- * HighLine's color escapes can now be disabled.
94
- * Fixed EOF bug introduced in the last release.
95
- * Updated HighLine web page.
96
- * Moved to a forked development/stable version numbering.
97
-
98
- == 1.0.2
99
-
100
- * Removed old and broken help tests.
101
- * Fixed test case typo found by David A. Black.
102
- * Added ERb escapes processing to lists, for coloring list items. Color escapes
103
- do not add to list element size.
104
- * HighLine now throws EOFError when input is exhausted.
105
-
106
- == 1.0.1
107
-
108
- * Minor bug fix: Moved help initialization to before response building, so help
109
- would show up in the default responses.
110
-
111
- == 1.0.0
112
-
113
- * Fixed documentation typo pointed out by Gavin Kistner.
114
- * Added <tt>gather = ...</tt> option to question for fetching entire Arrays or
115
- Hashes filled with answers. You can set +gather+ to a count of answers to
116
- collect, a String or Regexp matching the end of input, or a Hash where each
117
- key can be used in a new question.
118
- * Added File support to HighLine.ask(). You can specify a _directory_ and a
119
- _glob_ pattern that combine into a list of file choices the user can select
120
- from. You can choose to receive the user's answer as an open filehandle or as
121
- a Pathname object.
122
- * Added Readline support for history and editing.
123
- * Added tab completion for menu and file selection selection (requires
124
- Readline).
125
- * Added an optional character limit for input.
126
- * Added a complete help system to HighLine's shell menu creation tools.
127
-
128
- == 0.6.1
129
-
130
- * Removed termios dependancy in gem, to fix Windows' install.
131
-
132
- == 0.6.0
133
-
134
- * Implemented HighLine.choose() for menu handling.
135
- * Provided shortcut <tt>choose(item1, item2, ...)</tt> for simple menus.
136
- * Allowed Ruby code to be attached to each menu item, to create a complete
137
- menu solution.
138
- * Provided for total customization of the menu layout.
139
- * Allowed for menu selection by index, name or both.
140
- * Added a _shell_ mode to allow menu selection with additional details
141
- following the name.
142
- * Added a list() utility method that can be invoked just like color(). It can
143
- layout Arrays for you in any output in the modes <tt>:columns_across</tt>,
144
- <tt>:columns_down</tt>, <tt>:inline</tt> and <tt>:rows</tt>
145
- * Added support for <tt>echo = "*"</tt> style settings. User code can now
146
- choose the echo character this way.
147
- * Modified HighLine to user the "termios" library for character input, if
148
- available. Will return to old behavior (using "stty"), if "termios" cannot be
149
- loaded.
150
- * Improved "stty" state restoring code.
151
- * Fixed "stty" code to handle interrupt signals.
152
- * Improved the default auto-complete error message and exposed this message
153
- through the +responses+ interface as <tt>:no_completion</tt>.
154
-
155
- == 0.5.0
156
-
157
- * Implemented <tt>echo = false</tt> for HighLine::Question objects, primarily to
158
- make fetching passwords trivial.
159
- * Fixed an auto-complete bug that could cause a crash when the user gave an
160
- answer that didn't complete to any valid choice.
161
- * Implemented +case+ for HighLine::Question objects to provide character case
162
- conversions on given answers. Can be set to <tt>:up</tt>, <tt>:down</tt>, or
163
- <tt>:capitalize</tt>.
164
- * Exposed <tt>@answer</tt> to the response system, to allow response that are
165
- aware of incorrect input.
166
- * Implemented +confirm+ for HighLine::Question objects to allow for verification
167
- for sensitive user choices. If set to +true+, user will have to answer an
168
- "Are you sure? " question. Can also be set to the question to confirm with
169
- the user.
170
-
171
- == 0.4.0
172
-
173
- * Added <tt>@wrap_at</tt> and <tt>@page_at</tt> settings and accessors to
174
- HighLine, to control text flow.
175
- * Implemented line wrapping with adjustable limit.
176
- * Implemented paged printing with adjustable limit.
177
-
178
- == 0.3.0
179
-
180
- * Added support for installing with setup.rb.
181
- * All output is now treated as an ERb sequence, allowing Ruby code to be
182
- embedded in output strings.
183
- * Added support for ANSI color sequences in say(). (And everything else
184
- by extension.)
185
- * Added whitespace handling for answers. Can be set to <tt>:strip</tt>,
186
- <tt>:chomp</tt>, <tt>:collapse</tt>, <tt>:strip_and_collapse</tt>,
187
- <tt>:chomp_and_collapse</tt>, <tt>:remove</tt>, or <tt>:none</tt>.
188
- * Exposed question details to ERb completion through @question, to allow for
189
- intelligent responses.
190
- * Simplified HighLine internals using @question.
191
- * Added support for fetching single character input either with getc() or
192
- HighLine's own cross-platform terminal input routine.
193
- * Improved type conversion to handle user defined classes.
194
-
195
- == 0.2.0
196
-
197
- * Added Unit Tests to cover an already fixed output bug in the future.
198
- * Added Rakefile and setup test action (default).
199
- * Renamed HighLine::Answer to HighLine::Question to better illustrate its role.
200
- * Renamed fetch_line() to get_response() to better define its goal.
201
- * Simplified explain_error in terms of the Question object.
202
- * Renamed accept?() to in_range?() to better define purpose.
203
- * Reworked valid?() into valid_answer?() to better fit Question object.
204
- * Reworked <tt>@member</tt> into <tt>@in</tt>, to make it easier to remember and
205
- switched implementation to include?().
206
- * Added range checks for @above and @below.
207
- * Fixed the bug causing ask() to swallow NoMethodErrors.
208
- * Rolled ask_on_error() into responses.
209
- * Redirected imports to Kernel from Object.
210
- * Added support for <tt>validate = lambda { ... }</tt>.
211
- * Added default answer support.
212
- * Fixed bug that caused ask() to die with an empty question.
213
- * Added complete documentation.
214
- * Improve the implemetation of agree() to be the intended "yes" or "no" only
215
- question.
216
- * Added Rake tasks for documentation and packaging.
217
- * Moved project to RubyForge.
218
-
219
- == 0.1.0
220
-
221
- * Initial release as the solution to
222
- {Ruby Quiz #29}[http://www.rubyquiz.com/quiz29.html].