Class: Palaver::Gauge
- Inherits:
-
Base
- Object
- Base
- Palaver::Gauge
show all
- Defined in:
- lib/palaver/gauge.rb
Instance Method Summary
collapse
Methods inherited from Base
#height, #text, #width, #with_tempfile
Constructor Details
#initialize(options) ⇒ Gauge
Returns a new instance of Gauge.
7
8
9
10
|
# File 'lib/palaver/gauge.rb', line 7
def initialize(options)
@inital_percentage = 0
super(options)
end
|
Instance Method Details
#close ⇒ Object
25
26
27
|
# File 'lib/palaver/gauge.rb', line 25
def close
@pipe.close
end
|
#percentage(p) ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/palaver/gauge.rb', line 17
def percentage(p)
if @pipe then
@pipe.puts p
else
@inital_percentage = p
end
end
|
#show ⇒ Object
12
13
14
15
|
# File 'lib/palaver/gauge.rb', line 12
def show
cmd = "dialog #@common_options --gauge '#@text' #@height #@width #@inital_percentage"
@pipe = IO.popen(cmd,"w")
end
|