diff --git a/website/source/docs/plugins/development-basics.html.md b/website/source/docs/plugins/development-basics.html.md index d2514deec..a35d43301 100644 --- a/website/source/docs/plugins/development-basics.html.md +++ b/website/source/docs/plugins/development-basics.html.md @@ -99,7 +99,7 @@ Within the definition, a plugin advertises what components it adds to Vagrant. An example is shown below where a command and provisioner are added: -``` +```ruby class MyPlugin < Vagrant.plugin("2") name "My Plugin" diff --git a/website/source/docs/plugins/guests.html.md b/website/source/docs/plugins/guests.html.md index 7b5feab43..6eead27aa 100644 --- a/website/source/docs/plugins/guests.html.md +++ b/website/source/docs/plugins/guests.html.md @@ -58,7 +58,7 @@ Communication channels to the machine are guaranteed to be running at this point, so the most common way to detect the operating system is to do some basic testing: -``` +```ruby class MyGuest < Vagrant.plugin("2", "guest") def detect?(machine) machine.communicate.test("cat /etc/myos-release") diff --git a/website/source/docs/plugins/hosts.html.md b/website/source/docs/plugins/hosts.html.md index 96dc6fc4b..6d2fbe76f 100644 --- a/website/source/docs/plugins/hosts.html.md +++ b/website/source/docs/plugins/hosts.html.md @@ -55,7 +55,7 @@ process to determine if the OS that Vagrant is running on is this host. If you detect that it is your operating system, return `true` from `detect?`. Otherwise, return `false`. -``` +```ruby class MyHost < Vagrant.plugin("2", "host") def detect?(environment) File.file?("/etc/arch-release") diff --git a/website/source/docs/plugins/providers.html.md b/website/source/docs/plugins/providers.html.md index dfd849a67..5969a1866 100644 --- a/website/source/docs/plugins/providers.html.md +++ b/website/source/docs/plugins/providers.html.md @@ -176,7 +176,7 @@ Provider-specific configuration is a special case of a normal configuration component, name the configuration the same as the provider, and as a second parameter, specify `:provider`, like so: -``` +```ruby config("my_cloud", :provider) do require_relative "config" Config @@ -188,7 +188,7 @@ parameter is given, Vagrant will automatically expose this as provider-specific configuration for your provider. Users can now do the following in their Vagrantfiles: -``` +```ruby config.vm.provider :my_cloud do |config| # Your specific configuration! end diff --git a/website/source/docs/providers/configuration.html.md b/website/source/docs/providers/configuration.html.md index 1d80c832d..efc87002c 100644 --- a/website/source/docs/providers/configuration.html.md +++ b/website/source/docs/providers/configuration.html.md @@ -69,7 +69,7 @@ be overridden only for that provider. Example: -``` +```ruby Vagrant.configure("2") do |config| config.vm.box = "precise64" diff --git a/website/source/docs/provisioning/ansible.html.md b/website/source/docs/provisioning/ansible.html.md index 3d5aa066f..5b6d643d7 100644 --- a/website/source/docs/provisioning/ansible.html.md +++ b/website/source/docs/provisioning/ansible.html.md @@ -136,13 +136,13 @@ If you really need to use this connection mode though, it is possible to enable With auto-generated inventory: -``` +```ruby ansible.raw_arguments = ["--connection=paramiko"] ``` With a custom inventory, the private key must be specified (e.g. via an `ansible.cfg` configuration file, `--private-key` argument, or as part of your inventory file): -``` +```ruby ansible.inventory_path = "./my-inventory" ansible.raw_arguments = [ "--connection=paramiko", diff --git a/website/source/docs/provisioning/chef_solo.html.md b/website/source/docs/provisioning/chef_solo.html.md index f140a2182..834ba21a1 100644 --- a/website/source/docs/provisioning/chef_solo.html.md +++ b/website/source/docs/provisioning/chef_solo.html.md @@ -170,7 +170,7 @@ to Chef Solo. This is done by setting the `json` property with a Ruby hash (dictionary-like object), which is converted to JSON and passed in to Chef: -``` +```ruby Vagrant.configure("2") do |config| config.vm.provision "chef_solo" do |chef| # ... diff --git a/website/source/docs/provisioning/file.html.md b/website/source/docs/provisioning/file.html.md index 4442b3a9e..35dcfef69 100644 --- a/website/source/docs/provisioning/file.html.md +++ b/website/source/docs/provisioning/file.html.md @@ -19,11 +19,13 @@ File provisioning is a simple way to, for example, replicate your local you will not have to run `git config --global` every time you provision a new VM. - Vagrant.configure("2") do |config| - # ... other configuration +```ruby +Vagrant.configure("2") do |config| + # ... other configuration - config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig" - end + config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig" +end +``` If you want to upload a folder to your guest system, it can be accomplished by using a file provisioner seen below. When copied, the resulting folder on the guest will @@ -31,11 +33,13 @@ replace `folder` as `newfolder` and place its on the guest machine. Note that if you'd like the same folder name on your guest machine, make sure that the destination path has the same name as the folder on your host. - Vagrant.configure("2") do |config| - # ... other configuration +```ruby +Vagrant.configure("2") do |config| + # ... other configuration - config.vm.provision "file", source: "~/path/to/host/folder", destination: "$HOME/remote/newfolder" - end + config.vm.provision "file", source: "~/path/to/host/folder", destination: "$HOME/remote/newfolder" +end +``` Prior to copying `~/path/to/host/folder` to the guest machine: @@ -93,7 +97,9 @@ lead to some confusing results due to the underlying tool used to copy files and folders between the host and guests. For example, if you have a source and destination with a trailing slash defined below: - config.vm.provision "file", source: "~/pathfolder", destination: "/remote/newlocation/" +```ruby +config.vm.provision "file", source: "~/pathfolder", destination: "/remote/newlocation/" +``` You are telling vagrant to upload `~/pathfolder` under the remote dir `/remote/newlocation`, which will look like: @@ -106,15 +112,21 @@ which will look like: This behavior can also be achieved by defining your file provisioner below: - config.vm.provision "file", source: "~/pathfolder", destination: "/remote/newlocation/pathfolder" +```ruby +config.vm.provision "file", source: "~/pathfolder", destination: "/remote/newlocation/pathfolder" +``` Another example is using globing on the host machine to grab all files within a folder, but not the top level folder itself: - config.vm.provision "file", source: "~/otherfolder/.", destination: "/remote/otherlocation" +```ruby +config.vm.provision "file", source: "~/otherfolder/.", destination: "/remote/otherlocation" +``` The file provisioner is defined to include all files under `~/otherfolder` to the new location `/remote/otherlocation`. This idea can be achieved by simply having your destination folder differ from the source folder: - config.vm.provision "file", source: "/otherfolder", destination: "/remote/otherlocation" +```ruby +config.vm.provision "file", source: "/otherfolder", destination: "/remote/otherlocation" +``` diff --git a/website/source/docs/virtualbox/configuration.html.md b/website/source/docs/virtualbox/configuration.html.md index 7626a9032..a2d27d68f 100644 --- a/website/source/docs/virtualbox/configuration.html.md +++ b/website/source/docs/virtualbox/configuration.html.md @@ -22,7 +22,7 @@ you want to have a UI. Common use cases include wanting to see a browser that may be running in the machine, or debugging a strange boot issue. You can easily tell the VirtualBox provider to boot with a GUI: -``` +```ruby config.vm.provider "virtualbox" do |v| v.gui = true end