Sha256: fecc780f60fc5333c9d421061f2d77f82cfdbc832c74c7ad0f52893ca6789d50

Contents?: true

Size: 1.78 KB

Versions: 6

Compression:

Stored size: 1.78 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(Config::CONFIG['bindir'], Config::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

6 entries across 6 versions & 1 rubygems

Version Path
hobo-1.4.0.pre7 Rakefile
hobo-1.4.0.pre6 Rakefile
hobo-1.4.0.pre5 Rakefile
hobo-1.4.0.pre4 Rakefile
hobo-1.4.0.pre3 Rakefile
hobo-1.4.0.pre2 Rakefile