Class: Tomo::Plugin::Rails::Tasks
Instance Method Summary
collapse
Methods inherited from TaskLibrary
#initialize
Instance Method Details
#assets_precompile ⇒ Object
5
6
7
|
# File 'lib/tomo/plugin/rails/tasks.rb', line 5
def assets_precompile
remote.rake("assets:precompile")
end
|
#console ⇒ Object
9
10
11
|
# File 'lib/tomo/plugin/rails/tasks.rb', line 9
def console
remote.rails("console", settings[:run_args], attach: true)
end
|
#db_console ⇒ Object
17
18
19
|
# File 'lib/tomo/plugin/rails/tasks.rb', line 17
def db_console
remote.rails("dbconsole", "--include-password", settings[:run_args], attach: true)
end
|
#db_create ⇒ Object
29
30
31
32
33
|
# File 'lib/tomo/plugin/rails/tasks.rb', line 29
def db_create
return remote.rake("db:create") unless database_exists?
logger.info "Database already exists; skipping db:create."
end
|
#db_migrate ⇒ Object
21
22
23
|
# File 'lib/tomo/plugin/rails/tasks.rb', line 21
def db_migrate
remote.rake("db:migrate")
end
|
#db_schema_load ⇒ Object
41
42
43
44
45
46
47
48
49
|
# File 'lib/tomo/plugin/rails/tasks.rb', line 41
def db_schema_load
if !schema_rb_present?
logger.warn "db/schema.rb is not present; skipping schema:load."
elsif database_schema_loaded?
logger.info "Database schema already loaded; skipping db:schema:load."
else
remote.rake("db:schema:load")
end
end
|
#db_seed ⇒ Object
25
26
27
|
# File 'lib/tomo/plugin/rails/tasks.rb', line 25
def db_seed
remote.rake("db:seed")
end
|
#db_setup ⇒ Object
35
36
37
38
39
|
# File 'lib/tomo/plugin/rails/tasks.rb', line 35
def db_setup
return remote.rake("db:setup") unless database_exists?
logger.info "Database already exists; skipping db:setup."
end
|
#db_structure_load ⇒ Object
51
52
53
54
55
56
57
58
59
|
# File 'lib/tomo/plugin/rails/tasks.rb', line 51
def db_structure_load
if !structure_sql_present?
logger.warn "db/structure.sql is not present; skipping db:structure:load."
elsif database_schema_loaded?
logger.info "Database structure already loaded; skipping db:structure:load."
else
remote.rake("db:structure:load")
end
end
|
#query ⇒ Object
13
14
15
|
# File 'lib/tomo/plugin/rails/tasks.rb', line 13
def query
remote.rails("query", settings[:run_args], attach: true)
end
|