Class: DokkuClient::Plugins::Common

Inherits:
Base
  • Object
show all
Defined in:
lib/dokku_client/plugins/common.rb

Constant Summary

Constants inherited from Base

Base::GIT_DIR, Base::KEYS_AND_QUESTIONS

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#common_description, #dokku, #git_directory_present?, #initialize, #plugin_enabled, #reconfig

Constructor Details

This class inherits a constructor from DokkuClient::Base

Instance Method Details

#commands(opts) ⇒ Object



32
33
34
35
36
37
38
39
40
# File 'lib/dokku_client/plugins/common.rb', line 32

def commands opts
  opts.separator  "\n   Common commands:"
  opts.separator  "     logs                                  show app logs"
  opts.separator  "     run (r) '<command>'                   run command (unfortunately fon now you have to type command in quotes)"
  opts.separator  "     url (u)                               show link to aplication"
  opts.separator  "     plugins (p)                           show installed plugins on dokku host"
  opts.separator  "     rc <env>                              run rails console for application (pass 'staging' to load staging console, or leave empty for production)"
  opts.separator  "     rdm                                   run database migrations"
end

#logsObject



8
9
10
# File 'lib/dokku_client/plugins/common.rb', line 8

def logs
  dokku "logs #{@options["project-name"]}"
end

#pluginsObject



28
29
30
# File 'lib/dokku_client/plugins/common.rb', line 28

def plugins
  dokku "plugins"
end

#rails_console(env) ⇒ Object



16
17
18
# File 'lib/dokku_client/plugins/common.rb', line 16

def rails_console env
  dokku "run #{@options["project-name"]} bundle exec rails c #{env}"
end

#rails_migrationsObject



20
21
22
# File 'lib/dokku_client/plugins/common.rb', line 20

def rails_migrations
  dokku "run #{@options["project-name"]} bundle exec rake db:migrate"
end

#runObject



5
6
# File 'lib/dokku_client/plugins/common.rb', line 5

def run
end

#run_command(command) ⇒ Object



12
13
14
# File 'lib/dokku_client/plugins/common.rb', line 12

def run_command command
  dokku "run #{@options["project-name"]} #{command}"
end

#urlObject



24
25
26
# File 'lib/dokku_client/plugins/common.rb', line 24

def url
  dokku "url #{@options["project-name"]}"
end