Permalink
Browse files

Refactor rake and foodcritic tasks.

  • Loading branch information...
1 parent 6cd7958 commit fb60f2f20a3acda54b10a0426ecd33e8cd312303 @fnichol fnichol committed Nov 12, 2012
Showing with 12 additions and 78 deletions.
  1. +0 −3 .travis.yml
  2. +8 −0 Gemfile
  3. +4 −24 Rakefile
  4. +0 −4 test/support/Gemfile
  5. +0 −47 test/support/Gemfile.lock
View
@@ -1,6 +1,3 @@
language: ruby
-gemfile:
- - test/support/Gemfile
rvm:
- 1.9.3
-script: BUNDLE_GEMFILE=test/support/Gemfile bundle exec rake foodcritic
View
@@ -0,0 +1,8 @@
+source 'https://rubygems.org'
+
+gem 'rake'
+gem 'minitest'
+gem 'foodcritic', :platforms => :ruby_19
+
+# allow CI to override the version of Chef for matrix testing
+gem 'chef', (ENV['CHEF_VERSION'] || '>= 0.10.10')
View
@@ -1,29 +1,9 @@
#!/usr/bin/env rake
-@cookbook = "rvm"
+require 'foodcritic'
-desc "Runs foodcritc 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
+FoodCritic::Rake::LintTask.new do |t|
+ t.options = { :fail_tags => ['any'] }
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
+task :default => [:foodcritic]
View
@@ -1,4 +0,0 @@
-source "https://rubygems.org"
-
-gem 'rake'
-gem 'foodcritic', :platforms => :ruby_19
View
@@ -1,47 +0,0 @@
-GEM
- remote: https://rubygems.org/
- specs:
- coderay (0.9.8)
- foodcritic (1.2.0)
- gherkin (~> 2.8.0)
- gist (~> 2.0.4)
- nokogiri (~> 1.5.0, != 1.5.2, != 1.5.1)
- pry (~> 0.9.7.4)
- pry-doc (~> 0.3.0)
- rak (~> 1.4)
- treetop (~> 1.4.10)
- yajl-ruby (~> 1.1.0)
- gherkin (2.8.0)
- json (>= 1.4.6)
- gist (2.0.4)
- json (1.7.0)
- method_source (0.6.7)
- ruby_parser (>= 2.3.1)
- nokogiri (1.5.0)
- polyglot (0.3.3)
- pry (0.9.7.4)
- coderay (~> 0.9.8)
- method_source (~> 0.6.7)
- ruby_parser (>= 2.3.1)
- slop (~> 2.1.0)
- pry-doc (0.3.0)
- pry (>= 0.9.0)
- yard (>= 0.6.4)
- rak (1.4)
- rake (0.9.2.2)
- ruby_parser (2.3.1)
- sexp_processor (~> 3.0)
- sexp_processor (3.2.0)
- slop (2.1.0)
- treetop (1.4.10)
- polyglot
- polyglot (>= 0.3.1)
- yajl-ruby (1.1.0)
- yard (0.8.1)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- foodcritic
- rake

0 comments on commit fb60f2f

Please sign in to comment.