Class: Gem::ShoesFace

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

Defined Under Namespace

Classes: ProgressReporter, SilentDownloadReporter

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ ShoesFace

Returns a new instance of ShoesFace



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

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



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

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

#ask(msg) ⇒ Object



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

def ask msg
  Kernel.ask(msg)
end

#ask_yes_no(msg) ⇒ Object



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

def ask_yes_no msg
  Kernel.confirm(msg)
end

#download_reporter(*args) ⇒ Object



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

def download_reporter(*args)
  SilentDownloadReporter.new(nil, *args)
end

#error(msg, e) ⇒ Object



343
344
345
346
347
348
349
# File 'lib/shoes/setup.rb', line 343

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



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

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

#progress_reporter(*args) ⇒ Object



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

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

#say(msg) ⇒ Object



351
352
353
# File 'lib/shoes/setup.rb', line 351

def say msg
  @status.replace msg
end

#title(msg) ⇒ Object



326
327
328
# File 'lib/shoes/setup.rb', line 326

def title msg
  @title.replace msg
end