Class: Catfish::CLI::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/catfish/cli/plugin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Plugin

Returns a new instance of Plugin.



5
6
7
# File 'lib/catfish/cli/plugin.rb', line 5

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/catfish/cli/plugin.rb', line 3

def options
  @options
end

Instance Method Details

#runObject



9
10
11
12
13
14
15
16
17
# File 'lib/catfish/cli/plugin.rb', line 9

def run
  puts 'Installing plugins'
  builder = Dsl.new
  builder.eval_catfishfile

  builder.plugins.each do |plugin|
    system("vagrant plugin install #{plugin}") unless `vagrant plugin list`.include? plugin
  end
end