Skip to content

Commit

Permalink
Handles excluding the tailor task on ruby 1.8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
miketheman committed Aug 27, 2013
1 parent d299dea commit 8f85232
Showing 1 changed file with 25 additions and 14 deletions.
39 changes: 25 additions & 14 deletions Rakefile
Expand Up @@ -2,13 +2,35 @@ require 'bundler/gem_tasks'
require 'rake/testtask'
require 'rdoc/task'
require 'rspec/core/rake_task'
require 'tailor/rake_task'

# Assign some test keys if they aren't already set.
ENV["DATADOG_API_KEY"] ||= '9775a026f1ca7d1c6c5af9d94d9595a4'
ENV["DATADOG_APP_KEY"] ||= '87ce4a24b5553d2e482ea8a8500e71b8ad4554ff'

task :default => [:tailor, :spec, :test]
default_tests = [:spec, :test]

case RbConfig::CONFIG['ruby_version']
when '1.8'
# do nothing
else
# Since Tailor uses methods that don't exist in Ruby 1.8.7
require 'tailor/rake_task'
default_tests.unshift(:tailor)

Tailor::RakeTask.new do |task|
task.file_set 'lib/**/*.rb', :code do |style|
style.max_line_length 160, :level => :warn
style.max_code_lines_in_method 40, :level => :warn
end
task.file_set 'spec/**/*.rb', :tests do |style|
style.max_line_length 160, :level => :warn
style.max_code_lines_in_method 40, :level => :warn
end
end

end

task :default => default_tests

Rake::TestTask.new(:test) do |test|
test.libs.push 'lib'
Expand All @@ -25,18 +47,7 @@ RDoc::Task.new do |rd|
rd.title = 'DogAPI -- DataDog Client'
end

Tailor::RakeTask.new do |task|
task.file_set 'lib/**/*.rb', :code do |style|
style.max_line_length 160, level: :warn
style.max_code_lines_in_method 40, level: :warn
end
task.file_set 'spec/**/*.rb', :tests do |style|
style.max_line_length 160, level: :warn
style.max_code_lines_in_method 40, level: :warn
end
end

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

desc "Find notes in code"
task :notes do
Expand Down

0 comments on commit 8f85232

Please sign in to comment.