Class: Backhoe::Load

Inherits:
Struct
  • Object
show all
Includes:
Rake::DSL
Defined in:
lib/backhoe/load.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#databaseObject

Returns the value of attribute database

Returns:

  • (Object)

    the current value of database



4
5
6
# File 'lib/backhoe/load.rb', line 4

def database
  @database
end

#drop_and_createObject

Returns the value of attribute drop_and_create

Returns:

  • (Object)

    the current value of drop_and_create



4
5
6
# File 'lib/backhoe/load.rb', line 4

def drop_and_create
  @drop_and_create
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



4
5
6
# File 'lib/backhoe/load.rb', line 4

def path
  @path
end

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/backhoe/load.rb', line 7

def call
  case database.adapter
  when "mysql2", "trilogy"
    sh mysql_command
  when "postgresql"
    sh psql_command
  else
    raise "don't know how to load #{database.adapter}"
  end
end