Top Level Namespace

Defined Under Namespace

Modules: Caboose, EntityMixin, Glue, Og, SQLite3 Classes: Entity, Mysql, PGError, PGconn, PGresult, Tag

Constant Summary collapse

MysqlRes =

for compatibility

Mysql::Result
MysqlField =
Mysql::Field
MysqlError =
Mysql::Error

Instance Method Summary collapse

Instance Method Details

#mysql(opts, stream) ⇒ Object

Helper for mysql scripts.

Example

mysql ‘-u root -p’, %

drop database if exists weblog_development;
create database weblog_development;
grant all on weblog_development.* to #{`id -un`.strip@localhost;

}



11
12
13
14
15
# File 'lib/og/adapter/mysql/script.rb', line 11

def mysql(opts, stream)
  IO.popen("mysql #{opts}", 'w') do |io| 
    io.puts stream
  end
end

#psql(opts, stream) ⇒ Object

Helper for psql scripts.

Example

psql ‘-u root -p’, %

drop database if exists weblog_development;
create database weblog_development;
grant all on weblog_development.* to #{`id -un`.strip@localhost;

}



11
12
13
14
15
# File 'lib/og/adapter/postgresql/script.rb', line 11

def psql(opts, stream)
  IO.popen("psql #{opts}", 'w') do |io| 
    io.puts stream
  end
end

#sqlite(opts, stream) ⇒ Object

Helper for sqlite scripts.

Example

sqlite ‘filename’, %

drop database if exists weblog_development;
create database weblog_development;
grant all on weblog_development.* to #{`id -un`.strip@localhost;

}



11
12
13
14
15
# File 'lib/og/adapter/sqlite/script.rb', line 11

def sqlite(opts, stream)
  IO.popen("mysql #{opts}", 'w') do |io| 
    io.puts stream
  end
end