Method: LIBUSB::GemHelper#tag_version

Defined in:
lib/libusb/gem_helper.rb

#tag_versionObject



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/libusb/gem_helper.rb', line 59

def tag_version
  Bundler.ui.confirm "Tag release with annotation:"
  m = File.read(hfile).match(/(?<annotation>#{headline}.*?)#{headline}/m) || raise("Unable to find release notes in #{hfile}")
  Bundler.ui.info(m[:annotation].gsub(/^/, "    "))
  IO.popen(["git", "tag", "--file=-", version_tag], "w") do |fd|
    fd.write m[:annotation]
  end
  yield if block_given?
rescue
  Bundler.ui.error "Untagging #{version_tag} due to error."
  sh_with_code "git tag -d #{version_tag}"
  raise
end