# module WpItem::Versionable

### Public Instance Methods

to_s() click to toggle source

@return [ String ]

    # File lib/common/models/wp_item/versionable.rb, line 22
    def to_s
      item_version = self.version
      "#@name#{' v' + item_version.strip if item_version}"
    end

version() click to toggle source

Get the version from the readme.txt

@return [ String ] The version number

    # File lib/common/models/wp_item/versionable.rb, line 10
    def version
      unless @version
        # This check is needed because readme_url can return nil

        if has_readme?
          response = Browser.get(readme_url)
          @version = response.body[%r{stable tag: #{WpVersion.version_pattern}}, 1]
        end
      end
      @version
    end