独特かどうかはわかりませんが、、、
僕はこんなことしなかったし考えもしなかったなと。
まず、gemを作るときはversion.rbというファイルにversionを書きます。
そしてgemspecでそれを読むわけですが、
普通はこれくらいかなと。
Hogeというgemを作ると仮定して、
# hoge/version.rb
module Hoge
VERSION = "1.0.0".freeze
end
しかし、rails系(actionxxxxやactivesupportなどは)
# active_support/version.rb
module ActiveSupport
# Returns the version of the currently loaded ActiveSupport as a <tt>Gem::Version</tt>
def self.version
gem_version
end
end
# active_support/gem_version.rb
module ActiveSupport
# Returns the version of the currently loaded Active Support as a <tt>Gem::Version</tt>.
def self.gem_version
Gem::Version.new VERSION::STRING
end
module VERSION
MAJOR = 5
MINOR = 0
TINY = 0
PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
end
gem_version.rbを定義し、そこで管理している。
そこまでやる必要があるのかが正直わからないが、かっこいいなとだけ思いました。