forked from rodjek/librarian-puppet
-
Notifications
You must be signed in to change notification settings - Fork 38
/
Rakefile
47 lines (41 loc) · 1.35 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
require 'bundler/setup'
require 'cucumber/rake/task'
require 'rspec/core/rake_task'
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'rake/clean'
CLEAN.include('pkg/', 'tmp/')
CLOBBER.include('Gemfile.lock')
RSpec::Core::RakeTask.new
Cucumber::Rake::Task.new(:features)
Rake::TestTask.new do |test|
test.pattern = 'test/**/*_test.rb'
test.verbose = true
end
task :default => [:test, :spec, :features]
desc "Bump version to the next minor"
task :bump do
path = 'lib/librarian/puppet/version.rb'
version_file = File.read(path)
version = version_file.match(/VERSION = "(.*)"/)[1]
v = Gem::Version.new("#{version}.0")
new_version = v.bump.to_s
version_file = version_file.gsub(/VERSION = ".*"/, "VERSION = \"#{new_version}\"")
File.open(path, "w") {|file| file.puts version_file}
sh "git add #{path}"
sh "git commit -m \"Bump version to #{new_version}\""
end
begin
require 'rubygems'
require 'github_changelog_generator/task'
rescue LoadError
else
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix skip-changelog}
config.user = 'voxpupuli'
config.project = 'librarian-puppet'
config.since_tag = 'v3.0.1'
gem_version = Gem::Specification.load("#{config.project}.gemspec").version
config.future_release = "v#{gem_version}"
end
end