grempe / amazon-ec2

A Ruby Gem that gives you full access to several of the Amazon Web Services API from your Ruby/Ruby on Rails apps

amazon-ec2 / Rakefile
5b3a2c0a » grempe 2008-04-25 MAJOR cleanup of RubyForge ... 1 require 'rubygems'
6e318691 » grempe 2009-06-06 Converted to technicalpickl... 2 require 'rake'
5b3a2c0a » grempe 2008-04-25 MAJOR cleanup of RubyForge ... 3
6e318691 » grempe 2009-06-06 Converted to technicalpickl... 4 begin
5 require 'jeweler'
6 Jeweler::Tasks.new do |gem|
7 gem.name = "amazon-ec2"
8 gem.summary = %Q{Amazon EC2 Ruby Gem}
9 gem.description = %Q{An interface library that allows Ruby applications to easily connect to the HTTP 'Query API' for the Amazon Web Services Elastic Compute Cloud (EC2) and manipulate cloud servers.}
10 gem.email = "glenn@rempe.us"
11 gem.homepage = "http://github.com/grempe/amazon-ec2"
12 gem.authors = ["Glenn Rempe"]
13 # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
5b3a2c0a » grempe 2008-04-25 MAJOR cleanup of RubyForge ... 14
6e318691 » grempe 2009-06-06 Converted to technicalpickl... 15 # gem.autorequire = 'EC2'
16 gem.rdoc_options = ["--quiet", "--title", "amazon-ec2 documentation", "--opname", "index.html", "--line-numbers", "--main", "README.rdoc", "--inline-source"]
17
18 gem.rubyforge_project = 'amazon-ec2'
5b3a2c0a » grempe 2008-04-25 MAJOR cleanup of RubyForge ... 19
06df99e5 » grempe 2009-06-11 Added Rip dep.rip file (hel... 20 gem.add_dependency('xml-simple', '>= 1.0.12')
21 gem.add_development_dependency('mocha', '>= 0.9.5')
22 gem.add_development_dependency('test-spec', '>= 0.10.0')
6e318691 » grempe 2009-06-06 Converted to technicalpickl... 23 gem.add_development_dependency('rcov', '>= 0.8.1.2.0')
bf7b7a80 » grempe 2009-06-13 Add a rake task to view res... 24 gem.add_development_dependency('perftools.rb', '= 0.1.6')
6e318691 » grempe 2009-06-06 Converted to technicalpickl... 25
26 end
27
28 rescue LoadError
29 puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
5b3a2c0a » grempe 2008-04-25 MAJOR cleanup of RubyForge ... 30 end
31
6e318691 » grempe 2009-06-06 Converted to technicalpickl... 32 require 'rake/testtask'
33 Rake::TestTask.new(:test) do |test|
34 test.libs << 'lib' << 'test'
35 test.pattern = 'test/**/test_*.rb'
36 test.verbose = true
b6b2288d » kunley 2009-02-02 Added rake target to quickl... 37 end
38
6e318691 » grempe 2009-06-06 Converted to technicalpickl... 39 begin
40 require 'rcov/rcovtask'
41 Rcov::RcovTask.new do |test|
42 test.libs << 'test'
43 test.pattern = 'test/**/test_*.rb'
44 test.verbose = true
45 end
46 rescue LoadError
47 task :rcov do
48 abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
49 end
5b3a2c0a » grempe 2008-04-25 MAJOR cleanup of RubyForge ... 50 end
51
6e318691 » grempe 2009-06-06 Converted to technicalpickl... 52
53 task :default => :test
54
55 require 'rake/rdoctask'
56 Rake::RDocTask.new do |rdoc|
57 if File.exist?('VERSION.yml')
58 config = YAML.load(File.read('VERSION.yml'))
59 version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
60 else
61 version = ""
62 end
63
64 rdoc.rdoc_dir = 'rdoc'
65 rdoc.title = "amazon-ec2 #{version}"
66 rdoc.rdoc_files.include('README*')
67 rdoc.rdoc_files.include('lib/**/*.rb')
5b3a2c0a » grempe 2008-04-25 MAJOR cleanup of RubyForge ... 68 end
a6fab5ff » rsanheim 2009-03-08 default rake task should ru... 69
6e318691 » grempe 2009-06-06 Converted to technicalpickl... 70 begin
71 require 'rake/contrib/sshpublisher'
72 namespace :rubyforge do
73
74 desc "Release gem and RDoc documentation to RubyForge"
75 task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
76
77 namespace :release do
78 desc "Publish RDoc to RubyForge."
79 task :docs => [:rdoc] do
80 config = YAML.load(
81 File.read(File.expand_path('~/.rubyforge/user-config.yml'))
82 )
83
84 host = "#{config['username']}@rubyforge.org"
d2bd15cc » grempe 2009-06-06 Fixed minor issue with push... 85 remote_dir = "/var/www/gforge-projects/amazon-ec2/"
6e318691 » grempe 2009-06-06 Converted to technicalpickl... 86 local_dir = 'rdoc'
87
88 Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
89 end
90 end
91 end
92 rescue LoadError
93 puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
94 end
bf7b7a80 » grempe 2009-06-13 Add a rake task to view res... 95
96 desc "Generate a perftools.rb profile"
97 task :profile do
98 system("CPUPROFILE=perftools/ec2prof RUBYOPT='-r/usr/local/lib/ruby/gems/1.8/gems/perftools.rb-0.1.6/lib/perftools.bundle' ruby -r'rubygems' bin/ec2-gem-profile.rb")
99 system("pprof.rb --text --ignore=Gem perftools/ec2prof > perftools/ec2prof-results.txt")
100 system("pprof.rb --dot --ignore=Gem perftools/ec2prof > perftools/ec2prof-results.dot")
101 end