Class: Gem::ShoesFace

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

Defined Under Namespace

Classes: DownloadReporter

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ ShoesFace

Returns a new instance of ShoesFace



330
331
332
# File 'lib/shoes/setup.rb', line 330

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



365
366
367
368
# File 'lib/shoes/setup.rb', line 365

def method_missing(*args)
  p args
  nil
end

Instance Method Details

#alert(msg, quiz = nil) ⇒ Object



356
357
358
359
# File 'lib/shoes/setup.rb', line 356

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

#ask(msg) ⇒ Object



343
344
345
# File 'lib/shoes/setup.rb', line 343

def ask msg
  Kernel.ask(msg)
end

#ask_yes_no(msg) ⇒ Object



340
341
342
# File 'lib/shoes/setup.rb', line 340

def ask_yes_no msg
  Kernel.confirm(msg)
end

#download_reporter(*args) ⇒ Object



361
362
363
# File 'lib/shoes/setup.rb', line 361

def download_reporter(*args)
  DownloadReporter.new(@prog, @status, 0, 'Downloading')
end

#error(msg, e) ⇒ Object



346
347
348
349
350
351
352
# File 'lib/shoes/setup.rb', line 346

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



336
337
338
339
# File 'lib/shoes/setup.rb', line 336

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

#say(msg) ⇒ Object



353
354
355
# File 'lib/shoes/setup.rb', line 353

def say msg
  @status.replace msg
end

#title(msg) ⇒ Object



333
334
335
# File 'lib/shoes/setup.rb', line 333

def title msg
  @title.replace msg
end