Skip to content

Commit

Permalink
Release v1.4.3
Browse files Browse the repository at this point in the history
* master:
  Bump version to 1.4.3
  action/import: Add add process-level lock for linked clone creation
  Remove minitest and i18n-tasks dependencies
  Refactor empty lines and spaces
  website: Fix invalid closing tag for 404 page
  Specify CompileForwardedPorts class name explicitely
  rubocop: Single quotes win ✨
  rubocop: Removed unnecessary "return" statements
  Use #require_relative instead of path expanding
  Move #setup_i18n and #setup_logging to plugin class
  docs: Fix typo
  docs: Add section about linked clone feature
  docs: Refactor "Configuration" page
  docs: Fix Parallels Desktop product links
  docs: Add information about Parallels Desktop 11
  docs: Fix invalid margin value in CSS
  Update README.md
  • Loading branch information
legal90 committed Aug 26, 2015
2 parents 5ba8a61 + 991eb12 commit 5677b20
Show file tree
Hide file tree
Showing 65 changed files with 612 additions and 604 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@ This is a plugin for [Vagrant](http://www.vagrantup.com),
allowing to power [Parallels Desktop for Mac](http://www.parallels.com/products/desktop/)
based virtual machines.

If you're just getting started with Vagrant, it is highly recommended that you
read the official [Vagrant documentation](http://docs.vagrantup.com/v2/) first.

### Requirements
- [Vagrant v1.5](http://www.vagrantup.com) or higher
- [Parallels Desktop 8 for Mac](http://www.parallels.com/products/desktop/) or higher

**Attention for Parallels Desktop 11 users!**

This plugin is compatible only with *Pro* and *Business* editions of Parallels
Desktop 11. Standard edition doesn't have a command line functionality and can
not be used with Vagrant.
*Note:* In [**Parallels Desktop 11 for Mac**](http://www.parallels.com/products/desktop/),
only **Pro** and **Business** editions are compatible with this Vagrant provider.
Standard edition doesn't have a command line functionality and can not be used
with Vagrant.

## Features
The Parallels provider supports all basic Vagrant features, including shared folders,
private and public networks, forwarded ports and so on.

If you're just getting started with Vagrant, it is highly recommended that you
read the official [Vagrant documentation](http://docs.vagrantup.com/v2/) first.

## Installation
First, make sure that you have [Parallels Desktop for Mac](http://www.parallels.com/products/desktop/)
and [Vagrant](http://www.vagrantup.com/downloads) properly installed.
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ $stderr.sync = true
# allows us to nicely separate rake tasks into individual files
# based on their role, which makes development and debugging easier
# than one monolithic file.
task_dir = File.expand_path("../tasks", __FILE__)
task_dir = File.expand_path('../tasks', __FILE__)
Dir["#{task_dir}/**/*.rake"].each do |task_file|
load task_file
end

task :default => "test:unit"
task :default => 'test:unit'
18 changes: 0 additions & 18 deletions config/i18n-tasks.yml.erb

This file was deleted.

51 changes: 7 additions & 44 deletions lib/vagrant-parallels.rb
Original file line number Diff line number Diff line change
@@ -1,56 +1,19 @@
require "pathname"
require 'pathname'

require "vagrant-parallels/plugin"
require "vagrant-parallels/version"
require 'vagrant-parallels/plugin'
require 'vagrant-parallels/version'

module VagrantPlugins
module Parallels
lib_path = Pathname.new(File.expand_path("../vagrant-parallels", __FILE__))
autoload :Action, lib_path.join("action")
autoload :Errors, lib_path.join("errors")
lib_path = Pathname.new(File.expand_path('../vagrant-parallels', __FILE__))
autoload :Action, lib_path.join('action')
autoload :Errors, lib_path.join('errors')

# This returns the path to the source of this plugin.
#
# @return [Pathname]
def self.source_root
@source_root ||= Pathname.new(File.expand_path("../../", __FILE__))
@source_root ||= Pathname.new(File.expand_path('../../', __FILE__))
end

# This initializes the internationalization strings.
def self.setup_i18n
I18n.load_path << File.expand_path("locales/en.yml", Parallels.source_root)
I18n.reload!
end

# This sets up our log level to be whatever VAGRANT_LOG is.
def self.setup_logging
require "log4r"

level = nil
begin
level = Log4r.const_get(ENV["VAGRANT_LOG"].upcase)
rescue NameError
# This means that the logging constant wasn't found,
# which is fine. We just keep `level` as `nil`. But
# we tell the user.
level = nil
end

# Some constants, such as "true" resolve to booleans, so the
# above error checking doesn't catch it. This will check to make
# sure that the log level is an integer, as Log4r requires.
level = nil if !level.is_a?(Integer)

# Set the logging level on all "vagrant" namespaced
# logs as long as we have a valid level.
if level
logger = Log4r::Logger.new("vagrant_parallels")
logger.outputters = Log4r::Outputter.stderr
logger.level = level
logger = nil
end
end
Parallels.setup_logging
Parallels.setup_i18n
end
end
90 changes: 45 additions & 45 deletions lib/vagrant-parallels/action.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "vagrant/action/builder"
require 'vagrant/action/builder'

module VagrantPlugins
module Parallels
Expand All @@ -25,11 +25,11 @@ def self.action_boot
b.use ForwardPorts
b.use SetHostname
b.use SaneDefaults
b.use Customize, "pre-boot"
b.use Customize, 'pre-boot'
b.use Boot
b.use Customize, "post-boot"
b.use Customize, 'post-boot'
b.use WaitForCommunicator, [:starting, :running]
b.use Customize, "post-comm"
b.use Customize, 'post-comm'
b.use HandleGuestTools
end
end
Expand All @@ -41,13 +41,13 @@ def self.action_destroy
b.use ConfigValidate
b.use Call, IsState, :not_created do |env1, b1|
if env1[:result]
b1.use Message, I18n.t("vagrant.commands.common.vm_not_created")
b1.use Message, I18n.t('vagrant.commands.common.vm_not_created')
next
end

b1.use Call, DestroyConfirm do |env2, b2|
if !env2[:result]
b2.use Message, I18n.t("vagrant.commands.destroy.will_not_destroy",
b2.use Message, I18n.t('vagrant.commands.destroy.will_not_destroy',
:name => env2[:machine].name)
next
end
Expand All @@ -71,7 +71,7 @@ def self.action_halt
b.use ConfigValidate
b.use Call, IsState, :not_created do |env1, b1|
if env1[:result]
b1.use Message, I18n.t("vagrant.commands.common.vm_not_created")
b1.use Message, I18n.t('vagrant.commands.common.vm_not_created')
next
end

Expand All @@ -98,7 +98,7 @@ def self.action_package
b.use ConfigValidate
b.use Call, IsState, :not_created do |env1, b1|
if env1[:result]
b1.use Message, I18n.t("vagrant.commands.common.vm_not_created")
b1.use Message, I18n.t('vagrant.commands.common.vm_not_created')
next
end

Expand All @@ -119,13 +119,13 @@ def self.action_provision
b.use ConfigValidate
b.use Call, IsState, :not_created do |env1, b1|
if env1[:result]
b1.use Message, I18n.t("vagrant.commands.common.vm_not_created")
b1.use Message, I18n.t('vagrant.commands.common.vm_not_created')
next
end

b1.use Call, IsState, :running do |env2, b2|
if !env2[:result]
b2.use Message, I18n.t("vagrant.commands.common.vm_not_running")
b2.use Message, I18n.t('vagrant.commands.common.vm_not_running')
next
end

Expand All @@ -143,7 +143,7 @@ def self.action_reload
b.use ConfigValidate
b.use Call, IsState, :not_created do |env1, b1|
if env1[:result]
b1.use Message, I18n.t("vagrant.commands.common.vm_not_created")
b1.use Message, I18n.t('vagrant.commands.common.vm_not_created')
next
end

Expand All @@ -160,7 +160,7 @@ def self.action_resume
b.use ConfigValidate
b.use Call, IsState, :not_created do |env1, b1|
if env1[:result]
b1.use Message, I18n.t("vagrant.commands.common.vm_not_created")
b1.use Message, I18n.t('vagrant.commands.common.vm_not_created')
next
end

Expand All @@ -179,7 +179,7 @@ def self.action_ssh
b.use ConfigValidate
b.use Call, IsState, :not_created do |env1, b1|
if env1[:result]
b1.use Message, I18n.t("vagrant.commands.common.vm_not_created")
b1.use Message, I18n.t('vagrant.commands.common.vm_not_created')
next
end

Expand All @@ -200,7 +200,7 @@ def self.action_ssh_run
b.use ConfigValidate
b.use Call, IsState, :not_created do |env1, b1|
if env1[:result]
b1.use Message, I18n.t("vagrant.commands.common.vm_not_created")
b1.use Message, I18n.t('vagrant.commands.common.vm_not_created')
next
end

Expand All @@ -223,7 +223,7 @@ def self.action_start
b.use Call, IsState, :running do |env1, b1|
# If the VM is running, then our work here is done, exit
if env1[:result]
b1.use Message, I18n.t("vagrant_parallels.commands.common.vm_already_running")
b1.use Message, I18n.t('vagrant_parallels.commands.common.vm_already_running')
next
end

Expand All @@ -249,7 +249,7 @@ def self.action_suspend
b.use ConfigValidate
b.use Call, IsState, :not_created do |env1, b1|
if env1[:result]
b1.use Message, I18n.t("vagrant.commands.common.vm_not_created")
b1.use Message, I18n.t('vagrant.commands.common.vm_not_created')
next
end

Expand All @@ -276,7 +276,7 @@ def self.action_up
b.use Call, IsState, :not_created do |env1, b1|
# If the VM is NOT created yet, then do the setup steps
if env1[:result]
b1.use Customize, "pre-import"
b1.use Customize, 'pre-import'
b1.use Import
b1.use Customize, 'post-import'
end
Expand All @@ -295,11 +295,11 @@ def self.action_simple_reboot
end
end

b.use Customize, "pre-boot"
b.use Customize, 'pre-boot'
b.use Boot
b.use Customize, "post-boot"
b.use Customize, 'post-boot'
b.use WaitForCommunicator, [:starting, :running]
b.use Customize, "post-comm"
b.use Customize, 'post-comm'
end
end

Expand All @@ -311,13 +311,13 @@ def self.action_sync_folders
b.use ConfigValidate
b.use Call, IsState, :not_created do |env1, b1|
if env1[:result]
b1.use Message, I18n.t("vagrant.commands.common.vm_not_created")
b1.use Message, I18n.t('vagrant.commands.common.vm_not_created')
next
end

b1.use Call, IsState, :running do |env2, b2|
if !env2[:result]
b2.use Message, I18n.t("vagrant.commands.common.vm_not_running")
b2.use Message, I18n.t('vagrant.commands.common.vm_not_running')
next
end
b2.use PrepareNFSValidIds
Expand All @@ -329,29 +329,29 @@ def self.action_sync_folders
end


autoload :Boot, File.expand_path("../action/boot", __FILE__)
autoload :HandleGuestTools, File.expand_path("../action/handle_guest_tools", __FILE__)
autoload :HandleForwardedPortCollisions, File.expand_path("../action/handle_forwarded_port_collisions.rb", __FILE__)
autoload :ClearNetworkInterfaces, File.expand_path("../action/clear_network_interfaces", __FILE__)
autoload :ClearForwardedPorts, File.expand_path("../action/clear_forwarded_ports", __FILE__)
autoload :Customize, File.expand_path("../action/customize", __FILE__)
autoload :Destroy, File.expand_path("../action/destroy", __FILE__)
autoload :DestroyUnusedNetworkInterfaces, File.expand_path("../action/destroy_unused_network_interfaces", __FILE__)
autoload :Export, File.expand_path("../action/export", __FILE__)
autoload :ForcedHalt, File.expand_path("../action/forced_halt", __FILE__)
autoload :ForwardPorts, File.expand_path("../action/forward_ports", __FILE__)
autoload :Import, File.expand_path("../action/import", __FILE__)
autoload :Network, File.expand_path("../action/network", __FILE__)
autoload :Package, File.expand_path("../action/package", __FILE__)
autoload :PackageConfigFiles, File.expand_path("../action/package_config_files", __FILE__)
autoload :PrepareForwardedPortCollisionParams, File.expand_path("../action/prepare_forwarded_port_collision_params", __FILE__)
autoload :PrepareNFSSettings, File.expand_path("../action/prepare_nfs_settings", __FILE__)
autoload :PrepareNFSValidIds, File.expand_path("../action/prepare_nfs_valid_ids", __FILE__)
autoload :Resume, File.expand_path("../action/resume", __FILE__)
autoload :SaneDefaults, File.expand_path("../action/sane_defaults",__FILE__)
autoload :SetupPackageFiles, File.expand_path("../action/setup_package_files", __FILE__)
autoload :SetName, File.expand_path("../action/set_name", __FILE__)
autoload :Suspend, File.expand_path("../action/suspend", __FILE__)
autoload :Boot, File.expand_path('../action/boot', __FILE__)
autoload :HandleGuestTools, File.expand_path('../action/handle_guest_tools', __FILE__)
autoload :HandleForwardedPortCollisions, File.expand_path('../action/handle_forwarded_port_collisions.rb', __FILE__)
autoload :ClearNetworkInterfaces, File.expand_path('../action/clear_network_interfaces', __FILE__)
autoload :ClearForwardedPorts, File.expand_path('../action/clear_forwarded_ports', __FILE__)
autoload :Customize, File.expand_path('../action/customize', __FILE__)
autoload :Destroy, File.expand_path('../action/destroy', __FILE__)
autoload :DestroyUnusedNetworkInterfaces, File.expand_path('../action/destroy_unused_network_interfaces', __FILE__)
autoload :Export, File.expand_path('../action/export', __FILE__)
autoload :ForcedHalt, File.expand_path('../action/forced_halt', __FILE__)
autoload :ForwardPorts, File.expand_path('../action/forward_ports', __FILE__)
autoload :Import, File.expand_path('../action/import', __FILE__)
autoload :Network, File.expand_path('../action/network', __FILE__)
autoload :Package, File.expand_path('../action/package', __FILE__)
autoload :PackageConfigFiles, File.expand_path('../action/package_config_files', __FILE__)
autoload :PrepareForwardedPortCollisionParams, File.expand_path('../action/prepare_forwarded_port_collision_params', __FILE__)
autoload :PrepareNFSSettings, File.expand_path('../action/prepare_nfs_settings', __FILE__)
autoload :PrepareNFSValidIds, File.expand_path('../action/prepare_nfs_valid_ids', __FILE__)
autoload :Resume, File.expand_path('../action/resume', __FILE__)
autoload :SaneDefaults, File.expand_path('../action/sane_defaults',__FILE__)
autoload :SetupPackageFiles, File.expand_path('../action/setup_package_files', __FILE__)
autoload :SetName, File.expand_path('../action/set_name', __FILE__)
autoload :Suspend, File.expand_path('../action/suspend', __FILE__)
end
end
end
3 changes: 1 addition & 2 deletions lib/vagrant-parallels/action/boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ def initialize(app, env)
def call(env)
@env = env

env[:ui].info I18n.t("vagrant.actions.vm.boot.booting")
env[:ui].info I18n.t('vagrant.actions.vm.boot.booting')
env[:machine].provider.driver.start

@app.call(env)
end

end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-parallels/action/clear_network_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def initialize(app, env)

def call(env)
# Delete all disabled network adapters
env[:ui].info I18n.t("vagrant.actions.vm.clear_network_interfaces.deleting")
env[:ui].info I18n.t('vagrant.actions.vm.clear_network_interfaces.deleting')
env[:machine].provider.driver.delete_disabled_adapters

@app.call(env)
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-parallels/action/customize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def call(env)
end

if !customizations.empty?
env[:ui].info I18n.t("vagrant.actions.vm.customize.running", event: @event)
env[:ui].info I18n.t('vagrant.actions.vm.customize.running', event: @event)

# Execute each customization command.
customizations.each do |command|
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-parallels/action/destroy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(app, env)
end

def call(env)
env[:ui].info I18n.t("vagrant.actions.vm.destroy.destroying")
env[:ui].info I18n.t('vagrant.actions.vm.destroy.destroying')
env[:machine].provider.driver.delete
env[:machine].id = nil

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "log4r"
require 'log4r'

module VagrantPlugins
module Parallels
Expand All @@ -10,7 +10,7 @@ def initialize(app, env)

def call(env)
if env[:machine].provider_config.destroy_unused_network_interfaces
env[:ui].info I18n.t("vagrant.actions.vm.destroy_network.destroying")
env[:ui].info I18n.t('vagrant.actions.vm.destroy_network.destroying')
env[:machine].provider.driver.delete_unused_host_only_networks
end

Expand Down
Loading

0 comments on commit 5677b20

Please sign in to comment.