Module: Proviso::PluginInterface
- Included in:
- Command::Base
- Defined in:
- lib/proviso/plugin_interface.rb
Class Method Summary collapse
Instance Method Summary collapse
- #applications ⇒ Object
- #base_command ⇒ Object
- #command(command, *args) ⇒ Object
- #selected_application ⇒ Object
Class Method Details
.included(base) ⇒ Object
3 4 5 |
# File 'lib/proviso/plugin_interface.rb', line 3 def self.included(base) base.extend Proviso::PluginInterface end |
Instance Method Details
#applications ⇒ Object
13 14 15 16 17 |
# File 'lib/proviso/plugin_interface.rb', line 13 def applications @applications ||= (base_command.git_remotes(Dir.pwd) || []).inject({}) do |hash, (remote, app)| hash.update(app => remote) end end |
#base_command ⇒ Object
23 24 25 |
# File 'lib/proviso/plugin_interface.rb', line 23 def base_command @base_command ||= Proviso::Command::Base.new(ARGV) end |
#command(command, *args) ⇒ Object
19 20 21 |
# File 'lib/proviso/plugin_interface.rb', line 19 def command(command, *args) Proviso::Command.run_internal command.to_s, args end |
#selected_application ⇒ Object
7 8 9 10 11 |
# File 'lib/proviso/plugin_interface.rb', line 7 def selected_application base_command.extract_app rescue Proviso::Command::CommandFailed nil end |