forked from tra/spawnling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
48 lines (42 loc) · 1.69 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
require 'rake/rdoctask'
require 'rake/gempackagetask'
spec = Gem::Specification.new do |s|
s.name = 'spawn'
s.version = '1.0.1'
s.platform = Gem::Platform::RUBY
s.description = "This plugin provides a 'spawn' method to easily fork OR
thread long-running sections of code so that your application can return
results to your users more quickly. This plugin works by creating new database
connections in ActiveRecord::Base for the spawned block.
The plugin also patches ActiveRecord::Base to handle some known bugs when using
threads (see lib/patches.rb)."
s.summary = "Easily fork OR thread long-running sections of code in Ruby"
exclude_folders = 'spec/rails/{doc,lib,log,nbproject,tmp,vendor,test}'
exclude_files = FileList['**/*.log'] + FileList[exclude_folders+'/**/*'] + FileList[exclude_folders]
s.files = FileList['{examples,lib,tasks,spec}/**/*'] + %w(CHANGELOG init.rb LICENSE Rakefile README) - exclude_files
s.require_path = 'lib'
s.has_rdoc = true
s.test_files = Dir['spec/*_spec.rb']
s.author = 'Tom Anderson'
s.email = '[email protected]'
s.homepage = 'http://github.com/tra/spawn'
end
desc "Generate documentation for the #{spec.name} plugin."
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = spec.name
#rdoc.template = '../rdoc_template.rb'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README.rdoc', 'CHANGELOG.rdoc', 'LICENSE', 'lib/**/*.rb')
end
desc 'Generate a gemspec file.'
task :gemspec do
File.open("#{spec.name}.gemspec", 'w') do |f|
f.write spec.to_ruby
end
end
Rake::GemPackageTask.new(spec) do |p|
p.gem_spec = spec
p.need_tar = RUBY_PLATFORM =~ /mswin/ ? false : true
p.need_zip = true
end