WpItem::Versionable specs

This commit is contained in:
erwanlr
2013-03-25 16:03:34 +01:00
parent 2ad2b8866b
commit 95041945ff
6 changed files with 94 additions and 67 deletions

View File

@@ -3,11 +3,11 @@
class WpItem
attr_writer :version
#def allowed_options; super << :version end
module Versionable
# Get the version from the readme.txt
#
# @return [ String ] The version number
def version
unless @version
response = Browser.instance.get(readme_url)
@@ -16,6 +16,7 @@ class WpItem
@version
end
# @return [ String ]
def to_s
item_version = self.version
"#@name#{' v' + item_version.strip if item_version}"