Sha256: 497fae0574227711ab5edd6032944c325672531de5b38b98abd988b15526c8a5

Contents?: true

Size: 1.34 KB

Versions: 4

Compression:

Stored size: 1.34 KB

Contents

require 'rake'
require 'rake/testtask'
require 'rdoc/task'
require 'rails/version'
require 'bundler/gem_tasks'

desc 'Default: run unit tests.'
task :default => [:setup_and_run_tests, :rubocop]

desc 'Test the wicked_pdf plugin.'
Rake::TestTask.new(:test) do |t|
  t.libs << 'lib'
  t.libs << 'test'
  t.pattern = 'test/**/*_test.rb'
  t.verbose = true
end

desc 'Run RuboCop'
task :rubocop do
  return unless RUBY_VERSION > '1.9.2'
  require 'rubocop/rake_task'
  RuboCop::RakeTask.new
end

desc 'Setup and run all tests'
task :setup_and_run_tests do
  unless File.exist?('test/dummy/config/environment.rb')
    Rake::Task[:dummy_generate].invoke
  end
  Rake::Task[:test].invoke
end

desc 'Generate dummy application for test cases'
task :dummy_generate do
  Rake::Task[:dummy_remove].invoke
  puts 'Creating dummy application to run tests'
  prefix = (Rails::VERSION::MAJOR == 2) ? '' : 'new '
  system("rails #{prefix}test/dummy")
  FileUtils.rm_r Dir.glob('test/dummy/test/*')
end

desc 'Remove dummy application'
task :dummy_remove do
  FileUtils.rm_r Dir.glob('test/dummy/*')
end

desc 'Generate documentation for the wicked_pdf plugin.'
RDoc::Task.new(:rdoc) do |rdoc|
  rdoc.rdoc_dir = 'rdoc'
  rdoc.title    = 'WickedPdf'
  rdoc.options << '--line-numbers' << '--inline-source'
  rdoc.rdoc_files.include('README.md')
  rdoc.rdoc_files.include('lib/**/*.rb')
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wicked_pdf-1.0.4 Rakefile
wicked_pdf-1.0.3 Rakefile
wicked_pdf-1.0.2 Rakefile
wicked_pdf-1.0.1 Rakefile