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
|
|
|
|
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-13 21:16:07 +00:00
|
|
|
s.add_runtime_dependency('signet', '>= 0.1.3')
|
2010-10-12 23:07:40 +00:00
|
|
|
s.add_runtime_dependency('addressable', '>= 2.2.2')
|
2010-09-13 21:54:26 +00:00
|
|
|
s.add_runtime_dependency('httpadapter', '>= 0.2.0')
|
2010-08-17 01:21:17 +00:00
|
|
|
s.add_runtime_dependency('json', '>= 1.1.9')
|
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-13 21:17:16 +00:00
|
|
|
s.add_development_dependency('rack', '= 1.2.0')
|
2010-10-13 21:28:58 +00:00
|
|
|
s.add_development_dependency('sinatra', '>= 1.0')
|
|
|
|
s.add_development_dependency('liquid', '>= 2.2.2')
|
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-08-17 01:21:17 +00:00
|
|
|
s.add_development_dependency('launchy', '>= 0.3.2')
|
|
|
|
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']
|