forked from bdurand/lumberjack_syslog_device
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
56 lines (48 loc) · 1.36 KB
/
Rakefile
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
require 'rubygems'
require 'rake'
require 'rubygems/package_task'
require 'rdoc/task'
desc 'Default: run unit tests.'
task :default => :test
desc 'RVM likes to call it tests'
task :tests => :test
begin
require 'rspec'
require 'rspec/core/rake_task'
desc 'Run the unit tests'
RSpec::Core::RakeTask.new(:test)
rescue LoadError
task :test do
STDERR.puts "You must have rspec 2.0 installed to run the tests"
end
end
desc 'Generate rdoc.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.options << '--title' << 'Lumberjack Syslog Device' << '--line-numbers' << '--inline-source' << '--main' << 'README.rdoc'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end
namespace :rbx do
desc "Cleanup *.rbc files in lib directory"
task :delete_rbc_files do
FileList["lib/**/*.rbc"].each do |rbc_file|
File.delete(rbc_file)
end
nil
end
end
spec_file = File.expand_path('../lumberjack_syslog_device.gemspec', __FILE__)
if File.exist?(spec_file)
spec = eval(File.read(spec_file))
Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
end
Rake.application["package"].prerequisites.unshift("rbx:delete_rbc_files")
desc "Release to rubygems.org"
task :release => :package do
require 'rake/gemcutter'
Rake::Gemcutter::Tasks.new(spec).define
Rake::Task['gem:push'].invoke
end
end