/
Rakefile
50 lines (41 loc) · 1.31 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
require "rubygems/specification"
require "rake/testtask"
require "./lib/lather"
require "./lib/rake/lathertask"
namespace :gem do
LATHER = Gem::Specification.new do |s|
s.name = "lather"
s.version = Lather::VERSION
s.platform = Gem::Platform::RUBY
s.has_rdoc = false
s.summary = "Lather rinses and repeats."
s.description = s.summary
s.author = "John Barnette"
s.email = "jbarnette@gmail.com"
s.homepage = "http://github.com/jbarnette/lather"
s.require_path = "lib"
s.bindir = "bin"
s.executables = %w(lather)
s.files = %w(Rakefile README.markdown) + Dir["{bin,lib,test}/**/*"]
end
gemspec = file "#{LATHER.name}.gemspec" => LATHER.files do |file|
File.open(file.name, "w") do |f|
f.puts LATHER.to_ruby
end
end
gemfile = file "#{LATHER.name}-#{LATHER.version}.gem" => gemspec do |file|
sh "gem build #{file.prerequisites.first}"
end
desc "Build and install the gem"
task :install => gemfile do
sh "sudo gem install #{LATHER.name}-#{LATHER.version}.gem"
end
end
Rake::TestTask.new do |test|
test.libs << "test"
test.ruby_opts << "-rhelper"
test.test_files = FileList["test/**/*_test.rb"]
test.verbose = false
end
task :default => :test
Rake::LatherTask.new "{lib,test}/**/*.rb"