Module: OmaGem::DSL::Plugin
- Included in:
- Config
- Defined in:
- lib/omagem/dsl/plugin.rb
Overview
Shell plugin and bar-widget management.
Instance Method Summary collapse
-
#add_plugin(url, enable: false) ⇒ Object
Add a shell plugin from a git URL.
-
#clone_plugin(id) ⇒ Object
Clone a built-in plugin into the user config (switch to user copy).
- #disable_plugin(id) ⇒ Object
- #enable_plugin(id, placement = nil) ⇒ Object
- #list_plugins(json: false) ⇒ Object
- #remove_plugin(id) ⇒ Object
Instance Method Details
#add_plugin(url, enable: false) ⇒ Object
Add a shell plugin from a git URL. enable: true enables it immediately.
8 9 10 11 12 13 |
# File 'lib/omagem/dsl/plugin.rb', line 8 def add_plugin(url, enable: false) args = ['plugin', 'add', url] args << '--enable' if enable args << '--yes' run(*args) end |
#clone_plugin(id) ⇒ Object
Clone a built-in plugin into the user config (switch to user copy).
16 17 18 |
# File 'lib/omagem/dsl/plugin.rb', line 16 def clone_plugin(id) run('plugin', 'clone', id) end |
#disable_plugin(id) ⇒ Object
26 27 28 |
# File 'lib/omagem/dsl/plugin.rb', line 26 def disable_plugin(id) run('plugin', 'disable', id) end |
#enable_plugin(id, placement = nil) ⇒ Object
20 21 22 23 24 |
# File 'lib/omagem/dsl/plugin.rb', line 20 def enable_plugin(id, placement = nil) args = ['plugin', 'enable', id] args << placement if placement run(*args) end |
#list_plugins(json: false) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/omagem/dsl/plugin.rb', line 34 def list_plugins(json: false) args = %w[plugin list] args << '--json' if json out = run(*args).stdout json ? out : out.lines.map(&:strip).reject(&:empty?) end |
#remove_plugin(id) ⇒ Object
30 31 32 |
# File 'lib/omagem/dsl/plugin.rb', line 30 def remove_plugin(id) run('plugin', 'remove', id, '--yes') end |