2009-05-18 03:13:06 -04:00
|
|
|
require 'rubygems'
|
|
|
|
require 'rake'
|
|
|
|
|
2009-08-10 23:43:31 -04:00
|
|
|
current_directory = File.dirname(__FILE__)
|
|
|
|
require "#{current_directory}/lib/fog"
|
|
|
|
|
2009-05-18 03:13:06 -04:00
|
|
|
begin
|
|
|
|
require 'jeweler'
|
|
|
|
Jeweler::Tasks.new do |gem|
|
2009-10-31 15:26:49 -04:00
|
|
|
gem.add_dependency('excon')
|
2009-08-17 19:35:58 -04:00
|
|
|
gem.add_dependency('mime-types')
|
|
|
|
gem.add_dependency('nokogiri')
|
|
|
|
gem.add_dependency('ruby-hmac')
|
2009-05-18 03:13:06 -04:00
|
|
|
gem.name = "fog"
|
2009-09-04 17:49:26 -04:00
|
|
|
gem.description = %Q{brings clouds to you}
|
|
|
|
gem.summary = %Q{fog = clouds + you}
|
2009-05-18 03:13:06 -04:00
|
|
|
gem.email = "me@geemus.com"
|
|
|
|
gem.homepage = "http://github.com/geemus/fog"
|
2009-10-07 17:27:20 -04:00
|
|
|
gem.authors = ["geemus (Wesley Beary)"]
|
2009-05-18 03:13:06 -04:00
|
|
|
gem.rubyforge_project = "fog"
|
|
|
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
|
|
|
end
|
|
|
|
rescue LoadError
|
|
|
|
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
|
|
|
end
|
|
|
|
|
|
|
|
require 'spec/rake/spectask'
|
|
|
|
Spec::Rake::SpecTask.new(:spec) do |spec|
|
|
|
|
spec.libs << 'lib' << 'spec'
|
2009-08-10 23:43:31 -04:00
|
|
|
spec.spec_opts = ['-c']
|
2009-05-18 03:13:06 -04:00
|
|
|
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
|
|
|
|
|
2009-08-10 23:43:31 -04:00
|
|
|
namespace :specs do
|
|
|
|
|
|
|
|
task :with_mocking do
|
2009-10-14 12:54:49 -04:00
|
|
|
Fog.mock!
|
2009-08-10 23:43:31 -04:00
|
|
|
Rake::Task[:spec].invoke
|
|
|
|
end
|
|
|
|
|
|
|
|
task :without_mocking do
|
2009-10-14 12:54:49 -04:00
|
|
|
Fog.mock!
|
2009-08-10 23:43:31 -04:00
|
|
|
Rake::Task[:spec].invoke
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
desc 'Run specs with and without mocking'
|
|
|
|
task :specs => %w[ specs:with_mocking specs:without_mocking ]
|
|
|
|
|
|
|
|
task :default => :specs
|
2009-05-18 03:13:06 -04:00
|
|
|
|
|
|
|
require 'rake/rdoctask'
|
|
|
|
Rake::RDocTask.new do |rdoc|
|
|
|
|
if File.exist?('VERSION.yml')
|
|
|
|
config = YAML.load(File.read('VERSION.yml'))
|
|
|
|
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
|
|
|
else
|
|
|
|
version = ""
|
|
|
|
end
|
|
|
|
|
|
|
|
rdoc.rdoc_dir = 'rdoc'
|
|
|
|
rdoc.title = "fog #{version}"
|
|
|
|
rdoc.rdoc_files.include('README*')
|
|
|
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
|
|
end
|
|
|
|
|
|
|
|
begin
|
|
|
|
require 'rake/contrib/sshpublisher'
|
|
|
|
namespace :rubyforge do
|
|
|
|
|
|
|
|
desc "Release gem and RDoc documentation to RubyForge"
|
|
|
|
task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
|
|
|
|
|
|
|
|
namespace :release do
|
|
|
|
desc "Publish RDoc to RubyForge."
|
|
|
|
task :docs => [:rdoc] do
|
|
|
|
config = YAML.load(
|
|
|
|
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
|
|
|
|
)
|
|
|
|
|
|
|
|
host = "#{config['username']}@rubyforge.org"
|
|
|
|
remote_dir = "/var/www/gforge-projects/fog/"
|
|
|
|
local_dir = 'rdoc'
|
|
|
|
|
|
|
|
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
rescue LoadError
|
|
|
|
puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
|
|
|
|
end
|
2009-10-14 13:22:59 -04:00
|
|
|
|
|
|
|
namespace :fog do
|
|
|
|
|
|
|
|
desc 'Provide a sample yaml file for credentials'
|
|
|
|
task :yml do
|
|
|
|
puts('Copy the following sample to ~/.fog and fill in with your credentials as needed:')
|
2009-11-22 18:58:42 -05:00
|
|
|
yml = <<YML
|
|
|
|
|
|
|
|
:default:
|
2009-11-27 00:04:49 -05:00
|
|
|
:aws_access_key_id: INTENTIONALLY_LEFT_BLANK
|
|
|
|
:aws_secret_access_key: INTENTIONALLY_LEFT_BLANK
|
|
|
|
:rackspace_api_key: INTENTIONALLY_LEFT_BLANK
|
|
|
|
:rackspace_username: INTENTIONALLY_LEFT_BLANK
|
|
|
|
:slicehost_password: INTENTIONALLY_LEFT_BLANK
|
2009-11-22 18:58:42 -05:00
|
|
|
|
|
|
|
YML
|
|
|
|
print(yml)
|
2009-10-14 13:22:59 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|