Sha256: a02b9423754ec2342ce92a69fcf2f2b21b97c8cde6be508cefb51a3221370783

Contents?: true

Size: 773 Bytes

Versions: 6

Compression:

Stored size: 773 Bytes

Contents

require 'json'
require 'rubocop/rake_task'
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'

RuboCop::RakeTask.new
RSpec::Core::RakeTask.new(:spec)

desc 'Validation tests'
task :validate do
  puts '=== Validating JSON (*.json) files'
  filelist = FileList.new('**/*.json')
  filelist.exclude('.bundle/**')
  filelist.each do |json_file|
    puts json_file
    json = File.read(json_file)
    JSON.parse(json)
  end

  puts "\n=== Validating ruby (*.rb, Vagrantfile, Rakefile and Gemfile) files"
  Dir['**/*.rb', 'Vagrantfile', 'Rakefile', 'Gemfile'].each do |ruby|
    sh "ruby -c #{ruby}"
  end

  puts "\n=== Validating ERB (*.erb) files"
  Dir['**/*.erb'].each do |erb|
    sh "erb -P -x -T '-' #{erb} | ruby -c"
  end
end

task :default => %i[validate spec]

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rzo-0.7.0 Rakefile
rzo-0.6.0 Rakefile
rzo-0.5.0 Rakefile
rzo-0.4.0 Rakefile
rzo-0.3.0 Rakefile
rzo-0.2.0 Rakefile