File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change 1
1
require 'bundler/gem_tasks'
2
2
require 'rspec/core/rake_task'
3
- require 'yard'
4
- require 'github/markup'
5
3
require 'rubocop/rake_task'
4
+ require 'github/markup'
6
5
require 'redcarpet'
6
+ require 'yard'
7
7
require 'yard/rake/yardoc_task'
8
8
9
9
desc 'Don\'t run Rubocop for unsupported versions'
18
18
YARD ::Rake ::YardocTask . new do |t |
19
19
OTHER_PATHS = %w( )
20
20
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 )
22
22
end
23
23
24
24
RuboCop ::RakeTask . new
@@ -32,4 +32,20 @@ task :make_bin_executable do
32
32
`chmod -R +x bin/*`
33
33
end
34
34
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
+
35
51
task default : args
You can’t perform that action at this time.
0 commit comments