Sha256: 2fecbcc1bfeef90de1a0af41eb7ba2900e8abddc370deb17aedd401fc35500d6

Contents?: true

Size: 561 Bytes

Versions: 6

Compression:

Stored size: 561 Bytes

Contents

module Proviso::PluginInterface

  def self.included(base)
    base.extend Proviso::PluginInterface
  end

  def selected_application
    base_command.extract_app
  rescue Proviso::Command::CommandFailed
    nil
  end

  def applications
    @applications ||= (base_command.git_remotes(Dir.pwd) || []).inject({}) do |hash, (remote, app)|
      hash.update(app => remote)
    end
  end

  def command(command, *args)
    Proviso::Command.run_internal command.to_s, args
  end

  def base_command
    @base_command ||= Proviso::Command::Base.new(ARGV)
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
proviso-0.2.0 lib/proviso/plugin_interface.rb
proviso-0.2.0.beta4 lib/proviso/plugin_interface.rb
proviso-0.2.0.beta3 lib/proviso/plugin_interface.rb
proviso-0.2.0.beta2 lib/proviso/plugin_interface.rb
proviso-0.2.0.beta1 lib/proviso/plugin_interface.rb
proviso-0.1.0 lib/proviso/plugin_interface.rb