
Security News
Researcher Exposes Zero-Day Clickjacking Vulnerabilities in Major Password Managers
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Provides a Ruby API to control Vagrant where Vagrant is installed via the Installer package on Mac OS X.
Currently a work-in-progress.
Vagrant was historically available as a gem, naturally providing a Ruby API to control Vagrant in other Ruby libraries and applications. However, since version 1.1.0, Vagrant is distributed exclusively using an Installer package. Derelict is a Ruby library that wraps the Vagrant binary, shelling out and parsing the results of each command.
Add this line to your application's Gemfile:
gem "derelict"
And then execute:
$ bundle
Or install it yourself as:
$ gem install derelict
Some examples of common operations using Derelict:
require "derelict"
# Determine if there's a "default" VM defined in /path/to/project
Derelict.instance.connect("/path/to/project").vm(:default).exists?
require "derelict"
# Create an instance (represents a Vagrant installation)
instance = Derelict.instance("/path/to/vagrant")
instance = Derelict.instance # Defaults to /Applications/Vagrant
# Issue commands to the instance directly (not usually necessary)
result = instance.execute('--version') # Derelict::Executer object
print "success" if result.success? # if Vagrant's exit status was 0
print result.stdout # "Vagrant 1.3.3\n"
# Connect to a Vagrant project (containing a Vagrantfile)
connection = instance.connect("/path/to/project")
# Issue commands to the connection directly (runs from the project dir)
result = connection.execute(:up) # runs "vagrant up" in project dir
result.success? # Derelict::Executer object again
# Retrieve a particular VM from a connection (multi-machine support)
vm = connection.vm(:web) # "vm" is a Derelict::VirtualMachine
vm.exists? # does the connection define a "web" VM?
vm.state # current VM state (:running, :not_created...)
vm.running? # whether the VM is currently running or not
vm.up! # runs "vagrant up" for this VM only
vm.halt! # runs "vagrant halt" for this VM only
vm.destroy! # runs "vagrant destroy --force" for this VM
vm.reload! # runs "vagrant reload" for this VM only
vm.suspend! # runs "vagrant suspend" for this VM only
vm.resume! # runs "vagrant resume" for this VM only
git checkout -b my-new-feature
)git commit -am "Add some feature"
)git push origin my-new-feature
)FAQs
Unknown package
We found that derelict demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.