Class: Testjour::CLI::MysqlCreate
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Testjour::CLI::MysqlCreate
- Defined in:
- lib/testjour/commands/mysql_create.rb
Instance Attribute Summary
Attributes inherited from BaseCommand
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ MysqlCreate
constructor
A new instance of MysqlCreate.
- #run ⇒ Object
Methods inherited from BaseCommand
detailed_help, help, inherited, #option_parser, options, #testjour_bin_path
Constructor Details
#initialize(*args) ⇒ MysqlCreate
Returns a new instance of MysqlCreate.
13 14 15 16 17 18 19 |
# File 'lib/testjour/commands/mysql_create.rb', line 13 def initialize(*args) super Testjour.logger.debug "Runner command #{self.class}..." ENV["RAILS_ENV"] ||= "test" require File.("./config/environment") end |
Class Method Details
.command ⇒ Object
9 10 11 |
# File 'lib/testjour/commands/mysql_create.rb', line 9 def self.command "mysql:create" end |
Instance Method Details
#run ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/testjour/commands/mysql_create.rb', line 21 def run mysql = MysqlDatabaseSetup.new mysql.create_database mysql.connect mysql.load_schema ENV["TESTJOUR_DB"] = mysql.runner_database_name puts mysql.runner_database_name end |