Class: Gem::ShoesFace

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

Defined Under Namespace

Classes: ProgressReporter

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ ShoesFace

Returns a new instance of ShoesFace



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

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



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

def method_missing(*args)
  p args
  nil
end

Instance Method Details

#alert(msg, quiz = nil) ⇒ Object



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

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

#ask(msg) ⇒ Object



303
304
305
# File 'lib/shoes/setup.rb', line 303

def ask msg
  Kernel.ask(msg)
end

#ask_yes_no(msg) ⇒ Object



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

def ask_yes_no msg
  Kernel.confirm(msg)
end

#error(msg, e) ⇒ Object



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

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



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

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

#progress_reporter(*args) ⇒ Object



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

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

#say(msg) ⇒ Object



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

def say msg
  @status.replace msg
end

#title(msg) ⇒ Object



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

def title msg
  @title.replace msg
end