forked from puppetlabs/puppetlabs_spec_helper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
51 lines (43 loc) · 1.38 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
require 'rake'
require 'rake/packagetask'
require 'rake/gempackagetask'
task :default do
sh %{rake -T}
end
require 'fileutils'
def version
# This ugly bit removes the gSHA1 portion of the describe as that causes failing tests
if File.exists?('.git')
%x{git describe}.chomp.gsub('-', '.').split('.')[0..3].join('.').gsub('v', '')
else
%x{pwd}.strip!.split('.')[-1]
end
end
spec = Gem::Specification.new do |s|
s.name = "puppetlabs_spec_helper"
s.version = version
s.platform = Gem::Platform::RUBY
s.authors = ["Puppet Labs"]
s.email = ["[email protected]"]
s.homepage = "http://github.com/puppetlabs/puppetlabs_spec_helper"
s.summary = "Standard tasks and configuration for module spec tests"
s.description = "Contains rake tasks and a standard spec_helper for running spec tests on puppet modules"
s.add_dependency("rake")
s.add_dependency("rspec", ">= 2.9.0")
s.add_dependency("mocha", ">= 0.10.5")
s.add_dependency("rspec-puppet", ">= 0.1.1")
s.files = Dir.glob("lib/**/*") + %w(LICENSE) + %w(CHANGELOG)
s.require_path = 'lib'
end
namespace :package do
desc "Create the gem"
task :gem do
Dir.mkdir("pkg") rescue nil
Gem::Builder.new(spec).build
FileUtils.move("puppetlabs_spec_helper-#{version}.gem", "pkg")
end
end
desc "Cleanup pkg directory"
task :clean do
FileUtils.rm_rf("pkg")
end