Skip to content

Commit

Permalink
Script for automatic version update (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonovk authored May 15, 2024
1 parent 136ae61 commit e2439f2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require:
- rubocop-rspec
- rubocop-rake

AllCops:
NewCops: enable
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ gem 'sinatra', '~> 4.0'
group :development do
gem 'byebug', '~> 11.1', '>= 11.1.3'
gem 'dotenv', '~> 3.1', '>= 3.1.2'
gem 'rake', '~> 13.2', '>= 13.2.1'
gem 'rspec', '~> 3.13'
gem 'rubocop', '~> 1.63'
gem 'rubocop-rake', '~> 0.6.0'
gem 'rubocop-rspec', '~> 2.29', '>= 2.29.2'
gem 'super_diff', '~> 0.12.1'
end
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ GEM
rack-session (2.0.0)
rack (>= 3.0.0)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.0)
rexml (3.2.6)
rspec (3.13.0)
Expand Down Expand Up @@ -65,6 +66,8 @@ GEM
rubocop (~> 1.41)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.29.2)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
Expand Down Expand Up @@ -97,8 +100,10 @@ DEPENDENCIES
dotenv (~> 3.1, >= 3.1.2)
ipaddr (~> 1.2, >= 1.2.6)
puma (~> 6.4, >= 6.4.2)
rake (~> 13.2, >= 13.2.1)
rspec (~> 3.13)
rubocop (~> 1.63)
rubocop-rake (~> 0.6.0)
rubocop-rspec (~> 2.29, >= 2.29.2)
sinatra (~> 4.0)
super_diff (~> 0.12.1)
Expand Down
28 changes: 28 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# frozen_string_literal: true

desc 'bump pathc version'
task :bump do
version = File.read('VERSION').gsub('v', '')
semver = version.split('.')
new_pathc = semver.last.to_i + 1
semver[2] = new_pathc.to_s
new_version = "v#{semver.join('.')}"
File.write('VERSION', new_version)
end

desc 'bump minor vesrion'
task :bump_minor do
version = File.read('VERSION').gsub('v', '')
semver = version.split('.')
new_pathc = semver[1].to_i + 1
semver[1] = new_pathc.to_s
semver[2] = '0'
new_version = "v#{semver.join('.')}"
File.write('VERSION', new_version)
end

desc 'rubocop and rspec check'
task :check do
system 'rspec'
system 'rubocop'
end

0 comments on commit e2439f2

Please sign in to comment.