File: Rakefile

package info (click to toggle)
ruby-daemons 1.1.5-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 292 kB
  • sloc: ruby: 2,331; makefile: 5
file content (90 lines) | stat: -rwxr-xr-x 2,415 bytes parent folder | download | duplicates (3)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
require 'rubygems'
#Gem::manage_gems

require 'rake/gempackagetask'
#require 'rake/testtask'
require 'rake/packagetask'
require 'rake/rdoctask'

$LOAD_PATH << './lib'
require 'daemons'


PKG_NAME = "daemons"

PKG_FILES = FileList[
  "Rakefile", "Releases", "TODO", "README", "LICENSE",
  "setup.rb",
  "lib/**/*.rb",
  #"test/**/*",
  "examples/**/*.rb"
]
#PKG_FILES.exclude(%r(^test/tmp/.+))
PKG_FILES.exclude(%r(\.pid$))
PKG_FILES.exclude(%r(\.log$))
PKG_FILES.exclude(%r(\.output$))
PKG_FILES.exclude(%r(\.txt$))

spec = Gem::Specification.new do |s|
  s.name = PKG_NAME
  s.version = Daemons::VERSION
  s.author = "Thomas Uehlinger"
  s.email = "th.uehlinger@gmx.ch"
  s.rubyforge_project = "daemons"
  s.homepage = "http://daemons.rubyforge.org"
  s.platform  = Gem::Platform::RUBY
  s.summary = "A toolkit to create and control daemons in different ways"
  s.description = <<-EOF
    Daemons provides an easy way to wrap existing ruby scripts (for example a self-written server) 
    to be run as a daemon and to be controlled by simple start/stop/restart commands.
    
    You can also call blocks as daemons and control them from the parent or just daemonize the current
    process.
    
    Besides this basic functionality, daemons offers many advanced features like exception 
    backtracing and logging (in case your ruby script crashes) and monitoring and automatic
    restarting of your processes if they crash.
  EOF
    
  #s.files = FileList["{test,lib}/**/*"].exclude("rdoc").to_a
  s.files = PKG_FILES
  s.require_path = "lib"
  s.autorequire = "daemons"
  s.has_rdoc = true
  s.extra_rdoc_files = ["README", "Releases", "TODO"]
end

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


#Rake::PackageTask.new("package") do |p|
#  p.name = PKG_NAME
#  p.version = Daemons::VERSION
#  p.need_tar = true
#  p.need_zip = true
#  p.package_files = PKG_FILES
#end

 
task :default => [:package]

desc 'Show information about the gem.'
task :debug_gem do
  puts spec.to_ruby
end

task :upload do
  sh "scp -r html/* uehli@rubyforge.org:/var/www/gforge-projects/daemons"
end


desc "Create the RDOC html files"
rd = Rake::RDocTask.new("rdoc") { |rdoc|
  rdoc.rdoc_dir = 'html'
  rdoc.title    = "Daemons"
  rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
  rdoc.rdoc_files.include('README', 'TODO', 'Releases')
  rdoc.rdoc_files.include('lib/**/*.rb')
}