2010-08-17 01:21:17 +00:00
|
|
|
require 'rake/gempackagetask'
|
2010-07-28 19:30:56 +00:00
|
|
|
|
|
|
|
namespace :gem do
|
|
|
|
GEM_SPEC = Gem::Specification.new do |s|
|
|
|
|
unless s.respond_to?(:add_development_dependency)
|
2010-08-17 01:21:17 +00:00
|
|
|
puts 'The gem spec requires a newer version of RubyGems.'
|
2010-07-28 19:30:56 +00:00
|
|
|
exit(1)
|
|
|
|
end
|
|
|
|
|
|
|
|
s.name = PKG_NAME
|
|
|
|
s.version = PKG_VERSION
|
2011-08-02 18:39:46 +00:00
|
|
|
s.author = PKG_AUTHOR
|
|
|
|
s.email = PKG_AUTHOR_EMAIL
|
2010-07-28 19:30:56 +00:00
|
|
|
s.summary = PKG_SUMMARY
|
|
|
|
s.description = PKG_DESCRIPTION
|
|
|
|
|
|
|
|
s.files = PKG_FILES.to_a
|
2010-10-12 01:53:40 +00:00
|
|
|
s.executables << 'google-api'
|
2010-07-28 19:30:56 +00:00
|
|
|
|
|
|
|
s.has_rdoc = true
|
|
|
|
s.extra_rdoc_files = %w( README )
|
2010-08-17 01:21:17 +00:00
|
|
|
s.rdoc_options.concat ['--main', 'README']
|
2010-07-28 19:30:56 +00:00
|
|
|
|
2010-10-22 17:14:02 +00:00
|
|
|
# Dependencies used in the main library
|
2011-05-12 20:23:18 +00:00
|
|
|
s.add_runtime_dependency('signet', '~> 0.2.2')
|
2011-05-04 11:44:35 +00:00
|
|
|
s.add_runtime_dependency('addressable', '~> 2.2.2')
|
|
|
|
s.add_runtime_dependency('httpadapter', '~> 1.0.0')
|
2011-05-12 20:23:18 +00:00
|
|
|
s.add_runtime_dependency('json', '>= 1.4.6')
|
2010-10-12 23:26:41 +00:00
|
|
|
s.add_runtime_dependency('extlib', '>= 0.9.15')
|
2010-08-10 04:44:14 +00:00
|
|
|
|
2010-10-22 17:14:02 +00:00
|
|
|
# Dependencies used in the CLI
|
|
|
|
s.add_runtime_dependency('launchy', '>= 0.3.2')
|
|
|
|
|
|
|
|
# Dependencies used in the examples
|
2011-05-12 20:27:41 +00:00
|
|
|
s.add_development_dependency('sinatra', '>= 1.2.0')
|
2010-10-22 17:14:02 +00:00
|
|
|
|
2010-08-17 01:21:17 +00:00
|
|
|
s.add_development_dependency('rake', '>= 0.7.3')
|
2010-10-13 21:16:07 +00:00
|
|
|
s.add_development_dependency('rspec', '~> 1.2.9')
|
2010-10-22 17:15:22 +00:00
|
|
|
s.add_development_dependency('rcov', '>= 0.9.9')
|
2010-08-17 01:21:17 +00:00
|
|
|
s.add_development_dependency('diff-lcs', '>= 1.1.2')
|
2010-07-28 19:30:56 +00:00
|
|
|
|
2010-08-17 01:21:17 +00:00
|
|
|
s.require_path = 'lib'
|
2010-07-28 19:30:56 +00:00
|
|
|
|
|
|
|
s.homepage = PKG_HOMEPAGE
|
|
|
|
end
|
|
|
|
|
|
|
|
Rake::GemPackageTask.new(GEM_SPEC) do |p|
|
|
|
|
p.gem_spec = GEM_SPEC
|
|
|
|
p.need_tar = true
|
|
|
|
p.need_zip = true
|
|
|
|
end
|
|
|
|
|
2010-08-17 01:21:17 +00:00
|
|
|
desc 'Show information about the gem'
|
2010-07-28 19:30:56 +00:00
|
|
|
task :debug do
|
|
|
|
puts GEM_SPEC.to_ruby
|
|
|
|
end
|
|
|
|
|
2010-08-17 01:21:17 +00:00
|
|
|
desc 'Install the gem'
|
|
|
|
task :install => ['clobber', 'gem:package'] do
|
2010-07-28 19:30:56 +00:00
|
|
|
sh "#{SUDO} gem install --local pkg/#{GEM_SPEC.full_name}"
|
|
|
|
end
|
|
|
|
|
2010-08-17 01:21:17 +00:00
|
|
|
desc 'Uninstall the gem'
|
2010-07-28 19:30:56 +00:00
|
|
|
task :uninstall do
|
|
|
|
installed_list = Gem.source_index.find_name(PKG_NAME)
|
|
|
|
if installed_list &&
|
|
|
|
(installed_list.collect { |s| s.version.to_s}.include?(PKG_VERSION))
|
|
|
|
sh(
|
|
|
|
"#{SUDO} gem uninstall --version '#{PKG_VERSION}' " +
|
|
|
|
"--ignore-dependencies --executables #{PKG_NAME}"
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-08-17 01:21:17 +00:00
|
|
|
desc 'Reinstall the gem'
|
2010-07-28 19:30:56 +00:00
|
|
|
task :reinstall => [:uninstall, :install]
|
|
|
|
end
|
|
|
|
|
2010-08-17 01:21:17 +00:00
|
|
|
desc 'Alias to gem:package'
|
|
|
|
task 'gem' => 'gem:package'
|
2010-07-28 19:30:56 +00:00
|
|
|
|
2010-08-17 01:21:17 +00:00
|
|
|
task 'clobber' => ['gem:clobber_package']
|