Sha256: 149c6424581ac579f673269148059c518acfce02d8d50d2f107dc2c6a39d7daa

Contents?: true

Size: 1.89 KB

Versions: 13

Compression:

Stored size: 1.89 KB

Contents

# encoding: utf-8
$:.push File.expand_path("../lib", __FILE__)

require 'bundler'
require 'bundler/setup'

require 'berkshelf'
require 'thor/rake_compat'

class Default < Thor
  class Gem < Thor
    include Thor::RakeCompat
    Bundler::GemHelper.install_tasks

    namespace :gem

    desc "build", "Build berkshelf-#{Berkshelf::VERSION}.gem into the pkg directory"
    def build
      Rake::Task["build"].execute
    end

    desc "release", "Create tag v#{Berkshelf::VERSION} and build and push berkshelf-#{Berkshelf::VERSION}.gem to Rubygems"
    def release
      Rake::Task["release"].execute
    end

    desc "install", "Build and install berkshelf-#{Berkshelf::VERSION}.gem into system gems"
    def install
      Rake::Task["install"].execute
    end
  end

  class Spec < Thor
    include Thor::Actions

    namespace :spec
    default_task :all

    desc "all", "Run all tests"
    def all
      unless run_unit && run_acceptance
        exit 1
      end
    end

    desc "ci", "Run all possible tests on Travis-CI"
    def ci
      ENV['CI'] = 'true' # Travis-CI also sets this, but set it here for local testing
      unless run_unit("--tag ~chef_server") && run_acceptance("--tags ~@chef_server")
        exit 1
      end
    end

    desc "unit", "Run unit tests"
    def unit
      unless run_unit
        exit 1
      end
    end

    desc "acceptance", "Run acceptance tests"
    def acceptance
      unless run_acceptance
        exit 1
      end
    end

    no_tasks do
      def run_unit(*flags)
        run "rspec --color --format=documentation #{flags.join(' ')} spec"
      end

      def run_acceptance(*flags)
        run "cucumber --color --format pretty --tags ~@no_run #{flags.join(' ')}"
      end
    end
  end

  class VCR < Thor
    namespace :vcr
    default_task :clean

    desc "clean", "clean VCR cassettes"
    def clean
      FileUtils.rm_rf("spec/fixtures/vcr_cassettes")
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
berkshelf-1.1.6 Thorfile
berkshelf-1.1.5 Thorfile
berkshelf-1.1.4 Thorfile
berkshelf-1.1.3 Thorfile
berkshelf-1.1.2 Thorfile
berkshelf-1.1.1 Thorfile
berkshelf-1.1.0 Thorfile
berkshelf-1.1.0.rc1 Thorfile
berkshelf-1.0.4 Thorfile
berkshelf-1.0.3 Thorfile
berkshelf-1.0.2 Thorfile
berkshelf-1.0.0 Thorfile
berkshelf-1.0.0.rc3 Thorfile