How do I get the version from a gemspec file? How do I get the version from a gemspec file? ruby ruby

How do I get the version from a gemspec file?


require "rubygems"spec = Gem::Specification::load("example.gemspec")puts spec.version