linen 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/linen.rb +3 -3
  2. data/lib/linen/handlers/cli.rb +11 -2
  3. metadata +2 -2
@@ -16,7 +16,7 @@
16
16
  #
17
17
  # == Version
18
18
  #
19
- # $Id: linen.rb 407 2007-12-14 17:13:55Z bbleything $
19
+ # $Id: linen.rb 431 2008-01-22 23:10:52Z bbleything $
20
20
  #
21
21
 
22
22
  ### External libraries
@@ -30,8 +30,8 @@ require 'string_extensions'
30
30
 
31
31
 
32
32
  module Linen
33
- VERSION = "0.8.2"
34
- SVNRev = %q$Rev: 407 $
33
+ VERSION = "0.8.3"
34
+ SVNRev = %q$Rev: 431 $
35
35
 
36
36
 
37
37
  def self::plugins
@@ -16,7 +16,7 @@
16
16
  #
17
17
  # == Version
18
18
  #
19
- # $Id: cli.rb 407 2007-12-14 17:13:55Z bbleything $
19
+ # $Id: cli.rb 431 2008-01-22 23:10:52Z bbleything $
20
20
  #
21
21
 
22
22
  class Linen::CLI < Linen::Handler
@@ -249,9 +249,18 @@ END
249
249
 
250
250
 
251
251
  def self::prompt( prompt = "Re-enter: " )
252
+ # if the prompt is more than one line, Readline has troubles. So,
253
+ # we output the extra lines with normal puts, and then use only
254
+ # the last line as the prompt.
255
+ prompt_lines = prompt.split( "\n" )
256
+ if prompt_lines.length > 1
257
+ prompt = prompt_lines.pop
258
+ prompt_lines.each {|line| puts line }
259
+ end
260
+
252
261
  old_completion_proc = Readline.completion_proc
253
262
  Readline.completion_proc = proc {}
254
-
263
+
255
264
  input = Readline.readline( prompt )
256
265
 
257
266
  Readline.completion_proc = old_completion_proc
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: linen
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.8.2
7
- date: 2007-12-14 00:00:00 -08:00
6
+ version: 0.8.3
7
+ date: 2008-01-22 00:00:00 -08:00
8
8
  summary: Linen - A pluggable command-line interface library
9
9
  require_paths:
10
10
  - lib