Class: DokkuClient::Plugins::Config

Inherits:
Base
  • Object
show all
Defined in:
lib/dokku_client/plugins/config.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



24
25
26
27
28
29
30
# File 'lib/dokku_client/plugins/config.rb', line 24

def commands opts
  opts.separator  "\n   Config commands:"
  opts.separator  "     config                                show environment variables for project"
  opts.separator  "     config:get <KEY>                      show exact environment variable"
  opts.separator  "     config:set KEY=VALUE [KEY2=VALUE2]    set new environment variables"
  opts.separator  "     config:unset KEY [KEY2]               remove environment variables"
end

#get_variable(key) ⇒ Object



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

def get_variable key
  dokku "config:get #{@options["project-name"]} #{key}"
end

#runObject



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

def run
end

#set_variables(keys_with_values) ⇒ Object



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

def set_variables keys_with_values
  dokku "config:set #{@options["project-name"]} #{keys_with_values}"
end

#unset_variables(keys) ⇒ Object



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

def unset_variables keys
  dokku "config:unset #{@options["project-name"]} #{keys}"
end

#variablesObject



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

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