Module: Proviso::PluginInterface

Included in:
Command::Base
Defined in:
lib/proviso/plugin_interface.rb

Class Method Summary collapse

Instance Method Summary collapse

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

#applicationsObject



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_commandObject



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_applicationObject



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