-
Notifications
You must be signed in to change notification settings - Fork 2
/
rakefile
58 lines (46 loc) · 1.45 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
57
58
#-*- ruby -*-
require 'rubygems'
require 'rake'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'rake/contrib/rubyforgepublisher'
PKG_NAME = 'pcanusb'
PKG_VERSION = '1.0.0'
# Create compressed packages
dist_dirs = [ 'lib' ]
spec = Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = PKG_NAME
s.version = PKG_VERSION
s.summary = 'PCAN DLL wrapper'
s.description = <<EOF
PCAN is a Controller Area Network (CAN) device that connects to a PC via USB.
It ships with a DLL and documented API.
This is a Ruby wrapper for that API allowing CAN messages to be sent and received from Ruby.
EOF
s.has_rdoc = true
s.requirements << 'none'
s.require_path = 'lib'
s.autorequire = 'rake'
s.files = [ "rakefile" ]
dist_dirs.each do |dir|
s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
end
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
pkg.need_zip = true
end
desc "Publish the release files to RubyForge."
task :release => [ :package ] do
require 'rubyforge'
packages = %w( gem zip ).collect{ |ext| "pkg/#{PKG_NAME}-#{PKG_VERSION}.#{ext}" }
rubyforge = RubyForge.new
rubyforge.login
rubyforge.add_release(PKG_NAME, PKG_NAME, "REL #{PKG_VERSION}", *packages)
end
Rake::RDocTask.new do |rd|
rd.main = "lib/pcanusb.rb"
rd.rdoc_files.include("lib/**/*.rb")
end