Rakefile 1023 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. begin
  2. require "rubygems"
  3. require "bundler"
  4. rescue LoadError
  5. raise "Could not load the bundler gem. Install it with `gem install bundler`."
  6. end
  7. if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("1.0.0")
  8. raise RuntimeError, "Your bundler version is too old for Mail" +
  9. "Run `gem install bundler` to upgrade."
  10. end
  11. begin
  12. # Set up load paths for all bundled gems
  13. ENV["BUNDLE_GEMFILE"] = File.expand_path("../Gemfile", __FILE__)
  14. Bundler.setup
  15. rescue Bundler::GemNotFound
  16. raise RuntimeError, "Bundler couldn't find some gems." +
  17. "Did you run `bundle install`?"
  18. end
  19. require File.expand_path('../spec/environment', __FILE__)
  20. require 'rake/testtask'
  21. require 'rspec/core/rake_task'
  22. desc "Build a gem file"
  23. task :build do
  24. system "gem build mail.gemspec"
  25. end
  26. task :default => :spec
  27. RSpec::Core::RakeTask.new(:spec) do |t|
  28. t.ruby_opts = '-w'
  29. t.rspec_opts = %w(--backtrace --color)
  30. end
  31. # load custom rake tasks
  32. Dir["#{File.dirname(__FILE__)}/lib/tasks/**/*.rake"].sort.each { |ext| load ext }