Upgrade RSpec 1.x to RSpec 2.10-x
[arvados.git] / Rakefile
1 lib_dir = File.expand_path('../lib', __FILE__)
2 $LOAD_PATH.unshift(lib_dir)
3 $LOAD_PATH.uniq!
4
5 require 'rubygems'
6 require 'rake'
7
8 gem 'rspec', '~> 2.10.0'
9 begin
10   require 'rspec/core/rake_task'
11 rescue LoadError
12   STDERR.puts "Please install rspec:"
13   STDERR.puts "sudo gem install rspec"
14   exit(1)
15 end
16
17 require File.join(File.dirname(__FILE__), 'lib/google/api_client', 'version')
18
19 PKG_DISPLAY_NAME   = 'Google API Client'
20 PKG_NAME           = PKG_DISPLAY_NAME.downcase.gsub(/\s/, '-')
21 PKG_VERSION        = Google::APIClient::VERSION::STRING
22 PKG_FILE_NAME      = "#{PKG_NAME}-#{PKG_VERSION}"
23 PKG_HOMEPAGE       = 'http://code.google.com/p/google-api-ruby-client/'
24
25 RELEASE_NAME       = "REL #{PKG_VERSION}"
26
27 PKG_AUTHOR         = "Bob Aman"
28 PKG_AUTHOR_EMAIL   = "bobaman@google.com"
29 PKG_SUMMARY        = 'Package Summary'
30 PKG_DESCRIPTION    = <<-TEXT
31 The Google API Ruby Client makes it trivial to discover and access supported
32 APIs.
33 TEXT
34
35 PKG_FILES = FileList[
36     'lib/**/*', 'spec/**/*', 'vendor/**/*',
37     'tasks/**/*', 'website/**/*',
38     '[A-Z]*', 'Rakefile'
39 ].exclude(/database\.yml/).exclude(/[_\.]git$/)
40
41 RCOV_ENABLED = (RUBY_PLATFORM != 'java' && RUBY_VERSION =~ /^1\.8/)
42 if RCOV_ENABLED
43   task :default => 'spec:rcov'
44 else
45   task :default => 'spec'
46 end
47
48 WINDOWS = (RUBY_PLATFORM =~ /mswin|win32|mingw|bccwin|cygwin/) rescue false
49 SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])
50
51 Dir['tasks/**/*.rake'].each { |rake| load rake }