Updates the version pattern to allow letters in the format - Ref #745
This commit is contained in:
@@ -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
|
||||
|
||||
8
spec/samples/common/models/wp_item/versionable/beta1.txt
Normal file
8
spec/samples/common/models/wp_item/versionable/beta1.txt
Normal 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.
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user