Class: VagrantBundlerTools::Command

Inherits:
Vagrant::Command::GroupBase
  • Object
show all
Defined in:
lib/vagrant_bundler_tools/command.rb

Instance Method Summary collapse

Instance Method Details

#listObject



6
7
8
# File 'lib/vagrant_bundler_tools/command.rb', line 6

def list
  env.ui.info ssh_execute("cd /vagrant && bundle list")
end

#open(gem_name) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/vagrant_bundler_tools/command.rb', line 16

def open(gem_name)
  # Method largely copied and pasted from from Bundler::CLI#open
  editor = [ENV['BUNDLER_EDITOR'], ENV['VISUAL'], ENV['EDITOR']].find{|e| !e.nil? && !e.empty? }
  if editor
    gem_path = locate_gem(gem_name)
    Dir.chdir(gem_path) do
      command = "#{editor} #{gem_path}"
      success = system(command)
      env.ui.info "Could not run '#{command}'" unless success
    end
  else
    env.ui.info("To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR")
  end
end

#show(gem_name) ⇒ Object



11
12
13
# File 'lib/vagrant_bundler_tools/command.rb', line 11

def show(gem_name)
  env.ui.info locate_gem(gem_name)
end