require "bundler/gem_tasks" require "rspec/core/rake_task" desc "Run all specs in spec directory" RSpec::Core::RakeTask.new(:test) do |t| t.pattern = "spec/**/*_spec.rb" end desc "Display LOC stats" task :stats do puts "\n## Production Code Stats" sh "countloc -r lib" end begin require "chefstyle" require "rubocop/rake_task" RuboCop::RakeTask.new(:style) do |task| task.options += ["--display-cop-names", "--no-color"] end rescue LoadError puts "chefstyle is not available. (sudo) gem install chefstyle to do style checking." end task default: %i{test style}