Sha256: e4c6dc9faea6bd6d6983da09ef954b2815e696f9d2c107aa68ea1d310b53bc47

Contents?: true

Size: 1.21 KB

Versions: 7

Compression:

Stored size: 1.21 KB

Contents

# RSpec tasks
begin
  require 'rspec/core/rake_task'

  # Create the 'spec' task
  RSpec::Core::RakeTask.new(:spec) do |task|
    task.rspec_opts = '--color'
  end

  namespace :spec do
    desc "Run the test suite and generate coverage metrics"
    task :coverage => [ :simplecov, :spec ]

    # Add test coverage to the 'spec' task.
    task :simplecov do
      ENV['COVERAGE'] = '1'
    end
  end

  task :default => :spec
rescue LoadError
  warn "[Warning]: Could not load `rspec`."
end

# YARD tasks
begin
  require 'yard'
  require 'yard/rake/yardoc_task'

  YARD::Rake::YardocTask.new(:doc) do |yardoc|
    yardoc.files = [ 'lib/**/*.rb', '-', '**/*.md' ]
  end
rescue LoadError
  warn "[Warning]: Could not load `yard`."
end

# Cane tasks
begin
  require 'cane/rake_task'

  Cane::RakeTask.new(:cane) do |cane|
    cane.add_threshold 'coverage/.last_run.json', :>=, 100
    cane.abc_max = 15
  end

  Rake::Task['cane'].prerequisites << Rake::Task['spec:coverage']
  Rake::Task[:default].clear_prerequisites
  task :default => :cane
rescue LoadError
  warn "[Warning]: Could not load `cane`."
end

# Bundler tasks
begin
  require "bundler/gem_tasks"
rescue LoadError
  warn "[Warning]: Could not load `bundler/gem_tasks`."
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
semantic_puppet-1.1.1 Rakefile
semantic_puppet-1.1.0 Rakefile
semantic_puppet-1.0.4 Rakefile
semantic_puppet-1.0.3 Rakefile
semantic_puppet-1.0.2 Rakefile
semantic_puppet-0.1.3 Rakefile
semantic_puppet-0.1.2 Rakefile