require 'rubygems'
require 'rake'

# Load merb-auth-core version information
require File.expand_path('../../merb-auth-core/lib/merb-auth-core/version', __FILE__)

# Load this library's version information
require File.expand_path('../lib/merb-auth-more/version', __FILE__)

begin

  gem 'jeweler', '~> 1.4'
  require 'jeweler'

  Jeweler::Tasks.new do |gemspec|

    gemspec.version     = Merb::Auth::More::VERSION.dup

    gemspec.name        = "merb-auth-more"
    gemspec.description = "Addons for merb-auth-core"
    gemspec.summary     = "Additional resources for use with the merb-auth-core authentication framework."

    gemspec.authors     = [ "Daniel Neighman" ]
    gemspec.email       = "has.sox@gmail.com"
    gemspec.homepage    = "http://merbivore.com/"

    gemspec.files       = %w(LICENSE Rakefile README.textile TODO) + Dir['{lib,spec}/**/*']

    # Runtime dependencies
    gemspec.add_dependency 'merb-auth-core', "~> #{Merb::Auth::Core::VERSION}"

    # Development dependencies              
    gemspec.add_development_dependency 'rspec', ">= 1.2.9"

  end

  Jeweler::GemcutterTasks.new

rescue LoadError
  puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end

require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:spec) do |spec|
  spec.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
  spec.libs << 'lib' << 'spec'
  spec.spec_files = FileList['spec/**/*_spec.rb']
end

Spec::Rake::SpecTask.new(:rcov) do |spec|
  spec.libs << 'lib' << 'spec'
  spec.pattern = 'spec/**/*_spec.rb'
  spec.rcov = true
end
