Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: f8178afa89
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (28 sloc) 0.862 kb
#!/usr/bin/env rake
@cookbook = "nodejs"
desc "Runs foodcritic linter"
task :foodcritic do
if Gem::Version.new("1.9.2") <= Gem::Version.new(RUBY_VERSION.dup)
sandbox = File.join(File.dirname(__FILE__), %w{tmp foodcritic}, @cookbook)
prepare_foodcritic_sandbox(sandbox)
sh "foodcritic --epic-fail any #{File.dirname(sandbox)}"
else
puts "WARN: foodcritic run is skipped as Ruby #{RUBY_VERSION} is < 1.9.2."
end
end
task :default => 'foodcritic'
private
def prepare_foodcritic_sandbox(sandbox)
files = %w{*.md *.rb attributes definitions files providers
recipes resources templates}
rm_rf sandbox
mkdir_p sandbox
cp_r Dir.glob("{#{files.join(',')}}"), sandbox
puts "\n\n"
end
begin
require 'jamie/rake_tasks'
Jamie::RakeTasks.new
rescue LoadError
puts ">>>>> Jamie gem not loaded, omitting tasks" unless ENV['CI']
end
Jump to Line
Something went wrong with that request. Please try again.