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.



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

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



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

def method_missing(*args)
  p args
  nil
end

Instance Method Details

#alert(msg, quiz = nil) ⇒ Object



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

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

#ask(msg) ⇒ Object



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

def ask msg
  Kernel.ask(msg)
end

#ask_yes_no(msg) ⇒ Object



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

def ask_yes_no msg
  Kernel.confirm(msg)
end

#download_reporter(*args) ⇒ Object



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

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

#error(msg, e) ⇒ Object



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

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



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

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

#say(msg) ⇒ Object



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

def say msg
  @status.replace msg
end

#title(msg) ⇒ Object



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

def title msg
  @title.replace msg
end