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

- (ShoesFace) initialize(app)



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

- (Object) method_missing(*args)



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

def method_missing(*args)
  p args
  nil
end

Instance Method Details

- (Object) alert(msg, quiz = nil)



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

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

- (Object) ask(msg)



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

def ask msg
  Kernel.ask(msg)
end

- (Object) ask_yes_no(msg)



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

def ask_yes_no msg
  Kernel.confirm(msg)
end

- (Object) download_reporter(*args)



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

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

- (Object) error(msg, e)



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

- (Object) progress(count, total)



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

- (Object) progress_reporter(*args)



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

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

- (Object) say(msg)



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

def say msg
  @status.replace msg
end

- (Object) title(msg)



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

def title msg
  @title.replace msg
end