Class: Gem::CobblerFace
- Inherits:
-
Object
show all
- Defined in:
- lib/shoes/cobbler.rb
Defined Under Namespace
Classes: DownloadReporter
Instance Method Summary
collapse
Constructor Details
#initialize(bar, statline) ⇒ CobblerFace
57
58
59
60
61
62
|
# File 'lib/shoes/cobbler.rb', line 57
def initialize bar, statline
@prog = bar
@status = statline
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
93
94
95
96
|
# File 'lib/shoes/cobbler.rb', line 93
def method_missing(*args)
p args
nil
end
|
Instance Method Details
#alert(msg, quiz = nil) ⇒ Object
85
86
87
|
# File 'lib/shoes/cobbler.rb', line 85
def alert msg, quiz=nil
ask(quiz) if quiz
end
|
#ask(msg) ⇒ Object
73
74
75
|
# File 'lib/shoes/cobbler.rb', line 73
def ask msg
Kernel.ask(msg)
end
|
#ask_yes_no(msg) ⇒ Object
$fraction = count.to_f / total.to_f
70
71
72
|
# File 'lib/shoes/cobbler.rb', line 70
def ask_yes_no msg
Kernel.confirm(msg)
end
|
#download_reporter(*args) ⇒ Object
89
90
91
|
# File 'lib/shoes/cobbler.rb', line 89
def download_reporter(*args)
DownloadReporter.new(@prog, @status, 0, 'Downloading')
end
|
#error(msg, e) ⇒ Object
77
78
79
|
# File 'lib/shoes/cobbler.rb', line 77
def error msg, e
@status = link("Error") { Shoes.show_log }, " ", msg
end
|
#progress(count, total) ⇒ Object
66
67
68
69
|
# File 'lib/shoes/cobbler.rb', line 66
def progress count, total
@prog.fraction = count.to_f / total.to_f
end
|
#say(msg) ⇒ Object
81
82
83
|
# File 'lib/shoes/cobbler.rb', line 81
def say msg
@status.text = msg
end
|
#title(msg) ⇒ Object
63
64
65
|
# File 'lib/shoes/cobbler.rb', line 63
def title msg
@status.text = msg
end
|