-
Notifications
You must be signed in to change notification settings - Fork 11
/
Rakefile
69 lines (57 loc) · 1.97 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
59
60
61
62
63
64
65
66
67
require 'rake'
require 'rake/clean'
require 'rdoc/task'
require 'rake/testtask'
require 'fileutils'
require 'tempfile'
include FileUtils
RbConfig = Config unless defined? RbConfig
NAME = "libcraigscrape"
VERS = ENV['VERSION'] || "1.0"
PKG = "#{NAME}-#{VERS}"
RDOC_OPTS = ['--quiet', '--title', 'The libcraigscrape Reference', '--main', 'README', '--inline-source']
RDOC_FILES = ['README', "CHANGELOG", "COPYING","COPYING.LESSER", 'bin/craigwatch']
PKG_FILES = (%w(Rakefile) + RDOC_FILES + Dir.glob("{bin,test,lib}/**/*")).uniq.sort_by{|a,b| (a == 'lib/libcraigscrape.rb') ? -1 : 0 }
SPEC =
Gem::Specification.new do |s|
s.name = NAME
s.version = VERS
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
s.bindir = 'bin'
s.executables = 'craigwatch'
s.rdoc_options += RDOC_OPTS
s.extra_rdoc_files = RDOC_FILES
s.summary = "quick, easy, craigslist parsing library that takes the monotony out of working with craigslist posts and listings"
s.description = s.summary
s.author = "Chris DeRose, DeRose Technologies, Inc."
s.email = '[email protected]'
s.homepage = 'http://www.derosetechnologies.com/community/libcraigscrape'
s.rubyforge_project = 'libcraigwatch'
s.files = PKG_FILES
s.require_paths = ["lib"]
s.test_files = FileList['test/test_*.rb']
end
desc "Run all the tests"
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/test_*.rb']
t.verbose = true
end
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'doc/rdoc'
rdoc.options += RDOC_OPTS
rdoc.main = "README"
# NOTE: If you don't put libcraigscrape.rb at the beginning, the rdoc ends up looking a little screwy
rdoc.rdoc_files.add RDOC_FILES+Dir.glob('lib/*.rb').sort_by{|a,b| (a == 'lib/libcraigscrape.rb') ? -1 : 0 }
end
task "lib" do
directory "lib"
end
task :install do
sh %{rake package}
sh %{sudo gem install pkg/#{NAME}-#{VERS}}
end
task :uninstall => [:clean] do
sh %{sudo gem uninstall #{NAME}}
end