Skip to content

Commit 0b6f257

Browse files
committed
Use standard Rakefile
1 parent ca0f44d commit 0b6f257

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

Rakefile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require 'bundler/gem_tasks'
22
require 'rspec/core/rake_task'
3-
require 'yard'
4-
require 'github/markup'
53
require 'rubocop/rake_task'
4+
require 'github/markup'
65
require 'redcarpet'
6+
require 'yard'
77
require 'yard/rake/yardoc_task'
88

99
desc 'Don\'t run Rubocop for unsupported versions'
@@ -18,7 +18,7 @@ end
1818
YARD::Rake::YardocTask.new do |t|
1919
OTHER_PATHS = %w()
2020
t.files = ['lib/**/*.rb', 'bin/**/*.rb', OTHER_PATHS]
21-
t.options = %w(--markup-provider=redcarpet --markup=markdown --main=README.md --files CHANGELOG.md)
21+
t.options = %w(--markup-provider=redcarpet --markup=markdown --main=README.md --files CHANGELOG.md,CONTRIBUTING.md)
2222
end
2323

2424
RuboCop::RakeTask.new
@@ -32,4 +32,20 @@ task :make_bin_executable do
3232
`chmod -R +x bin/*`
3333
end
3434

35+
desc 'Retrieve the current version'
36+
task :version do
37+
puts SensuPluginsPostgres::Version.json_version
38+
end
39+
40+
desc 'Bump the PATCH version'
41+
task :bump do
42+
version_file = 'lib/sensu-plugins-postgres/version.rb'
43+
44+
# Read the file, bump the PATCH version
45+
contents = File.read(version_file).gsub(/(PATCH = )(\d+)/) { |_| Regexp.last_match[1] + (Regexp.last_match[2].to_i + 1).to_s }
46+
47+
# Write the new contents of the file
48+
File.open(version_file, 'w') { |file| file.puts contents }
49+
end
50+
3551
task default: args

0 commit comments

Comments
 (0)