Sha256: 22f03ac49fa935b15e119531d2265882ffe1888ed7b7490b50cc0b03af42243a
Contents?: true
Size: 1.79 KB
Versions: 19
Compression:
Stored size: 1.79 KB
Contents
require 'rake' require 'rdoc/task' require 'rake/testtask' require 'tmpdir' require 'active_record' ActiveRecord::ActiveRecordError # hack for https://rails.lighthouseapp.com/projects/8994/tickets/2577-when-using-activerecordassociations-outside-of-rails-a-nameerror-is-thrown $:.unshift File.expand_path('../lib', __FILE__) $:.unshift File.expand_path('../../hobo_support/lib', __FILE__) $:.unshift File.expand_path('../../hobo_fields/lib', __FILE__) $:.unshift File.expand_path('../../dryml/lib', __FILE__) require 'hobo' include Rake::DSL RUBY = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']).sub(/.*\s.*/m, '"\&"') RUBYDOCTEST = ENV['RUBYDOCTEST'] || "#{RUBY} -S rubydoctest" GEM_ROOT = File.expand_path('../', __FILE__) TESTAPP_PATH = ENV['TESTAPP_PATH'] || File.join(Dir.tmpdir, 'hobo_testapp') BIN = File.expand_path('../bin/hobo', __FILE__) require 'hobo_support/common_tasks' include HoboSupport::CommonTasks desc "Default Task" task :default => [ :test ] # --- Testing --- # desc "Run all unit tests" Rake::TestTask.new(:test) { |t| t.libs << "test" t.test_files=Dir.glob( "test/**/*_test.rb" ).sort t.verbose = true } namespace "test" do desc "Run the doctests" task :doctest do |t| files=Dir['test/doctest/**/*.rdoctest'].map {|f| File.expand_path(f)}.join(' ') exit(1) if !system("#{RUBYDOCTEST} #{files}") end desc "Run the irt tests" task :irt => :prepare_testapp do |t| chdir TESTAPP_PATH sh %(irt #{File.expand_path('.',GEM_ROOT)}) end end # --- RDoc --- # desc 'Generate documentation for the Hobo plugin.' Rake::RDocTask.new(:rdoc) do |rdoc| rdoc.rdoc_dir = 'rdoc' rdoc.title = 'Hobo' rdoc.options << '--line-numbers' << '--inline-source' rdoc.rdoc_files.include('README') rdoc.rdoc_files.include('lib/**/*.rb') end
Version data entries
19 entries across 19 versions & 1 rubygems