Class: Gem::ShoesFace

Inherits:
Object
  • Object
show all
Defined in:
lib/shoes/setup.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ ShoesFace



289
290
291
# File 'lib/shoes/setup.rb', line 289

def initialize app
  @title, @status, @prog, = app.slot.contents[-1].contents
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



321
322
323
324
# File 'lib/shoes/setup.rb', line 321

def method_missing(*args)
  p args
  nil
end

Instance Method Details

#alert(msg, quiz = nil) ⇒ Object



314
315
316
317
# File 'lib/shoes/setup.rb', line 314

def alert msg, quiz=nil
  say(msg)
  ask(quiz) if quiz
end

#ask(msg) ⇒ Object



301
302
303
# File 'lib/shoes/setup.rb', line 301

def ask msg
  Kernel.ask(msg)
end

#ask_yes_no(msg) ⇒ Object



298
299
300
# File 'lib/shoes/setup.rb', line 298

def ask_yes_no msg
  Kernel.confirm(msg)
end

#error(msg, e) ⇒ Object



304
305
306
307
308
309
310
# File 'lib/shoes/setup.rb', line 304

def error msg, e
  stat = @status
  stat.app do
    error(e)
    stat.replace link("Error") { Shoes.show_log }, " ", msg
  end
end

#progress(count, total) ⇒ Object



295
296
297
# File 'lib/shoes/setup.rb', line 295

def progress count, total
  @prog.fraction = count.to_f / total.to_f
end

#progress_reporter(*args) ⇒ Object



318
319
320
# File 'lib/shoes/setup.rb', line 318

def progress_reporter(*args)
  ProgressReporter.new(@prog, @status, *args)
end

#say(msg) ⇒ Object



311
312
313
# File 'lib/shoes/setup.rb', line 311

def say msg
  @status.replace msg
end

#title(msg) ⇒ Object



292
293
294
# File 'lib/shoes/setup.rb', line 292

def title msg
  @title.replace msg
end