Module: Reissue::Gem
- Included in:
- Task
- Defined in:
- lib/reissue/gem.rb
Instance Method Summary collapse
-
#apply_version_bump(updater, bump) ⇒ Object
Keep bundler's gemspec in step with the bump.
- #initialize ⇒ Object
- #sync_bundler_gemspec_version(new_version) ⇒ Object
Instance Method Details
#apply_version_bump(updater, bump) ⇒ Object
Keep bundler's gemspec in step with the bump.
Bundler loads the gemspec when bundler/gem_tasks is required, well before
reissue:bump rewrites the version file. gem build shells out and re-reads
the file, so the gem itself carries the bumped version, but the release tag
and bundler's confirmation messages read the copy held in memory. Without
this they name the version from before the bump, and the release publishes
one version under another version's tag.
19 20 21 22 23 |
# File 'lib/reissue/gem.rb', line 19 def apply_version_bump(updater, bump) new_version = super sync_bundler_gemspec_version(new_version) new_version end |
#initialize ⇒ Object
6 7 8 9 |
# File 'lib/reissue/gem.rb', line 6 def initialize(...) super @updated_paths << "checksums" end |
#sync_bundler_gemspec_version(new_version) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/reissue/gem.rb', line 26 def sync_bundler_gemspec_version(new_version) return unless defined?(Bundler::GemHelper) helper = Bundler::GemHelper.instance return unless helper&.gemspec helper.gemspec.version = ::Gem::Version.new(new_version) end |