From 2728ed58a333c3c985ba17df828ef716d995fd06 Mon Sep 17 00:00:00 2001 From: Andy Cohen Date: Wed, 11 Feb 2026 12:29:35 -0600 Subject: [PATCH 1/2] Add --version Option to bin/bump_version script + custom banner --- bin/bump_version | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/bin/bump_version b/bin/bump_version index e4c06217..983ca409 100755 --- a/bin/bump_version +++ b/bin/bump_version @@ -11,6 +11,7 @@ class VersionBumper < Thor::Group class_exclusive do class_option :patch, type: :boolean, lazy_default: false, desc: 'Bump patch version instead of minor version' class_option :major, type: :boolean, lazy_default: false, desc: 'Bump major version instead of minor version' + class_option :version, type: :string, desc: 'Bump to a specific version (overrides patch and major options)' end source_root File.expand_path('../', __FILE__) @@ -43,18 +44,19 @@ class VersionBumper < Thor::Group def new_version_string @new_version_string ||= begin - nv = current_version.bump - nv = nv.bump if options[:major] + nv = current_version + nv = nv.bump unless options.version? + nv = nv.bump if options.major? nv.segments.fill(0, nv.segments.size, 3 - nv.segments.size).join('.') end end def current_version Gem::Version.new( - if options[:patch] + if options.patch? RolemodelRails::VERSION + '.0' else - RolemodelRails::VERSION + options[:version] || RolemodelRails::VERSION end ) end @@ -64,6 +66,16 @@ class VersionBumper < Thor::Group run "#{Gem.bin_path("bundler", "bundle")} install --quiet" end end + + class << self + def banner + <<~BANNER + bin/bump_version [--patch|--major|--version VERSION] + BANNER + end + + def desc = 'Advance the gem version, build the gem, and update example apps' + end end VersionBumper.start(ARGV) From 267a4d9c6ac2dba381f686b2220c20ddd87161e8 Mon Sep 17 00:00:00 2001 From: Andy Cohen Date: Wed, 11 Feb 2026 12:40:46 -0600 Subject: [PATCH 2/2] clean up --- bin/bump_version | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/bin/bump_version b/bin/bump_version index 983ca409..3ba1ca6c 100755 --- a/bin/bump_version +++ b/bin/bump_version @@ -68,13 +68,8 @@ class VersionBumper < Thor::Group end class << self - def banner - <<~BANNER - bin/bump_version [--patch|--major|--version VERSION] - BANNER - end - - def desc = 'Advance the gem version, build the gem, and update example apps' + def banner = 'bin/bump_version [--patch|--major|--version VERSION]' + def desc = 'Update Gem Version & Sync Example Apps' end end