Skip to content

Commit

Permalink
Add deprecation horizon management to the release script
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Feb 14, 2022
1 parent 4b53157 commit 312954b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/view_component/deprecation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
require "active_support/deprecation"

module ViewComponent
Deprecation = ActiveSupport::Deprecation.new("3.0", "ViewComponent")
DEPRECATION_HORIZON = 3
Deprecation = ActiveSupport::Deprecation.new(DEPRECATION_HORIZON.to_s, "ViewComponent")
end
6 changes: 6 additions & 0 deletions script/release
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ update_ruby_version() {
-e "s/MINOR = [0-9]+/MINOR = $2/g" \
-e "s/PATCH = [0-9]+/PATCH = $3/g" \
lib/view_component/version.rb

# Update deprecation horizon version
major=$1
sed -E -i '' \
-e "s/DEPRECATION_HORIZON = [0-9]+/DEPRECATION_HORIZON = $((major + 1))/g" \
lib/view_component/deprecation.rb
}

update_gemfiles() {
Expand Down

0 comments on commit 312954b

Please sign in to comment.