Module: Fill

Defined in:
lib/fill.rb,
lib/fill/configure.rb,
lib/fill/presenter.rb,
lib/fill/procedure.rb

Defined Under Namespace

Classes: Configure, Presenter, Procedure

Constant Summary collapse

VERSION =
File.read(File.dirname(__FILE__) + '/../VERSION').chomp

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.outObject



14
15
16
# File 'lib/fill.rb', line 14

def out
  @out ||= STDOUT
end

Class Method Details

.database {|db| ... } ⇒ Object

Yields:

  • (db)


18
19
20
21
22
# File 'lib/fill.rb', line 18

def database
  db = Configure.new
  yield db
  perform!(db)
end

.perform!(configuration) ⇒ Object



24
25
26
27
28
29
# File 'lib/fill.rb', line 24

def perform!(configuration)
  bm = time { configuration.perform! }
  out.puts Presenter
  out.puts "Database filled in %.2f seconds" % bm
  Presenter.clear!
end

.timeObject



31
32
33
34
35
# File 'lib/fill.rb', line 31

def time
  started_at = Time.now
  yield
  Time.now - started_at
end