Sha256: a7eea9507154162aa0e49041c9c3dc3b564470d71a2554b67c9677eb94996c3a

Contents?: true

Size: 1.25 KB

Versions: 25

Compression:

Stored size: 1.25 KB

Contents

require 'optparse'

module Veewee
  module Command
    module Vagrant
      class Validate < ::Vagrant::Command::Base
        def execute
          options = {
            'tags' => %w{vagrant puppet chef virtualbox}
          }

          opts = OptionParser.new do |opts|
            opts.banner = "Validates a box against vagrant compliancy rules"
            opts.separator ""
            opts.separator "Usage: vagrant basebox validate <boxname>"

            opts.on("-d", "--debug", "enable debugging") do |d|
              options['debug'] = d
            end

            opts.on("-t", "--tags vagrant,puppet,chef", Array, "tags to validate") do |t|
              options['tags'] = t
            end

          end

          # Parse the options
          argv = parse_options(opts)
          return if !argv
          raise ::Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length < 1

          begin
            venv=Veewee::Environment.new(options)
            venv.ui=@env.ui
            box_name=argv[0]
            venv.providers["virtualbox"].get_box(box_name).validate_vagrant(options)
          rescue Veewee::Error => ex
            venv.ui.error(ex,:prefix => false)
            exit -1
          end

        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
veewee-0.5.0.alpha4 lib/veewee/command/vagrant/validate.rb
veewee-0.5.0.alpha3 lib/veewee/command/vagrant/validate.rb
veewee-0.5.0.alpha2 lib/veewee/command/vagrant/validate.rb
veewee-0.5.0.alpha1 lib/veewee/command/vagrant/validate.rb
veewee-0.4.5.1 lib/veewee/command/vagrant/validate.rb
veewee-0.4.5 lib/veewee/command/vagrant/validate.rb
veewee-0.4.5.pre1 lib/veewee/command/vagrant/validate.rb
veewee-0.4.4 lib/veewee/command/vagrant/validate.rb
veewee-0.4.3 lib/veewee/command/vagrant/validate.rb
veewee-0.4.2 lib/veewee/command/vagrant/validate.rb
veewee-0.4.1 lib/veewee/command/vagrant/validate.rb
veewee-0.4.0 lib/veewee/command/vagrant/validate.rb
veewee-0.3.12 lib/veewee/command/vagrant/validate.rb
veewee-0.3.11 lib/veewee/command/vagrant/validate.rb
veewee-0.3.10 lib/veewee/command/vagrant/validate.rb
veewee-0.3.9 lib/veewee/command/vagrant/validate.rb
veewee-atlassian-0.3.11 lib/veewee/command/vagrant/validate.rb
veewee-0.3.7 lib/veewee/command/vagrant/validate.rb
veewee-0.3.6 lib/veewee/command/vagrant/validate.rb
veewee-0.3.5 lib/veewee/command/vagrant/validate.rb