Sha256: 9cb443eba6c7d0ee51131237dc990b8da6b845d8e7ec2448e8a78d16e22345f4

Contents?: true

Size: 1.68 KB

Versions: 6

Compression:

Stored size: 1.68 KB

Contents

require "rake/testtask"

spec = Gem::Specification.load(Dir["*.gemspec"].first)

desc "Build the Gem"
task :build do
  sh "gem build #{spec.name}.gemspec"
end

desc "Install #{spec.name} locally"
task :install=>:build do
  sudo = "sudo" unless File.writable?( Gem::ConfigMap[:bindir])
  sh "#{sudo} gem install #{spec.name}-#{spec.version}.gem"
end

desc "Push new release to gemcutter and git tag"
task :push=>["test:all", "build"] do
  sh "git push"
  puts "Tagging version #{spec.version} .."
  sh "git tag v#{spec.version}"
  sh "git push --tag"
  puts "Building and pushing gem .."
  sh "gem push #{spec.name}-#{spec.version}.gem"
end

desc "Run all tests"
Rake::TestTask.new do |task|
  task.test_files = FileList['test/**/*_test.rb']
  if Rake.application.options.trace
    #task.warning = true
    task.verbose = true
  elsif Rake.application.options.silent
    task.ruby_opts << "-W0"
  else
    task.verbose = true
  end
    task.ruby_opts << "-I."
end

namespace :test do
  task :all=>["test:sinatra", "test:rails2", "test:rails3"]
  desc "Run all tests against Sinatra"
  task :sinatra do
    sh "rake test FRAMEWORK=sinatra"
  end
  desc "Run all tests against Rails"
  task :rails do
    sh "rake test FRAMEWORK=rails"
  end
  desc "Run all tests against Rails 2.3.x"
  task :rails2 do
    sh "env BUNDLE_GEMFILE=Rails2 rake test FRAMEWORK=rails"
  end
  desc "Run all tests against Rails 3.x"
  task :rails3 do
    sh "env BUNDLE_GEMFILE=Rails3 bundle exec rake test FRAMEWORK=rails"
  end
end
task :default=>"test:all"

begin 
  require "yard"
  YARD::Rake::YardocTask.new do |doc|
    doc.files = FileList["lib/**/*.rb"]
  end
rescue LoadError
end

task :clobber do
  rm_rf %w{doc .yardoc *.gem}
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rack-oauth2-server-2.0.0.beta5 Rakefile
rack-oauth2-server-2.0.0.beta4 Rakefile
rack-oauth2-server-2.0.0.beta3 Rakefile
rack-oauth2-server-2.0.0.beta2 Rakefile
rack-oauth2-server-2.0.0.beta Rakefile
rack-oauth2-server-1.4.6 Rakefile