Skip to content
This repository
branch: 0-4-stable
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 78 lines (64 sloc) 1.894 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
require 'rubygems'
require 'rake/gempackagetask'
require "spec/rake/spectask"
begin; require 'rubygems'; rescue LoadError; end
begin
  require 'hanna/rdoctask'
rescue LoadError
  require 'rake/rdoctask'
end
require 'rake/clean'
require 'lib/nanite'

GEM = "nanite"
AUTHOR = "Ezra Zygmuntowicz"
EMAIL = "ezra@engineyard.com"
HOMEPAGE = "http://github.com/ezmobius/nanite"
SUMMARY = "self assembling fabric of ruby daemons"

Dir.glob('tasks/*.rake').each { |r| Rake.application.add_import r }

spec = Gem::Specification.new do |s|

  s.name = GEM
  s.version = Nanite::VERSION
  s.platform = Gem::Platform::RUBY
  s.has_rdoc = true
  s.extra_rdoc_files = ["README.rdoc", "LICENSE", 'TODO']
  s.summary = SUMMARY
  s.description = s.summary
  s.author = AUTHOR
  s.email = EMAIL
  s.homepage = HOMEPAGE

  s.bindir = "bin"
  s.executables = %w( nanite-agent nanite-mapper nanite-admin )

  s.add_dependency('amqp', '>= 0.6.0')
  s.add_dependency('json', '>= 1.1.7')

  s.require_path = 'lib'
  s.files = %w(LICENSE README.rdoc Rakefile TODO) + Dir.glob("{lib,bin,specs}/**/*")
end

Rake::GemPackageTask.new(spec) do |pkg|
  pkg.gem_spec = spec
end

task :default => :spec

task :install => [:package] do
  sh %{sudo gem install pkg/#{GEM}-#{Nanite::VERSION}}
end

desc "Run unit specs"
Spec::Rake::SpecTask.new do |t|
  t.spec_opts = ["--format", "specdoc", "--colour"]
  t.spec_files = FileList["spec/**/*_spec.rb"]
end

desc 'Generate RDoc documentation'
Rake::RDocTask.new do |rd|
  rd.title = spec.name
  rd.rdoc_dir = 'rdoc'
  rd.main = "README.rdoc"
  rd.rdoc_files.include("lib/**/*.rb", *spec.extra_rdoc_files)
end
CLOBBER.include(:clobber_rdoc)

desc 'Generate and open documentation'
task :docs => :rdoc do
  case RUBY_PLATFORM
  when /darwin/ ; sh 'open rdoc/index.html'
  when /mswin|mingw/ ; sh 'start rdoc\index.html'
  else
    sh 'firefox rdoc/index.html'
  end
end
Something went wrong with that request. Please try again.