lib/omnibus/build_version_dsl.rb
def construct_build_version(version_source = nil)
      case source_type
      when :git
        version = if version_source
                    Omnibus::BuildVersion.new(version_source.project_dir)
                  else
                    Omnibus::BuildVersion.new
                  end

        output = output_method || :semver
        self.build_version = version.send(output)
      when :version
        if version_source
          self.build_version = version_source.version
        else
          raise "Please tell me the source to get the version from"
        end
      else
        raise "I don't know how to construct a build_version using source '#{source_type}'"
      end
    end
def construct_build_version(version_source = nil)
      case source_type
      when :git
        version = if version_source
                    Omnibus::BuildVersion.new(version_source.project_dir)
                  else
                    Omnibus::BuildVersion.new
                  end

        output = output_method || :semver
        self.build_version = version.send(output)
      when :version
        if version_source
          self.build_version = version_source.version
        else
          raise "Please tell me the source to get the version from"
        end
      else
        raise "I don't know how to construct a build_version using source '#{source_type}'"
      end
    end
Determines the build_version based on source_type, output_method.

 @param version_source [Omnibus::Software] Software object from which the
   build version will be determined from. Default is nil.
 @return [void]