forked from chef/chef
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
52 lines (41 loc) · 1.14 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
require File.dirname(__FILE__) + '/lib/chef-server-api/version'
require 'rubygems'
require 'rake/gempackagetask'
begin
require 'merb-core'
require 'merb-core/tasks/merb'
rescue LoadError
STDERR.puts "merb is not installed, merb rake tasks will not be available."
end
GEM_NAME = "chef-server-api"
spec = eval(File.read("chef-server-api.gemspec"))
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
begin
require 'rspec/core/rake_task'
desc "Run all specs in spec directory"
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = FileList['spec/unit/**/*_spec.rb']
end
rescue LoadError
desc "Install rspec to run the specs"
task :spec do
abort "rspec is not available, (sudo) gem install rspec to run tests"
end
end
task :default => :spec
desc "Install the gem"
task :install => :package do
sh %{gem install pkg/#{GEM_NAME}-#{ChefServerApi::VERSION} --no-rdoc --no-ri}
end
desc "Uninstall the gem"
task :uninstall do
sh %{gem uninstall #{GEM_NAME} -x -v #{ChefServerApi::VERSION} }
end
desc "Create a gemspec file"
task :gemspec do
File.open("#{GEM_NAME}.gemspec", "w") do |file|
file.puts spec.to_ruby
end
end