3
我一邊讀https://github.com/thoughtbot/high_voltage源代碼,我在寶石規格文件中找到:爲什麼.freeze和.dup SomeGem :: VERSION?
Gem::Specification.new do |s|
s.name = 'high_voltage'
s.version = HighVoltage::VERSION.dup
和lib/high_voltage/version.rb
文件:
module HighVoltage
VERSION = "2.2.1".freeze
end
什麼是這樣做的好處呢?