Updates the version pattern to allow letters in the format - Ref #745

This commit is contained in:
erwanlr
2015-01-01 20:13:33 +01:00
parent ab7b7de60a
commit 42e8ab1680
3 changed files with 16 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ class WpItem
# This check is needed because readme_url can return nil
if has_readme?
response = Browser.get(readme_url)
@version = response.body[%r{(?:stable tag|version): ([0-9.]+)}i, 1]
@version = response.body[/(?:stable tag|version): (?!trunk)([0-9a-z.-]+)/i, 1]
end
end
@version

View File

@@ -0,0 +1,8 @@
Contributors: Ramoonus
Donate link: http://www.ramoonus.nl
Tags: Glow, javascript, bbc,
Requires at least: 3.9
Tested up to: 4.1
Stable tag: 2.0.0-beta1
This plugin adds BBCs Glow Javascript library to your set-up.

View File

@@ -47,6 +47,13 @@ shared_examples 'WpItem::Versionable' do
@expected = '141007'
end
end
context 'when version contains letters' do
it 'returns it' do
@file = '/beta1.txt'
@expected = '2.0.0-beta1'
end
end
end
end
end